Skip to content

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

Merged
merged 3 commits into from
Jan 22, 2017
Merged

MAINT moved _backports to cbook module #7830

merged 3 commits into from
Jan 22, 2017

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Jan 14, 2017

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.

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

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

Copy link
Member Author

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 :)

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jan 14, 2017
@anntzer
Copy link
Contributor

anntzer commented Jan 15, 2017

I would suggest keeping one backport module per external module. So either cbook._backports_numpy, or if want to overengineer it, cbook._backports.numpy (anyways it's private :-))

I know right now it's only numpy (and I don't particularly hope that there would be more stuff) but from .cbook import _backports as _backports_np just seems wrong if _backports is supposedly generic.

Otherwise, +1 to the idea.

@NelleV
Copy link
Member Author

NelleV commented Jan 15, 2017

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?

@NelleV
Copy link
Member Author

NelleV commented Jan 15, 2017

(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…)

@tacaswell
Copy link
Member

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.

@NelleV
Copy link
Member Author

NelleV commented Jan 15, 2017

mmh, maybe I am wrong. I am looking at git blame, and thus a filename change would not be visible in the blame.

@NelleV
Copy link
Member Author

NelleV commented Jan 19, 2017

I fixed @anntzer's comment.

@NelleV
Copy link
Member Author

NelleV commented Jan 20, 2017

We really need to fix our PEP8 compliance tests system… It's raising errors on code I have not modified.

@QuLogic
Copy link
Member

QuLogic commented Jan 20, 2017

You've renamed lib/matplotlib/cbook.pylib/matplotlib/cbook/__init__.py but forgot to add the new name to the exception list. But fixing the PEP8 errors is better, anyway.

@NelleV
Copy link
Member Author

NelleV commented Jan 20, 2017

That's exactly my point. We should not have to do this.

@QuLogic
Copy link
Member

QuLogic commented Jan 20, 2017

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 flake8-diff to work properly on the changes in this PR.

@NelleV NelleV changed the title MAINT moved _backports to cbook module [MRG] MAINT moved _backports to cbook module Jan 20, 2017
@codecov-io
Copy link

Current coverage is 62.20% (diff: 84.61%)

Merging #7830 into master will increase coverage by 0.03%

@@             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          

Powered by Codecov. Last update 4c5fca7...aca81ac

@QuLogic QuLogic changed the title [MRG] MAINT moved _backports to cbook module [MRG+1] MAINT moved _backports to cbook module Jan 20, 2017
@anntzer anntzer merged commit f41ef96 into matplotlib:master Jan 22, 2017
@anntzer
Copy link
Contributor

anntzer commented Jan 22, 2017

Thanks!

@QuLogic QuLogic changed the title [MRG+1] MAINT moved _backports to cbook module MAINT moved _backports to cbook module Jan 22, 2017
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.

6 participants