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

Add method that show base installation info about gensim & related packages. Fix #1902 #1903

Merged
merged 10 commits into from
Feb 15, 2018
19 changes: 19 additions & 0 deletions gensim/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import platform
import sys
import numpy
import scipy
import gensim
import argparse

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docstring for the module, should looks like 117d447#diff-cbaf05cc913e951e3205d150e33edf2eR9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, don't forget about .. program-output:: section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, need to add .rst to gensim/docs/src

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, need to add .rst to gensim/docs/src

How do I do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look into gensim/docs/src/scripts for example, you'll see several *.rst files, you need to add something similar to needed place (same as in package hierarchy).

if __name__ == "__main__":

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

parser = argparse.ArgumentParser()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the description? Should use __doc__ variable like here 117d447

parser.add_argument("--info", action="store_true", help="Display version of Gensim and its dpendencies")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation should be 4 spaces (not 8)

opt = parser.parse_args()
if opt.info:
print(platform.platform())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move it do distinct function (that returns dict with information)

from gesnim import package_info

info = package_info()

and print it here in nice manner

print("Python", sys.version)
print("NumPy", numpy.__version__)
print("SciPy", scipy.__version__)
print("gensim", gensim.__version__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing smart_open, FAST_VERSION and path where gensim installed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for smart_open smart_open.__version__ doesn't work as the variable does not exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to found other way