8000 [MRG] Remove duplicate import of warnings & unused variables by rebekahkim · Pull Request #12203 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[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

Merged
merged 4 commits into from
Sep 30, 2018

Conversation

rebekahkim
Copy link
Contributor
@rebekahkim rebekahkim commented Sep 29, 2018

Working on #12167

This resolves several LGTM alerts in /ensemble:

  1. only importing used attributes/functions from warnings module
  2. remove unused variables

@@ -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
Copy link
Member

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

Copy link
Member
@amueller amueller left a 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 '
Copy link
Member

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

@sklearn-lgtm
Copy link

This pull request fixes 4 alerts when merging dcb585d into 2cf145d - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Module is imported with 'import' and 'import from'

Comment posted by LGTM.com

@sklearn-lgtm
Copy link

This pull request fixes 4 alerts when merging db45167 into 2cf145d - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Module is imported with 'import' and 'import from'

Comment posted by LGTM.com

Copy link
Member
@amueller amueller left a 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.

Copy link
Member
@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @rebekahkim

@qinhanmin2014 qinhanmin2014 merged commit 9d58ca5 into scikit-learn:master Sep 30, 2018
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Oct 15, 2018
@rebekahkim rebekahkim deleted the varname-fixes branch February 27, 2019 08:52
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.

4 participants
0