-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add runtime info * Update rdagent/scenarios/data_science/scen/__init__.py Co-authored-by: you-n-g <[email protected]> * reformatted by black --------- Co-authored-by: you-n-g <[email protected]>
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import platform | ||
import sys | ||
from importlib.metadata import distributions | ||
|
||
|
||
def print_runtime_info(): | ||
print(f"Python {sys.version} on {platform.system()} {platform.release()}") | ||
|
||
|
||
def get_installed_packages(): | ||
return {dist.metadata["Name"].lower(): dist.version for dist in distributions()} | ||
|
||
|
||
def print_filtered_packages(installed_packages, filtered_packages): | ||
for package_name in filtered_packages: | ||
version = installed_packages.get(package_name.lower()) | ||
if version: | ||
print(f"{package_name}=={version}") | ||
|
||
|
||
if __name__ == "__main__": | ||
print_runtime_info() | ||
filtered_packages = [ | ||
"transformers", | ||
"accelerate", | ||
"torch", | ||
"tensorflow", | ||
"pandas", | ||
"numpy", | ||
"scikit-learn", | ||
"scipy", | ||
"lightgbm", | ||
"vtk", | ||
"opencv-python", | ||
"keras", | ||
"matplotlib", | ||
"pydicom", | ||
] | ||
installed_packages = get_installed_packages() | ||
print_filtered_packages(installed_packages, filtered_packages) |