Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New] cs.show_env() to show environment #1231

Open
lisphilar opened this issue Sep 23, 2022 · 3 comments
Open

[New] cs.show_env() to show environment #1231

lisphilar opened this issue Sep 23, 2022 · 3 comments
Labels
brainstorming Discussion to get creative ideas enhancement New feature or request

Comments

@lisphilar
Copy link
Owner

Summary of this new feature

New function .show_env() will show the environement, including covsirphy version, its dependencies' version, Python version, platform information.

Inspilation: pandas.show_versions()

CovsirPhy version I used: 2.27.0

@lisphilar lisphilar added enhancement New feature or request brainstorming Discussion to get creative ideas labels Sep 23, 2022
@lisphilar
Copy link
Owner Author

Show currently install versions of target library and its dependencies:

from importlib.metadata import distribution, requires
from pprint import pprint

target = "covsirphy"
dependencies = [target] + [r[:r.find(" (")] for r in requires(target)]
versions = [distribution(dep).version for dep in dependencies]
pprint({k: v for (k, v) in zip(dependencies, versions)}, sort_dicts=False)

@lisphilar
Copy link
Owner Author

Python version and OS:

import platform
platform.python_version()
platform.platform()

@lisphilar
Copy link
Owner Author

After completion, this method will be explained in YAML issue templates. #1232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Discussion to get creative ideas enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant