-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
PEP8 Fixes for topic_coherence and corpora #1002
Conversation
I have ignored all E501 PEP8 errors in the PR |
@piskvorky Pull request for some PEP8 fixes are done here. |
from six import PY3, iteritems, iterkeys, itervalues, string_types | ||
from six.moves import xrange | ||
from six.moves import zip as izip | ||
|
||
if sys.version_info[0] >= 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no clue about the line...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be where it was before.
As per PEP8:
Imports should be grouped in the following order:
standard library imports
related third party imports
local application/library specific imports
You should put a blank line between each group of imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments.
@@ -166,7 +166,7 @@ def save_corpus(fname, corpus, id2word=None, metadata=False): | |||
|
|||
if truncated: | |||
logger.warning("List-of-words format can only save vectors with " | |||
"integer elements; %i float entries were truncated to integer value" % | |||
"integer elements; %i float entries were truncated to integer value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the '%' sign should stay there for the substitution to work. Why was it removed?
@@ -26,6 +26,13 @@ | |||
import scipy.sparse as sparse | |||
import time | |||
|
|||
from six.moves import xrange | |||
|
|||
import gensim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gensim imports should be after all the other imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically after Theano.
See pep8 for order of imports
from six import PY3, iteritems, iterkeys, itervalues, string_types | ||
from six.moves import xrange | ||
from six.moves import zip as izip | ||
|
||
if sys.version_info[0] >= 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be where it was before.
As per PEP8:
Imports should be grouped in the following order:
standard library imports
related third party imports
local application/library specific imports
You should put a blank line between each group of imports.
See my review comments from all your other (now closed) PRs. |
I have addressed all the comments made by @tmylk. Let me know if there are more. |
Thanks for the PR! |
None of my review comments were addressed (indent, line breaks). Please revert @tmylk . |
@souravsingh Reverted. See https://www.python.org/dev/peps/pep-0008/#indentation for hanging indent description |
Fixes a part of #965