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
Clean up imports #2387
Comments
+1 on import cleanups. -1 on changing conventions away from mtransforms. A convention is a convention, and I don't see how mpl_transforms is any better than mtransforms. |
Also, we do need to be careful with removing "unneeded" imports. For example, there is probably some confusion over which module to import Colormaps from (you can import it from both colors.py and cm.py, and guess which module the class is defined?!) |
Good point about unneeded imports. I was thinking more along the lines of things from stdlib etc. Things from within matplotlib should be taken with much more care -- and maybe things like that we come across should be commented so we know they are being kept around for API reasons. |
+1 It is my own dumb fault for turning flake8 up to 11, but this sounds great and will reduce the number of not-actually-errors I sift through. |
I think a good first step is to cleanup the 'unneeded' inputs. By this I don't mean simply remove them, instead I suggest reworking the design of the relevant module. |
@dmcdougall Would you elaborate, please? I have no idea what you mean. |
For example, in If I recall correctly, it is the case that this same line set off some alarms with |
I'm open here. I don't really mind which one is used within the codebase; the
I agree. Furthermore, the handle |
On 2013/09/08 10:20 AM, Damon McDougall wrote:
Agreed! That is one UGLY line! |
@mdboom, I think that as part of the PEP-8-ification, much of this has been done--maybe most of the noncontroversial parts. Can this issue be closed? |
Yep. Not all of the suggestions have been done, and there is always room for improvement, but I don't think the existence of this issue will make any difference to any future work. |
matplotlib's import sections at the top of files are really messy.
We should go through and:
collections
andmatplotlib.collections
, for example)4) Favor importing modules rather than members of modules -- that leads to a large global namespace in the module with larger potential for namespace clashes.
Additionally, I've never been much of a fan of
though I understand the need when the module name is too generic. I'd prefer to reduce this usage by renaming where appropriate.
Perhaps instead we do:
Before I embark on this, I thought I'd get some feedback. @pelson, @dmcdougall, @NelleV, @WeatherGod, @efiring
The text was updated successfully, but these errors were encountered: