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

Does not support matplotlib v3.9 (latest stable) #48

Open
mnlevy1981 opened this issue Sep 19, 2024 · 1 comment
Open

Does not support matplotlib v3.9 (latest stable) #48

mnlevy1981 opened this issue Sep 19, 2024 · 1 comment

Comments

@mnlevy1981
Copy link

I created a new CUPiD environment, which had the effect of updating to the latest stable releases of all the python packages. When I run the CUPiD example which relies on mom6-tools, I get

AttributeError                            Traceback (most recent call last)
Cell In[2], line 8
      6 import intake
      7 from mom6_tools.MOM6grid import MOM6grid
----> 8 from mom6_tools.surface import get_MLD, get_BLD
      9 import xarray as xr
     11 warnings.filterwarnings("ignore")

File /glade/work/mlevy/codes/CUPiD/externals/mom6-tools/mom6_tools/surface.py:14
     12 from mom6_tools.DiagsCase import DiagsCase
     13 from mom6_tools.m6toolbox import add_global_attrs
---> 14 from mom6_tools.m6plot import xycompare, xyplot
     15 from mom6_tools.MOM6grid import MOM6grid
     16 from distributed import Client

File /glade/work/mlevy/codes/CUPiD/externals/mom6-tools/mom6_tools/m6plot.py:1871
   1868   return lonRange, latRange, hspace, titleOffset
   1870 # Load new named colormaps
-> 1871 c = dunne_rainbow()
   1872 c = dunne_pm()
   1873 c = brownblue_cmap()

File /glade/work/mlevy/codes/CUPiD/externals/mom6-tools/mom6_tools/m6plot.py:1648, in dunne_rainbow(N)
   1646 cmap.set_under([.95*.9,.75*.9,.9]); cmap.set_over([.3,0.,0.])
   1647 #cmap.set_bad('w')
-> 1648 matplotlib.cm.register_cmap(cmap=cmap)
   1649 return cmap

AttributeError: module 'matplotlib.cm' has no attribute 'register_cmap'

It looks like matplotlib.cm.register_cmap() was removed in v3.9, with the note "Use matplotlib.colormaps.register(name) instead." (I think that's the right link?)

@gustavo-marques
Copy link
Collaborator

Thanks, @mnlevy1981. I have a fix for this and will create a PR soon.

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

2 participants