mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-13 15:56:57 +08:00
update collect info
This commit is contained in:
@@ -1,28 +1,66 @@
|
|||||||
import sys, platform
|
import sys
|
||||||
|
import platform
|
||||||
import qlib
|
import qlib
|
||||||
|
import fire
|
||||||
|
import pkg_resources
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
QLIB_PATH = Path(__file__).absolute().resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
def linux_distribution():
|
class InfoCollector:
|
||||||
try:
|
def sys(self):
|
||||||
return platform.linux_distribution()
|
"""collect system related info"""
|
||||||
except:
|
for method in ["system", "machine", "platform", "version"]:
|
||||||
return "N/A"
|
print(getattr(platform, method)())
|
||||||
|
|
||||||
|
def py(self):
|
||||||
|
"""collect Python related info"""
|
||||||
|
print("Python version: {}".format(sys.version.replace("\n", " ")))
|
||||||
|
|
||||||
|
def qlib(self):
|
||||||
|
"""collect qlib related info"""
|
||||||
|
print("Qlib version: {}".format(qlib.__version__))
|
||||||
|
REQUIRED = [
|
||||||
|
"numpy",
|
||||||
|
"pandas",
|
||||||
|
"scipy",
|
||||||
|
"requests",
|
||||||
|
"sacred",
|
||||||
|
"pymongo",
|
||||||
|
"python-socketio",
|
||||||
|
"redis",
|
||||||
|
"python-redis-lock",
|
||||||
|
"schedule",
|
||||||
|
"cvxpy",
|
||||||
|
"hyperopt",
|
||||||
|
"fire",
|
||||||
|
"statsmodels",
|
||||||
|
"xlrd",
|
||||||
|
"plotly",
|
||||||
|
"matplotlib",
|
||||||
|
"tables",
|
||||||
|
"pyyaml",
|
||||||
|
"mlflow",
|
||||||
|
"tqdm",
|
||||||
|
"loguru",
|
||||||
|
"lightgbm",
|
||||||
|
"tornado",
|
||||||
|
"joblib",
|
||||||
|
"fire",
|
||||||
|
"ruamel.yaml",
|
||||||
|
]
|
||||||
|
|
||||||
|
for package in REQUIRED:
|
||||||
|
version = pkg_resources.get_distribution(package).version
|
||||||
|
print(f"{package}=={version}")
|
||||||
|
|
||||||
|
def all(self):
|
||||||
|
"""collect all info"""
|
||||||
|
for method in ["sys", "py", "qlib"]:
|
||||||
|
getattr(self, method)()
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
print("Qlib version: {} \n".format(qlib.__version__))
|
if __name__ == "__main__":
|
||||||
print(
|
fire.Fire(InfoCollector)
|
||||||
"""Python version: {} \n
|
|
||||||
linux_distribution: {}
|
|
||||||
system: {}
|
|
||||||
machine: {}
|
|
||||||
platform: {}
|
|
||||||
version: {}
|
|
||||||
""".format(
|
|
||||||
sys.version.split("\n"),
|
|
||||||
linux_distribution(),
|
|
||||||
platform.system(),
|
|
||||||
platform.machine(),
|
|
||||||
platform.platform(),
|
|
||||||
platform.version(),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user