randimage icon indicating copy to clipboard operation
randimage copied to clipboard

matplotlib.cm.get_cmap is deprecated

Open nhairs opened this issue 2 years ago • 0 comments

Hi, thanks for this package - loving the aesthetic of the generated images.

When running my own tests the following warning is being thrown:

/code/.tox/py311/lib/python3.11/site-packages/randimage/coloredpath.py:13: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead.

Whilst not critical to fix it may cause problems in the future as matplotlib does not have any version restrictions so when the function is removed this library will break. Two possible fixes:

  1. Add a maximum version restriction to matplotlib so that it won't install with the version in which the function is removed.
    • e.g. matplotlib<3.9
  2. Update randimage to use the new function. I'll note that doing this probably means adding in a minimum version restriction.

nhairs avatar Dec 05 '23 06:12 nhairs