Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make mpl_toolkits a non-namespace package #5327

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

Closed
mdboom opened this issue Oct 26, 2015 · 11 comments
Closed

Make mpl_toolkits a non-namespace package #5327

mdboom opened this issue Oct 26, 2015 · 11 comments
Milestone

Comments

@mdboom
Copy link
Member

mdboom commented Oct 26, 2015

Namespace packages are the source of all kinds of user errors.

This would involve moving basemap (and any other 3rd-party packages that install into mpl_toolkits, if they exist) to the top-level and installing a shim so it could still be imported from the old location.

Cc: @jswhit @WeatherGod to coordinate.

Cc: @jenshnielsen

@WeatherGod
Copy link
Member

actually, cc me to coordinate w.r.t. basemap now. I am taking over
responsibility for it.

I agree with it in principle, I just don't know how we want to go about
doing it.

On Mon, Oct 26, 2015 at 3:53 PM, Michael Droettboom <
[email protected]> wrote:

Namespace packages are the source of all kinds of user errors.

This would involve moving basemap (and any other 3rd-party packages that
install into mpl_toolkits, if they exist) to the top-level and installing
a shim so it could still be imported from the old location.

Cc: @jswhit https://github.com/jswhit to coordinate.

Cc: @jenshnielsen https://github.com/jenshnielsen


Reply to this email directly or view it on GitHub
#5327.

@mdboom mdboom added this to the unassigned milestone Oct 26, 2015
@jenshnielsen
Copy link
Member

My idea was to look at what IPython/Jupyter was doing with there big split thing

@citibeth
Copy link

citibeth commented Oct 7, 2016

Please, PLEASE do this. I just spend most of the day figuring out a workaround for Spack, where every package is installed in a separate root. See: spack/spack#1964

You can see my pain here: spack/spack#1948

@efiring efiring modified the milestones: 2.1 (next point release), unassigned Oct 7, 2016
@efiring
Copy link
Member

efiring commented Oct 7, 2016

I added the milestone in the hope that this will raise the attention level, and maybe we can get it done. Unfortunately, I don't know exactly what it will entail.

@citibeth
Copy link

citibeth commented Oct 7, 2016

If you have to break the API, I'd go along with that. Changing scripts
that use basemap is a pain, but this is an even bigger pain.

On Fri, Oct 7, 2016 at 3:07 PM, Eric Firing [email protected]
wrote:

I added the milestone in the hope that this will raise the attention
level, and maybe we can get it done. Unfortunately, I don't know exactly
what it will entail.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5327 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB1cd3KM0ACtjCROEcW0XzkghzQ_LcREks5qxphhgaJpZM4GV8sd
.

@citibeth
Copy link

OK, I have a different suggestion... Rather than removing the use of namespace packages, why not just have Matplotlib follow the standard for them, which came into being with Python 3.3? (The only tricky thing is... it would have to follow the new standard when using Python 3.3 or later; but do what it's doing now for older Pythons).

Looking in the Python changelog, I see that starting with Python 3.3, they support namespace packages in a standardized way:
https://docs.python.org/3/whatsnew/3.3.html#pep-420-implicit-namespace-packages
https://www.python.org/dev/peps/pep-0420/#namespace-packages-today

@NelleV
Copy link
Member

NelleV commented Oct 11, 2016

If I am not mistaken, we cannot follow the new way if we still support python 2.7.

I don't think namespace packages bring anything useful on the table. scikit-learn was very happy to move out of the scikit namespace.

@jenshnielsen
Copy link
Member

That might be a reasonable temporary solution (if it can work with 2.7 some how) which is easier to implement. I sagree with @NelleV that we should get rid of the namespace package completely and
I think the best way would be something like:

  1. Change basemap to install outside mpl_toolkits as a regular package.
  2. In basemap provide a shim that installs into mpl_toolkits provided that mpl_toolkits is a namespace package (for old matplotlib versions with the namespace package)
  3. In matplotlib switch mpl_toolkits to be a regular package but ship a shim for basemap in mpl_toolkits with matplotlib.
  4. Deprecate the shim raising warnings when in use (this can also be done much earlier)
  5. Several releases of matplotlib in the future (multiple years, perhaps never) remove the shim

My main concern with this approach is what happens at upgrade time but on the other hand namespace packages as they currently are tend to result in upgrade issues anyway

We also need to handle natgrid but that is only uses internally in matplotlib so it should be simple enough to handle or perhaps just remove.

@citibeth
Copy link

You would need to make one shim for Python 3.3 and above; and another shim
for Python 2.7.

On Tue, Oct 11, 2016 at 11:54 AM, Jens Hedegaard Nielsen <
[email protected]> wrote:

That might be a reasonable temporary solution (if it can work with 2.7
some how) which is easier to implement. I sagree with @NelleV
https://github.com/NelleV that we should get rid of the namespace
package completely and
I think the best way would be something like:

  1. Change basemap to install outside mpl_toolkits as a regular package.
  2. In basemap provide a shim that installs into mpl_toolkits provided
    that mpl_toolkits is a namespace package (for old matplotlib versions with
    the namespace package)
  3. In matplotlib switch mpl_toolkits to be a regular package but ship
    a shim for basemap in mpl_toolkits with matplotlib.
  4. Deprecate the shim raising warnings when in use (this can also be
    done much earlier)
  5. Several releases of matplotlib in the future (multiple years,
    perhaps never) remove the shim

My main concern with this approach is what happens at upgrade time but on
the other hand namespace packages as they currently are tend to result in
upgrade issues anyway

We also need to handle natgrid but that is only uses internally in
matplotlib so it should be simple enough to handle or perhaps just remove.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5327 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB1cd4FYVsjTqyFu8PrDKIB-zSyMPI7Jks5qy7E-gaJpZM4GV8sd
.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Mar 17, 2023
@QuLogic
Copy link
Member

QuLogic commented Mar 17, 2023

Closing as duplicate of #25244, as that's where discussion is happening.

@QuLogic QuLogic closed this as completed Mar 17, 2023
@QuLogic QuLogic removed the status: inactive Marked by the “Stale” Github Action label Mar 17, 2023
@QuLogic QuLogic modified the milestones: future releases, v3.8.0 Jun 13, 2023
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

No branches or pull requests

8 participants