-
-
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
Remove ignore of E731 #1689
Remove ignore of E731 #1689
Conversation
8267d8e
to
04d7f87
Compare
gensim/test/test_atmodel.py
Outdated
datapath = lambda fname: os.path.join(module_path, 'test_data', fname) | ||
|
||
|
||
def datapath(fname): |
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.
please create utils
file and move this function (replace to import everywhere).
gensim/test/test_fasttext_wrapper.py
Outdated
def datapath(fname): | ||
return os.path.join(module_path, 'test_data', fname) | ||
|
||
|
||
def testfile(): |
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.
Same as datapath
gensim/test/test_ldamodel.py
Outdated
@@ -25,8 +25,6 @@ | |||
from gensim.test import basetmtests | |||
|
|||
module_path = os.path.dirname(__file__) # needed because sample data files are located in the same folder | |||
datapath = lambda fname: os.path.join(module_path, 'test_data', fname) | |||
|
|||
|
|||
# set up vars used in testing ("Deerwester" from the web tutorial) | |||
texts = [ |
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.
same as datapath
gensim/test/test_atmodel.py
Outdated
@@ -27,6 +24,7 @@ | |||
from gensim.models import atmodel | |||
from gensim import matutils | |||
from gensim.test import basetmtests | |||
from gensim.test.utils import (datapath, get_tmpfile) |
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.
useless ()
(here and anywhere)
@@ -507,7 +498,7 @@ def testPersistence(self): | |||
self.assertTrue(np.allclose(model.state.gamma, model2.state.gamma)) | |||
|
|||
def testPersistenceIgnore(self): | |||
fname = testfile('testPersistenceIgnore') | |||
fname = get_tmpfile('gensim_models_atmodel_testPersistenceIgnore.tst') |
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.
it's a good idea to use same notation, what's your choice?
gensim/test/test_atmodel.py
Outdated
@@ -36,9 +34,6 @@ | |||
# increases the bound. | |||
# Test that models are compatiple across versions, as done in LdaModel. | |||
|
|||
module_path = os.path.dirname(__file__) # needed because sample data files are located in the same folder | |||
datapath = lambda fname: os.path.join(module_path, 'test_data', fname) | |||
|
|||
# set up vars used in testing ("Deerwester" from the web tutorial) | |||
texts = [ |
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 text
used in many places, maybe move to utils too?
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.
hmm,
- it's data, not utils/functions
- maybe in another PR ?
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.
- Yeah, but it's "common resource", I think that's fine.
- No need to create distinct PR for this change.
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.
- Ok, I'll fix it.
- small PR is better to review and faster to merge.
module_path = os.path.dirname(__file__) # needed because sample data files are located in the same folder | ||
|
||
|
||
def datapath(fname): |
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.
Please add docstring in numpy-style for both functions
gensim/utils.py
Outdated
compress = False | ||
subname = lambda *args: '.'.join(list(args) + ['npy']) | ||
return compress, subname | ||
[compress, suffix] = (True, 'npz') if fname.endswith('.gz') or fname.endswith('.bz2') else (False, 'npy') |
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.
useless []
close/open for init AppVeyor |
Great work @horpto🥇, you are very active in the gensim project 👍 👍 👍 |
No description provided.