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 corpora #1001

Closed
wants to merge 1 commit into from
Closed

PEP8 fixes for corpora #1001

wants to merge 1 commit into from

Conversation

souravsingh
Copy link
Contributor

Fixes a small part of #965

@souravsingh souravsingh closed this Nov 9, 2016
@souravsingh souravsingh deleted the pep8-fix branch November 9, 2016 13:20
@@ -119,7 +119,7 @@ def line2doc(self, line):
marker.add(word)
# construct a list of (wordIndex, wordFrequency) 2-tuples
doc = list(zip(map(self.word2id.get, use_words),
map(words.count, use_words)))
map(words.count, use_words)))
Copy link
Owner

Choose a reason for hiding this comment

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

No vertical indent in gensim; use hanging indent in all cases (& no statement on first line).

@@ -166,8 +166,8 @@ 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" %
truncated)
"integer elements; %i float entries were truncated to integer value" %
Copy link
Owner

Choose a reason for hiding this comment

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

Dtto (please use hanging indent consistently).

Also, we want to be passing logging message string parameters as arguments, not using them to format the string directly (wasted effort if message doesn't pass logging filters): logger.fnc("%s", x), not logger.fnc("%s" % x).

@@ -236,7 +236,7 @@ def __init__(self, output_prefix, corpus, dim=None,
# corresponds to index 0 of current shard

logger.info('Initializing sharded corpus with prefix '
'{0}'.format(output_prefix))
Copy link
Owner

Choose a reason for hiding this comment

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

Hanging indent.

@@ -245,7 +245,7 @@ def __init__(self, output_prefix, corpus, dim=None,
# and retain information about how the corpus
# was serialized.
logger.info('Saving ShardedCorpus object to '
'{0}'.format(self.output_prefix))
'{0}'.format(self.output_prefix))
Copy link
Owner

Choose a reason for hiding this comment

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

Hanging indent.

@@ -262,12 +262,12 @@ def init_shards(self, output_prefix, corpus, shardsize=4096, dtype=_default_dtyp
if proposed_dim != self.dim:
if self.dim is None:
logger.info('Deriving dataset dimension from corpus: '
'{0}'.format(proposed_dim))
'{0}'.format(proposed_dim))
Copy link
Owner

Choose a reason for hiding this comment

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

Hanging indent. Last comment -- please fix all.

@piskvorky
Copy link
Owner

piskvorky commented Nov 9, 2016

What's happening with these pull request? I write a review and then they disappear again, closed without merging or any message...?

@souravsingh
Copy link
Contributor Author

Sorry for closing this PR. I was trying to create separate PR for corpora and topic_coherence in different branches, but somehow the changes for both corpora and topic_coherence got into the PR #1002

@piskvorky
Copy link
Owner

My review comments here stand; please address them in the other PRs.

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.

2 participants