-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MAINT moved _backports to cbook module #7830
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
@@ -14,7 +14,7 @@ | |||
|
|||
from matplotlib import ( | |||
artist, cbook, colors as mcolors, lines, text as mtext, path as mpath) | |||
from matplotlib._backports import numpy as _backports_np | |||
from matplotlib.cbook._backports as _backports_np |
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 this be:
from matplotlib.cbook._backports import numpy as _backports_np
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 definitely messed something up here :)
I would suggest keeping one backport module per external module. So either I know right now it's only numpy (and I don't particularly hope that there would be more stuff) but Otherwise, +1 to the idea. |
I'd hope that we only have numpy backport, but we do also have backports of the subprocess modules in the compat module. The problem is that we need a deprecation cycle to move it to the same place (it would have be nice to have that module private, but it ain't). Note : @tacaswell it seems that the subprocess module has been renamed in 2.x without deprecation warning. Is that normal? If it is normal, shouldn't we move it to the cbook module to have everything in one place? |
(other solution for 2.x, make it private, this way we can do whatever we want with it. But it's really short notice for the release…) |
Please don't over engineer this 😄 I am +0.5 on this. Positive on the extra organization, but concerned of the added indirection going from a single file -> folder and the slight lose in ability to do git forensics (which maybe important for cbook as @anntzer sorts through what of that we are actually using and what of that we can deprecate). @NelleV renaming the module was probably a mistake, where did that get done? It looks like it was renamed in f41000d which was pre 1.3, but I might be missing something. |
mmh, maybe I am wrong. I am looking at git blame, and thus a filename change would not be visible in the blame. |
I fixed @anntzer's comment. |
We really need to fix our PEP8 compliance tests system… It's raising errors on code I have not modified. |
You've renamed |
That's exactly my point. We should not have to do this. |
Unfortunately, there's no such thing as a rename in native git, so I'm not sure looking at a diff will work either. I might not be trying it out right, but I wasn't able to get |
Current coverage is 62.20% (diff: 84.61%)@@ master #7830 diff @@
==========================================
Files 174 175 +1
Lines 56078 56247 +169
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34862 34987 +125
- Misses 21216 21260 +44
Partials 0 0
|
Thanks! |
This moves the _backports module to the cbook one.
The cbook.py is now replaced by a folder type module. API is not changed, but it thus means we can start splitting the cbook module into submodules of different categories (deprecation, backports & compatibility, validations etc).
This is just some reorganization of modules to facilitate organization.