Context
cleopatra 0.29 (serapeum-org/cleopatra#244, closing #239) lifted the typed ColorBar spec to the shared
Glyph base, so MeshGlyph.plot / .animate (and FlowGlyph / KDEGlyph / ScatterGlyph / PolygonGlyph /
VectorGlyph) now accept colorbar=bool | ColorBar | None and emit the loose-cbar_* DeprecationWarning
uniformly. pyramids pins the [viz] floor at cleopatra >= 0.28, where MeshGlyph.plot's colorbar is still a
plain bool with no ColorBar support.
This is the mesh half of the typed plot-spec migration. The raster half is done — #926 (adopt 0.28 + the
typed specs) and the refactor/plot-deprecate-loose-cbar-kwargs branch (surface the cbar_* deprecation on
every raster plot path). The UGRID example notebooks are the only remaining first-class cbar_label users
because the mesh backend could not take a ColorBar — which cleopatra 0.29 now fixes.
Related: #926, and cleopatra #239 / #244.
Problem / Current Behaviour
UgridDataset.plot / mesh_render cannot forward colorbar=ColorBar(...) — on the 0.28 floor MeshGlyph.plot
has colorbar: bool, so the typed spec would be rejected.
- The UGRID example notebooks (
docs/examples/netcdf/ugrid/*.ipynb) still configure the colour bar with the
loose cbar_label because there was no typed alternative on the mesh path.
- Loose
cbar_* on the mesh path never warned (cleopatra 0.28 added the deprecation only to ArrayGlyph); 0.29
adds it to MeshGlyph, so once adopted the mesh path warns like the raster path.
Affected locations
| File |
Symbol |
Notes |
pyproject.toml |
[project.optional-dependencies] viz |
bump floor to cleopatra[tiles]>=0.29.0 |
src/pyramids/dataset/_plot_helpers.py |
mesh_render |
forward colorbar= (bool | ColorBar) to MeshGlyph.plot |
src/pyramids/netcdf/ugrid/plot.py |
plot_mesh_data |
accept + pass colorbar= |
src/pyramids/netcdf/ugrid/dataset.py |
UgridDataset.plot |
expose/document colorbar= |
docs/examples/netcdf/ugrid/*.ipynb |
— |
migrate cbar_label → colorbar=ColorBar(label=...) |
Proposed Solution
- Bump the
viz extra to cleopatra[tiles]>=0.29.0 (regenerate pixi.lock).
- Forward
colorbar= (bool | ColorBar) through mesh_render → plot_mesh_data → MeshGlyph.plot, mirroring
the raster facade, and document it on UgridDataset.plot (re-using pyramids.plot.ColorBar).
- Migrate the UGRID example notebooks from
cbar_label onto colorbar=ColorBar(label=...).
Out of Scope
The raster cbar_* deprecation surfacing (done on refactor/plot-deprecate-loose-cbar-kwargs).
Effort Estimate
Size: M — Rationale: a dep bump + mesh-facade forwarding + notebook migration; no new algorithm.
Definition of Done
Context
cleopatra 0.29 (
serapeum-org/cleopatra#244, closing#239) lifted the typedColorBarspec to the sharedGlyphbase, soMeshGlyph.plot/.animate(andFlowGlyph/KDEGlyph/ScatterGlyph/PolygonGlyph/VectorGlyph) now acceptcolorbar=bool | ColorBar | Noneand emit the loose-cbar_*DeprecationWarninguniformly. pyramids pins the
[viz]floor at cleopatra>= 0.28, whereMeshGlyph.plot'scolorbaris still aplain
boolwith noColorBarsupport.This is the mesh half of the typed plot-spec migration. The raster half is done — #926 (adopt 0.28 + the
typed specs) and the
refactor/plot-deprecate-loose-cbar-kwargsbranch (surface thecbar_*deprecation onevery raster plot path). The UGRID example notebooks are the only remaining first-class
cbar_labelusersbecause the mesh backend could not take a
ColorBar— which cleopatra 0.29 now fixes.Related: #926, and cleopatra
#239/#244.Problem / Current Behaviour
UgridDataset.plot/mesh_rendercannot forwardcolorbar=ColorBar(...)— on the 0.28 floorMeshGlyph.plothas
colorbar: bool, so the typed spec would be rejected.docs/examples/netcdf/ugrid/*.ipynb) still configure the colour bar with theloose
cbar_labelbecause there was no typed alternative on the mesh path.cbar_*on the mesh path never warned (cleopatra 0.28 added the deprecation only toArrayGlyph); 0.29adds it to
MeshGlyph, so once adopted the mesh path warns like the raster path.Affected locations
pyproject.toml[project.optional-dependencies] vizcleopatra[tiles]>=0.29.0src/pyramids/dataset/_plot_helpers.pymesh_rendercolorbar=(bool | ColorBar) toMeshGlyph.plotsrc/pyramids/netcdf/ugrid/plot.pyplot_mesh_datacolorbar=src/pyramids/netcdf/ugrid/dataset.pyUgridDataset.plotcolorbar=docs/examples/netcdf/ugrid/*.ipynbcbar_label→colorbar=ColorBar(label=...)Proposed Solution
vizextra tocleopatra[tiles]>=0.29.0(regeneratepixi.lock).colorbar=(bool | ColorBar) throughmesh_render→plot_mesh_data→MeshGlyph.plot, mirroringthe raster facade, and document it on
UgridDataset.plot(re-usingpyramids.plot.ColorBar).cbar_labelontocolorbar=ColorBar(label=...).Out of Scope
The raster
cbar_*deprecation surfacing (done onrefactor/plot-deprecate-loose-cbar-kwargs).Effort Estimate
Size:
M— Rationale: a dep bump + mesh-facade forwarding + notebook migration; no new algorithm.Definition of Done
vizfloor iscleopatra[tiles]>=0.29.0;pixi.lockregeneratedUgridDataset.plot(colorbar=ColorBar(...))renders on the mesh pathcolorbar=ColorBar(...)(no loosecbar_label)colorbar=forwarding; existing tests pass