feat(styling)!: grouped render parameters + a large vendored preset-library expansion - #275
Merged
Conversation
Follow-up to the grouped render-parameter refactor (#274): drop the backward-compatible shims for the old loose keywords and complete the facet parameter grouping. - remove all deprecation shims (_resolve_point_overlay, _resolve_frame_label, _resolve_renamed_kwarg, _warn_deprecated_cbar_kwargs, _pop_first) across array_glyph, colorbar, and the six other glyphs - remove the no_elem alias; rename text_colors to cell_value_text_colors - group facet coordinate labels into PanelLabels; rename facet figsize to figure_size - add a grouped render-parameter migration guide and wire it into mkdocs - drop the deprecation tests, unwrap the still-functional cbar_*/ticks_spacing tests, and convert bare-array point tests to PointOverlay BREAKING CHANGE: removed loose keywords now raise the ordinary TypeError, and a bare array for points raises AttributeError. text_colors is renamed to cell_value_text_colors, no_elem to num_domain_cells, and facet's figsize to figure_size. Loose cbar_* / ticks_spacing keys still work but no longer emit a deprecation warning. Closes #281, #283, #285
…anelLabels pointer
…CAMS presets Rebased the widen-style-overrides work onto the grouped render-parameter refactor + legacy-kwarg-shim removal (PR #286). Squashes the branch's own 16 commits into one integration commit; all code is preserved, the loose pre-shim-removal kwargs it relied on are dropped in favour of the group objects already on main. - widen per-call DATA_STYLES overrides (extend/levels/bands/alpha/ alpha_range) via data_style=DataStyle, with resolve_style_overrides() - vendor the full scientific perceptually-uniform colour-map set and the CAMS atmospheric-composition preset set; neutral provenance naming - DataStyle alpha_range / bands validation and opacity-mode clearing - keep colour-map download scripts local-only - add example notebooks and the style-override test suite Integrated cleanly onto the shim-removed API: full suite 2210 passed.
…CAMS presets Rebased the widen-style-overrides work onto the grouped render-parameter refactor + legacy-kwarg-shim removal (PR #286). Squashes the branch's own 16 commits into one integration commit; all code is preserved, the loose pre-shim-removal kwargs it relied on are dropped in favour of the group objects already on main. - widen per-call DATA_STYLES overrides (extend/levels/bands/alpha/ alpha_range) via data_style=DataStyle, with resolve_style_overrides() - vendor the full scientific perceptually-uniform colour-map set and the CAMS atmospheric-composition preset set; neutral provenance naming - DataStyle alpha_range / bands validation and opacity-mode clearing - keep colour-map download scripts local-only - add example notebooks and the style-override test suite Integrated cleanly onto the shim-removed API: full suite 2210 passed.
MAfarrag
force-pushed
the
feat/widen-style-overrides
branch
from
August 10, 2026 19:17
112835d to
6238a41
Compare
…al source naming Extend the vendored weather preset set with the operational long tail (84 -> 112 presets): wave/marine fields, cloud base/ceiling, pressure-level temperature / wind / geopotential, vorticity / potential vorticity / divergence, humidity, hydrology (runoff, snow-water-equivalent, river discharge, soil wetness), 2 m temperature extremes, visibility, freezing rain, radiation and several indices; 16 fields now take the reference optimal look over the Magics palette. Four contour-only upstream fields (mean sea-level pressure, sea-surface temperature, 500 hPa potential vorticity) are skipped. Also drop the source-institution name from the codebase: the reference-basemap styles are renamed to 'light'/'dark' (add_reference_map default is now 'light'), provenance and prose across code, tests, docs and notebooks are neutralised, and the example notebook is renamed. No new dependency.
Remove the maintainer weather-preset build script from version control and gitignore it, matching the colour-map download scripts. It fetches the vendored colour data from upstream mirrors and is kept only on the maintainer machine; the baked weather_presets.json ships as normal and regeneration is a local-only step.
…operational preset sets Three executed-then-stripped gallery notebooks covering the newly vendored presets: the 39 perceptually-uniform scientific colour maps (grouped sequential/diverging/cyclic/multi), the 11 radar & satellite colour tables, and the operational weather long tail (waves, upper-air temperature/wind, dynamics, cloud & humidity, hydrology, indices). Each renders every preset on a synthetic field mapped through its own scale.
…y (Sonar S3776) Extract the LINEAR and BOUNDARY_NORM cases (each carried a nested branch) into _linear_norm/_boundary_norm helpers and fold the extend default into one expression, dropping build_norm's cognitive complexity from 17 to under the 15 allowed. Behaviour unchanged.
Move the DataStyle/Classify constructions and the array/rng builders out of the pytest.raises blocks in the style/scheme rejection tests, so each block has a single throwing invocation under test.
'function' is the default pytest fixture scope, so the explicit argument is redundant.
…358) Restore the plain if/else form for the extend default; the nested ternary the prior complexity fix introduced tripped S3358.
…alleries Clear the leftover output cells and the iopub execution-timing metadata from the CAMS, operational-weather, radar/satellite and scientific-colormap preset notebooks so the committed copies are deterministic.
…wide Remove output cells and iopub execution-timing metadata from every tracked docs notebook so none carry rendered outputs in version control; the docs build re-executes them.
…den-style-overrides # Conflicts: # .gitignore # docs/notebooks/presets/cams_aerosols_and_particulates.ipynb # docs/notebooks/presets/cams_greenhouse_gases.ipynb # docs/notebooks/presets/cams_reactive_gases.ipynb # docs/notebooks/presets/cams_uv_and_fire.ipynb # docs/notebooks/presets/data_style_presets_examples.ipynb # docs/notebooks/presets/operational_temperature_animation.ipynb # docs/notebooks/projection/projection_examples.ipynb # examples/notebooks/temperature_colormap_comparison.ipynb # src/cleopatra/glyphs/gridded/array_glyph.py # src/cleopatra/glyphs/gridded/mesh_glyph.py # src/cleopatra/glyphs/stats/kde_glyph.py # src/cleopatra/styling/colors.py # src/cleopatra/styling/data/__init__.py # src/cleopatra/styling/data/weather_presets.json # tests/test_array_glyph.py # tests/test_colors.py # tests/test_kde_glyph.py # tests/test_review_fixes.py # tools/build_weather_presets.py
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Finalizes the grouped-parameter render API and substantially expands the vendored preset library.
Grouped render parameters (breaking). Completes the migration of
ArrayGlyph/MeshGlyphplot/animate/facetfrom flat keyword arguments to typed group objects —data_style=DataStyle(...),color=ColorScaling(...),contour=Contour(...),cells=CellValues(...),classify=Classify(...). The legacy-keyword shims are removed; passing a moved keyword now raises with apointer to the group object it belongs on. Per-call styled-preset overrides (
bands/alpha/alpha_range)ride on
DataStyle, are sticky across calls on a reused glyph, and clear / switch opacity mode correctly.Preset library expansion —
DATA_STYLESgrows to ~200 presets across seven vendored libraries (built-in, ocean, NCL, terrain, scientific, radar, weather):wildfire, and the pressure-level slices).
scientific_presets.json) — so a caller can pick a colourmap by name (
style="batlow"), not only a variable.radar_presets.json) — reflectivity (standard / expanded /clear-air), radial velocity, spectrum width, precipitation accumulation, and infrared / water-vapour enhancement.
potential vorticity / divergence, humidity, hydrology, and instability indices.
Provenance naming. Vendored colour data is treated as derived data under neutral naming; the maintainer
download scripts are kept local-only (out of version control).
Notebooks. Seven example gallery notebooks (four CAMS + scientific / radar-satellite / operational-weather
galleries), executed end-to-end and committed output-free (the docs build re-executes them).
No new runtime dependency. An optional
cleopatra[science-colors]extra enables namespaced colour maps(
cmocean:thermal, ...) via the numpy-onlycmapaggregator.Integration with
main.mainindependently re-implemented much of this surface (the grouped-parameter refactor and the scientific / radar / terrain preset files) via #287 / #246, but without the neutral-source scrub. This branch mergesorigin/mainin and reconciles the two: it keepsmain's more complete grouped-parameter rollback (whole-merge, not style-only) and meshcontoursupport, keeps this branch's superset weather library (+28 presets) and the scrubbed, neutral-source naming, and re-strips every notebook the merge re-inflated. Post-merge the full suite is green (2232 passed) and SonarCloud is clean (quality gate OK, 0 open issues).Issues
How Has This Been Tested?
uv run --active pytest) — 2232 passed./review-rounds— two independent adversarial review rounds + a SonarCloud sweep; every finding resolved(override clear/mode-switch bugs, a
bands-on-diverging-preset warning,alpha_rangevalidation, and S5778test smells).
the loaded libraries); the seven example notebooks execute end-to-end with zero errors.
Checklist: