-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add memory to make_pipeline function #458
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 memory to make_pipeline function #458
Conversation
Just put an entry in what's new as a bug fix. Good catch |
Oh and a regression test |
Hello @chkoar! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on August 26, 2018 at 11:15 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #458 +/- ##
=========================================
Coverage ? 98.78%
=========================================
Files ? 75
Lines ? 4628
Branches ? 0
=========================================
Hits ? 4572
Misses ? 56
Partials ? 0
Continue to review full report at Codecov.
|
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.
Still need a what's new ;)
imblearn/tests/test_pipeline.py
Outdated
pipeline = make_pipeline(DummyTransf(), SVC(), memory=memory) | ||
assert_true(pipeline.memory is memory) | ||
pipeline = make_pipeline(DummyTransf(), SVC()) | ||
assert_true(pipeline.memory is None) |
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.
Use assert pipeline.memory is None
imblearn/tests/test_pipeline.py
Outdated
cachedir = mkdtemp() | ||
if LooseVersion(joblib_version) < LooseVersion('0.12'): | ||
# Deal with change of API in joblib | ||
memory = Memory(cachedir=cachedir, verbose=10) |
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 would not bother. I would make the one that work and update when the test will break when we will update the scikit learn version
imblearn/tests/test_pipeline.py
Outdated
else: | ||
memory = Memory(location=cachedir, verbose=10) | ||
pipeline = make_pipeline(DummyTransf(), SVC(), memory=memory) | ||
assert_true(pipeline.memory is memory) |
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.
Plain assert
imblearn/tests/test_pipeline.py
Outdated
pipeline = make_pipeline(DummyTransf(), SVC()) | ||
assert_true(pipeline.memory is None) | ||
|
||
shutil.rmtree(cachedir) |
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.
You need a try ... finally to be sure to remove the folder even if the test fail
@glemaitre does this considered as a bug fix or as an enhancement? |
Bugs I would say. It should have been there. |
@glemaitre ok |
Tanks |
What does this implement/fix? Explain your changes.
Adds the ability to pass a joblib.Memory object to the
make_pipeline
function.