Registry / data / cmweather

cmweather

JSON →
library0.3.2pypypi✓ verified 86d ago

cmweather provides colormaps for weather and climate data visualization, with many color vision deficiency (CVD) friendly options. Current version 0.3.2, requires Python >=3.6. Release cadence is irregular, typically a few releases per year.

pip install cmweather
INSTALL
IMPORT
SIG · CMWEATHER
C
cmweather
datapythonv0.3.2
Install
7.4s avg
Import
1187ms
Disk
181MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.192s · 177.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.4s · import 1.182s · 170MB
181MB installed
● package 181MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cmweather
import cmweather
Import the module to register colormaps with matplotlib; no main class.
cmweather.cm
from cmweather import cm
from cmweather import Colormap
Colormaps are accessed via cm module, not a Colormap class.

Basic usage: import cmweather to register colormaps, then use them as 'cmweather.<name>'.

import matplotlib.pyplot as plt import numpy as np import cmweather # Generate sample data x = np.linspace(0, 10, 100) y = np.linspace(0, 10, 100) X, Y = np.meshgrid(x, y) Z = np.sin(X) * np.cos(Y) # Use a CVD-friendly colormap plt.contourf(X, Y, Z, cmap='cmweather.viridis') plt.colorbar() plt.show()
Debug
Known issues
gotchaColormap names must be prefixed with 'cmweather.' when used in matplotlib (e.g., 'cmweather.viridis'). Omitting the prefix will fall back to matplotlib's default.
fix
Use plt.cm.cmweather.viridis or specify cmap='cmweather.viridis'.
affects: all
deprecatedThe old direct access via cmweather.colormaps (e.g., cmweather.colormaps['viridis']) is deprecated and may be removed.
fix
Use from cmweather import cm; cm.viridis or cmap='cmweather.viridis'.
affects: >=0.2.0
breakingIn v0.2.0, the colormap registration mechanism changed from automatic on import to requiring an explicit import. Code that only did 'import cmweather' before may not register colormaps.
fix
Ensure 'import cmweather' is called before plotting. If issues, use 'from cmweather import cm'.
affects: 0.2.0
Errors
Common errors & fixes
KeyError: 'viridis'
Colormap not registered because cmweather was not imported, or colormap name is incorrect.
fix
Add 'import cmweather' at the top of your script. Use 'plt.get_cmap("cmweather.viridis")'.
ValueError: Colormap 'cmweather.viridis' is not of known type
Matplotlib version too old (<2.0) or cmweather not properly installed.
fix
Upgrade matplotlib: 'pip install matplotlib --upgrade'. Reinstall cmweather: 'pip install cmweather --upgrade'.
ImportError: cannot import name 'Colormap' from 'cmweather'
Trying to import a class that doesn't exist.
fix
Use 'from cmweather import cm' instead.
Upgrade
Version history
0.3.2latest on PyPI · released Jan 4, 2024
Audit
Dependencies
matplotlibrequiredAll colormaps are matplotlib-compatible
numpyoptionalUsed internally for color data manipulation
Agent activity
17 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
cmweather — pip install cmweather · libregistry