-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] Remove duplicate import of warnings & unused variables #12203
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
Conversation
sklearn/ensemble/forest.py
Outdated
@@ -41,7 +41,8 @@ class calls the ``fit`` method of each sub-estimator on random samples | |||
|
|||
from __future__ import division | |||
|
|||
import warnings | |||
from warnings import catch_warnings |
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 can do multiple imports on the same line, from warnings import catch_warnings, simplefilter, warn
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.
Looks good if the tests pass.
@@ -217,7 +216,7 @@ def fit(self, X, y=None, sample_weight=None): | |||
self._contamination = self.contamination | |||
|
|||
if self.behaviour == 'old': | |||
warnings.warn('behaviour="old" is deprecated and will be removed ' | |||
warn('behaviour="old" is deprecated and will be removed ' |
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.
actually I think you need to fix the indentation here. make sure you run flake8 on this file
This pull request fixes 4 alerts when merging dcb585d into 2cf145d - view on LGTM.com fixed alerts:
Comment posted by LGTM.com |
This pull request fixes 4 alerts when merging db45167 into 2cf145d - view on LGTM.com fixed alerts:
Comment posted by LGTM.com |
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.
looks good, let's wait for the CI.
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.
LGTM, thanks @rebekahkim
Working on #12167
This resolves several LGTM alerts in /ensemble: