-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Static type checkers like MyPy or Pylance can't recognize variables created dynamically with locals().update(cmap_d). Past just type checking, Pylance can't even recognize that colormaps exist, e.g., cmocean.cm.balance produces an attribute access issue error in Pylance.
Matplotlib colormaps have the same issue, which they solve by including a stub file cm.pyi that defines the attributes and types.
If there's interest in include a cm.pyi file here, it is straightforward to generate one automatically based on the colormaps defined in cmap_d and I'd be happy to make a PR with the details.
Metadata
Metadata
Assignees
Labels
No labels