zktuong/dandelion

Incompatibility with latest matplotlib

Closed this issue · 2 comments

grst commented

Description of the bug

This happens in a fresh conda environment with python 3.9 and right after pip install sc-dandelion.
I've seen the error before and it seems to be related to changes in matplotlib.

(test_dandelion) sturm@hochvogel scirpy [fix-cpu-count] % python -c "import dandelion"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/__init__.py", line 5, in <module>
    from dandelion import plotting as pl
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/plotting/__init__.py", line 2, in <module>
    from dandelion.plotting._plotting import (
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/plotting/_plotting.py", line 31, in <module>
    import dandelion.external.nxviz as nxv
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/external/nxviz/__init__.py", line 3, in <module>
    from .api import (
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/external/nxviz/api.py", line 10, in <module>
    from dandelion.external.nxviz import edges, nodes
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/external/nxviz/edges.py", line 17, in <module>
    from dandelion.external.nxviz import encodings, lines
  File "/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/dandelion/external/nxviz/encodings.py", line 10, in <module>
    from matplotlib.cm import get_cmap
ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' (/home/sturm/apps/micromamba/envs/test_dandelion/lib/python3.9/site-packages/matplotlib/cm.py)

Minimal reproducible example

No response

The error message produced by the code above

No response

OS information

No response

Version information

No response

Additional context

No response

thanks @grst !

Indeed : https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals

will try and do a quick fix to see which of those work.

grst commented

Thanks for fixing this so quickly :)

Allow me one comment regarding version numbers (assuming you follow semver):