-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
MAINT: removed unused imports listed in LGTM #19090
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
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.
Not all unused imports are safe to remove; some of them have side-effects, while others are part of the public API
numpy/compat/py3k.py
Outdated
@@ -21,9 +21,6 @@ | |||
from pathlib import Path | |||
import io | |||
|
|||
import abc | |||
from abc import ABC as abc_ABC |
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.
The fact these are imported here is considered public API for this module
numpy/lib/function_base.py
Outdated
@@ -33,7 +33,6 @@ | |||
import builtins | |||
|
|||
# needed in this module for compatibility | |||
from numpy.lib.histograms import histogram, histogramdd |
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.
idem., See the comment on the line above.
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.
Should these be added to __all__
then?
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.
Might be worthwhile to figure out why exactly they're here in the first place.
Based on the answer deprecating (or removing) them might be desirable over adding them to __all__
.
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.
Ah, found it: four years ago they were moved from function_base
to histograms
in a namespace clean up (#10186).
Honestly, this period is long enough that I'd advocate for their deprecation.
numpy/distutils/mingw32ccompiler.py
Outdated
@@ -15,7 +15,6 @@ | |||
import textwrap | |||
|
|||
# Overwrite certain distutils.ccompiler functions: | |||
import numpy.distutils.ccompiler # noqa: F401 |
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 possible this import is needed to do some monkey-patching. I don't know for sure.
got it, do not remove things blindly. |
No need to make a new PR, you can edit this one. All of the |
The changes to |
@eric-wieser hey, looks like |
Nothing, that run is flaky. |
so, its going to be merged soon ? |
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.
The non-typing
bits look good to me, and it sounds like @BvB93 is happy with the typing
parts.
fine, Ill go ahead and fix unused variables. |
@eric-wieser shoot!!, pushed another commit which fixes unused variables on the same branch. |
If you have the new work saved somewhere, you can just do
followed by the force push. |
You can keep pushing to the current branch as long as you want. However, at some point you may want to combine various commits using |
@charris Thanks for the info. I now reverted the changes to older commit. Can you confirm if its ready to merge and merge it so that i can go ahead and do another PR for the |
The travis error can be ignored. |
Thanks @default-303 . |
welcome, thank you all for guiding me, I've raised a new PR for unused variables, check and tell if it needs a review. |
Removed most of the unused imports mentions in LGTM.
closes #19077