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

Use mpl.colormaps.get_cmap for compatibility with matplotlib 3.9 #422

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Feb 13, 2024

Fix #421 , maybe.

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (307a11d) 86.63% compared to head (0175678) 86.61%.
Report is 3 commits behind head on main.

Files Patch % Lines
glue_jupyter/state_traitlets_helpers.py 60.00% 2 Missing ⚠️
glue_jupyter/utils.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #422      +/-   ##
==========================================
- Coverage   86.63%   86.61%   -0.03%     
==========================================
  Files          89       89              
  Lines        5163     5169       +6     
==========================================
+ Hits         4473     4477       +4     
- Misses        690      692       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

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

There are no tests for that functionality which may be the reason we missed the deprecation phase, but I've tested the options for matplotlib 3.3.4-3.9.0dev.
There is one other use in utils.py that should also be updated along with this; I think scalar_to_png_data should support Colormap and thus use get_cmap even more than here. Thanks!

glue_jupyter/state_traitlets_helpers.py Outdated Show resolved Hide resolved
glue_jupyter/state_traitlets_helpers.py Outdated Show resolved Hide resolved
@dhomeier dhomeier added bug Something isn't working matplotlib-viewers labels Feb 14, 2024
@pllim
Copy link
Contributor Author

pllim commented Feb 14, 2024

Thanks for the review, @dhomeier ! I think I have applied all your comments. Does it look good now?

@dhomeier dhomeier changed the title MNT: Compatibility with matplotlib 3.9 Use mpl.colormaps.get_cmap for compatibility with matplotlib 3.9 Feb 14, 2024
@dhomeier dhomeier changed the title Use mpl.colormaps.get_cmap for compatibility with matplotlib 3.9 Use mpl.colormaps.get_cmap for compatibility with matplotlib 3.9 Feb 14, 2024
@dhomeier dhomeier merged commit 8886a79 into glue-viz:main Feb 14, 2024
24 of 26 checks passed
@dhomeier
Copy link
Contributor

Looks all good, and thanks for the isort cleanup, too!

@pllim pllim deleted the patch-1 branch February 14, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working matplotlib-viewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImportError: cannot import name 'get_cmap' from 'matplotlib.cm'
2 participants