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]: Matplotlib 3.9.0 register_cmap deprecation #865

Closed
7 tasks done
SylviaWhittle opened this issue Jun 26, 2024 · 2 comments
Closed
7 tasks done

[Bug]: Matplotlib 3.9.0 register_cmap deprecation #865

SylviaWhittle opened this issue Jun 26, 2024 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@SylviaWhittle
Copy link
Collaborator

Checklist

  • Re-run analysis with topostats process --core 1.
  • Describe the bug.
  • Include the configuration file.
  • Copy of the output.
  • The exact command that failed. This is what you typed at the command line, including any options.
  • TopoStats version, this is reported by topostats --version
  • Operating System and Python Version

Describe the bug

In 3.9.0, Matplotlib deprecates register_cmap. What should we do about this? Prevent use of 3.9 onwards or force it? Supporting both will be messy.

An alternative is provided, in matplotlib.colormaps.register.

Matplotlib API changes for 3.9.0, search for register_cmap to see the listing

Copy of the output

N/A

Include the configuration file

N/A

To Reproduce

Try to import TopoStats while Matplotlib 3.9.0 is installed.

TopoStats Version

Git main branch

Python Version

3.12

Operating System

MacOS M1/M2 (post-2021)

Python Packages

Matplotlib 3.9.0

@SylviaWhittle SylviaWhittle added the bug Something isn't working label Jun 26, 2024
@ns-rse ns-rse added the duplicate This issue or pull request already exists label Jun 27, 2024
@ns-rse
Copy link
Collaborator

ns-rse commented Jun 27, 2024

I think this is a duplicate of #845 which was fixed with #846

No problems seen here...

(topostats) ❱ ipython 
~~~~~~~~~~~~ AUTORELOAD ENABALED ~~~~~~~~~~~~
Python 3.12.4 (main, Jun  7 2024, 06:33:07) [GCC 14.1.1 20240522]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.24.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import matplotlib

In [2]: matplotlib.__version__
Out[2]: '3.9.0'

In [3]: import topostats

In [4]: topostats.__version__
Out[4]: '2.2.2.dev5+gf5b40f762'

If encountered on a branch other than main it will likely have been created before #846 so there are two solutions...

git rebase main

You can update the branch by rebasing onto main.

git switch main
git pull
git switch -
git rebase main

git cherry-pick

Alternatively you can cherry-pick the fix from #846

NB - Untested

git switch <feature-branch>
git cherry-pick -n f7d828924034cb2badf34825f0fdfbe39953e5ed

A third solution is to manually make the change to the files which is in essence the same as cherry-picking.

@SylviaWhittle
Copy link
Collaborator Author

Closing as was a duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants