Skip to content
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

BUG: avoid using deprecated matplotlib.cm API #4089

Merged

Conversation

neutrinoceros
Copy link
Member

@neutrinoceros neutrinoceros commented Aug 20, 2022

PR Summary

Fix #4088

running the bleeding edge CI workflow on my fork at https://github.com/neutrinoceros/yt/actions/runs/2894300482

@neutrinoceros neutrinoceros added bug release critical Highest priority (in a milestone) labels Aug 20, 2022
@neutrinoceros neutrinoceros added this to the 4.1.0 milestone Aug 20, 2022
@neutrinoceros
Copy link
Member Author

I think this and #4076 call for a new bugfix release to make downstream applications more easily testable

@@ -8,7 +8,7 @@
# Create projections using each colormap available.
p = yt.ProjectionPlot(ds, "z", "density", weight_field="density", width=0.4)

for cmap in cm.datad:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matplotlib.cm.datad isn't deprecated but it's also not clearly intended to be exposed, as it just happens to be there as a side effect of a re-export, see https://github.com/matplotlib/matplotlib/blob/9b1fcf67c4228c4a2788af5bcaf0c6fde09a55bf/lib/matplotlib/cm.py#L26

so I've replaced it with current API, which would break for old versions of Matplotlib, but I think it's okay to do that in a docs script ?

@neutrinoceros
Copy link
Member Author

@yt-fido test this please

@neutrinoceros neutrinoceros merged commit 8beb2d2 into yt-project:main Aug 22, 2022
@neutrinoceros neutrinoceros deleted the hotfix_depr_colormap_api branch August 22, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release critical Highest priority (in a milestone)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pending deprecation warnings from MPL 3.6
2 participants