-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Hello! I love your work, this is my favorite set of colormaps.
Today I wanted to run some code from the docs:
import cmocean
cmaps = cmocean.cm.cmap_d
cmocean.tools.print_colormaps(cmaps)
and it produces the following exception and traceback:
Traceback (most recent call last):
File "/home/mfisher/Projects/_test/extend-colormaps-js/test.py", line 4, in <module>
cmocean.tools.print_colormaps(cmaps)
File "/home/mfisher/Projects/_test/extend-colormaps-js/.pixi/envs/default/lib/python3.12/site-packages/cmocean/tools.py", line 25, in print_colormaps
rgbtemp = cmap(np.linspace(0, 1, N))[np.newaxis, :, :3][0]
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'str' object is not callable
The issue appears to be here:
Line 23 in 59c3500
for cmap in cmaps: |
We loop over the cmaps
object, which is a dictionary of colormap name keys to colormap object values in this invocation, but the function expects the object to be a list of colormap objects.
So the docs could be updated to:
import cmocean
cmaps = cmocean.cm.cmap_d
cmocean.tools.print_colormaps(cmaps.values())
But after running this code I don't see the output files!
Metadata
Metadata
Assignees
Labels
No labels