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

PEP8 Fixes for topic_coherence and corpora #1002

Merged
merged 7 commits into from
Nov 11, 2016
Merged

PEP8 Fixes for topic_coherence and corpora #1002

merged 7 commits into from
Nov 11, 2016

Conversation

souravsingh
Copy link
Contributor

Fixes a part of #965

@souravsingh
Copy link
Contributor Author

souravsingh commented Nov 9, 2016

I have ignored all E501 PEP8 errors in the PR

@souravsingh
Copy link
Contributor Author

@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:
Copy link
Contributor

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?

Copy link
Contributor Author

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...

Copy link
Contributor

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.

Copy link
Contributor

@tmylk tmylk left a 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"
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

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:
Copy link
Contributor

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.

@piskvorky
Copy link
Owner

See my review comments from all your other (now closed) PRs.

@souravsingh
Copy link
Contributor Author

I have addressed all the comments made by @tmylk. Let me know if there are more.

@tmylk tmylk merged commit 0c8dba6 into piskvorky:develop Nov 11, 2016
@tmylk
Copy link
Contributor

tmylk commented Nov 11, 2016

Thanks for the PR!

@souravsingh souravsingh deleted the pep8-topic branch November 11, 2016 13:48
@piskvorky
Copy link
Owner

piskvorky commented Nov 11, 2016

None of my review comments were addressed (indent, line breaks). Please revert @tmylk .

@tmylk
Copy link
Contributor

tmylk commented Nov 13, 2016

@souravsingh Reverted. See https://www.python.org/dev/peps/pep-0008/#indentation for hanging indent description

@souravsingh souravsingh deleted the pep8-topic branch November 13, 2016 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants