open2c / cooltools

The tools for your .cool's
MIT License
138 stars 51 forks source link

`Matplotlib` 3.9 broken dependency #520

Closed nvaulin closed 2 months ago

nvaulin commented 5 months ago

Hi, I found that in new version of matplotlib (3.9) there are some functions being removed.

For instance, for

import cooltools.lib.plotting

I've got:

----> 5 from matplotlib.cm import register_cmap
      6 import matplotlib as mpl
      7 import matplotlib.pyplot as plt

ImportError: cannot import name 'register_cmap' from 'matplotlib.cm' (/home/nvaulin/tools/mambaforge/envs/hic-env/lib/python3.10/site-packages/matplotlib/cm.py)

This function was present in 3.8, but not in 3.9 (https://matplotlib.org/3.8.4/api/cm_api.html#matplotlib.cm.register_cmap )

So maybe you could add specific version of matplotlib to the requirements.txt, or adjust the code

Phlya commented 5 months ago

https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals New function to use: https://matplotlib.org/stable/api/cm_api.html#matplotlib.cm.ColormapRegistry.register

nvaulin commented 5 months ago

https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals New function to use: https://matplotlib.org/stable/api/cm_api.html#matplotlib.cm.ColormapRegistry.register

Yes, I mean, this removed func you mentioned is used In 'cooltools.lib.plotting' module.

golobor commented 2 months ago

must be finally solved by #533. Feel free to reopen if the issue appears again!