You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Static type checkers can't recognize colormaps #120
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.
Activity