FIX: Remove some numpy function overrides from pylab#25384
FIX: Remove some numpy function overrides from pylab#25384timhoffm merged 1 commit intomatplotlib:mainfrom
Conversation
Numpy added round, max, min to their exported names which we don't want when we import * from Numpy.
…384-on-v3.7.x Backport PR #25384 on branch v3.7.x (FIX: Remove some numpy function overrides from pylab)
|
FYI, Numpy 1.25 is now out with the changes, and this fix hasn't yet made it into a matplotlib release. Currently, importing * from pylab currently shadows the builtin max and min functions with the latest release of both libraries. |
|
Thank you @chrisjbillington. We are hoping to release Matplotlib v3.8 in July, so I suggest pinning numpy back to 1.24 until then. Note that use of pylab is strongly discouraged, and I think this problem is a good illustration of why. So if you have code that is breaking because of this, it would be better to update to not use pylab. I appreciate it can be difficult to find time to update old legacy code though. |
|
Thanks for the timeframe. Yes, understood, we're only using pylab because it seemed like a good idea about 13 years ago, and haven't yet made the backward incompatible (since users may access pylab names via our library) change of removing it, but it's on the wish list! |
|
@chrisjbillington you may have already seen, but v3.7.2 was just released with this fix. |
|
@rcomer I hadn't, thanks for letting me know! |
PR Summary
Numpy added round, max, min to their exported names which we don't want when we import * from Numpy.
xref: numpy/numpy#23302
closes #25379
PR Checklist
Documentation and Tests
pytestpasses)Release Notes
.. versionadded::directive in the docstring and documented indoc/users/next_whats_new/.. versionchanged::directive in the docstring and documented indoc/api/next_api_changes/next_whats_new/README.rstornext_api_changes/README.rst