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

Issue with get_cmap() deprecation #582

Closed
a2ray opened this issue May 20, 2024 · 4 comments · Fixed by #583
Closed

Issue with get_cmap() deprecation #582

a2ray opened this issue May 20, 2024 · 4 comments · Fixed by #583

Comments

@a2ray
Copy link

a2ray commented May 20, 2024

Hi, it seems that all my package tests and builds on GitHub fail (including JuliaRegistrator) with

ERROR: InitError: KeyError: key "get_cmap" not found
Stacktrace:
  [1] __getproperty
    @ /tmp/jl_j47t6l/packages/PyCall/1gn3u/src/PyCall.jl:313 [inlined]
  [2] getproperty
    @ /tmp/jl_j47t6l/packages/PyCall/1gn3u/src/PyCall.jl:317 [inlined]
  [3] init_colormaps()
    @ PyPlot /tmp/jl_j47t6l/packages/PyPlot/2MlrT/src/colormaps.jl:57
  [4] __init__()
    @ PyPlot /tmp/jl_j47t6l/packages/PyPlot/2MlrT/src/init.jl:208

and this can be traced to PyPlot here:

copy!(cm_get_cmap, cm."get_cmap")

Can we get around this or do I have to specify a version of matplotlib through Conda in my package that does not deprecate get_cmap() ?

@stevengj
Copy link
Member

What was get_cmap replaced by upstream?

@henry2004y
Copy link
Contributor

henry2004y commented May 21, 2024

I have the same issue. The removal is described in the matplotlib 3.9 API changes: https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals

@a2ray
Copy link
Author

a2ray commented May 21, 2024

Yup, as @henry2004y points out above. But while we're on the topic -- would it be useful to specify matplotlib dependencies for PyPlot like we do for other Julia packages through Project.toml? How I'm doing it now is through a build.jl to ensure that pip and conda play nice (there were issues last year with Conda repositories timing out on GitHub, hence the pip AND condausage), to install a specific matplotlib version. I then build PyCall before using PyPlot is invoked in my package. I'm wondering if this is the recommended way?

@henry2004y
Copy link
Contributor

According to the Matplotlib 3.9 removal notice, is it possible to simply replace

copy!(cm_get_cmap, cm."get_cmap")

with

copy!(cm_get_cmap, cm.ColormapRegistry."get_cmap")

?

johnomotani added a commit to mabarnes/moment_kinetics that referenced this issue Jun 9, 2024
This prevents a current issue (see
JuliaPy/PyPlot.jl#582) with `get_cmap()`
deprecation in matplotlib-3.9.0 from causing the documentation build to
fail.
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

Successfully merging a pull request may close this issue.

3 participants