-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Api deprecate cmap functions #23668
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
Api deprecate cmap functions #23668
Conversation
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 will say, this looks like it will be noisy, but I think that it all makes everything much more explicit and readable IMO. So, overall I think it is a good direction.
07d80fd
to
396c88c
Compare
418ee64
to
8f0c814
Compare
OK, really done force-pushing now... |
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.
👍 Good choice with the name of the private function, I think that is better.
@@ -2250,7 +2250,7 @@ def test_contour_hatching(): | |||
x, y, z = contour_dat() | |||
fig, ax = plt.subplots() | |||
ax.contourf(x, y, z, 7, hatches=['/', '\\', '//', '-'], | |||
cmap=plt.get_cmap('gray'), | |||
cmap=mpl.colormaps['gray'], |
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.
Can we just use strings if we aren't using resample
or using the Colormap
for anything?
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.
It can, but I was just mechanically changing (a lot of this was done with search-and-relpace)
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've decided to leave this. It makes the test a bit more complicated, but I do not know if we are definitely exercising the ability to pass Colormap
objects through this top level API else where.
I'll try to get these changes in first thing tomorow morning, will not be offended if you want to push change @QuLogic . |
8f0c814
to
9321499
Compare
@timhoffm I think this is ready to review again. |
9321499
to
ae90168
Compare
e830ea7
to
093ee4a
Compare
- matplotlib.cm.get_cmap - matplotlib.cm.register_cmap - matplotlib.cm.unregister_cmap - matplotlib.pyplot.register_cmap in preference for working with the ColormapRegistry on the top level module. Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Add it to the rendered docs.
f51e784
to
a987e31
Compare
@timhoffm I think I got everything |
Anybody can merge when green. |
* Change deprecated MPL colormap registration - matplotlib/matplotlib#23668. * Adapt benchmark for importing palette to cope with MPL 3.6. * What's New entry. * What's New typo. * Reformat import_iris imports.
matplotlib.cm.get_cmap → matplotlib.colormaps This is new in matplotlib 3.9: matplotlib/matplotlib#23668
matplotlib.cm.get_cmap → matplotlib.colormaps matplotlib/matplotlib#23668
matplotlib.cm.get_cmap → matplotlib.colormaps matplotlib/matplotlib#23668 Fixes #865.
matplotlib.cm.get_cmap → matplotlib.colormaps matplotlib/matplotlib#23668 Fixes #865.
PR Summary
This is my attempt to turn the crank on the depractions on the cm functions.
The changes were more extensive than I anticipated
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).