feat(renderer): cartographic upgrades — peaks, inland lakes, scope marker, refined colorbar#126
Merged
Merged
Conversation
…rker, refined colorbar User-visible improvements to the default radar PNG, plus a container fix bundled in. Visual: - Scope-style radar marker (open ring + center dot) at the antenna location with haloed station label - Per-station peak markers — KATX gets Mt Baker, Glacier Peak, Mt Rainier, Mt Olympus drawn as brown triangles via the _PEAKS_BY_STATION registry in basemap.py (other stations render no peaks until they're added) - ne_10m_lakes_north_america layer wired in so Lake Washington, Lake Tahoe, etc. render as water; the global lakes layer drops them at every resolution because they're not Great-Lakes-class - North arrow flipped to point up (was inverted) - Colorbar: thicker bar (4.5% height), integer ticks every 20 dBZ, "dBZ" label inline to the right of the bar, thin black outline, positioned just above the bottom border - Footer text bumped 8pt → 12pt - 15 px white margin frames the radar plot cleanly instead of bleeding to the figure edges - City labels force-clipped to the axes patch so east-edge labels don't leak past the right boundary Defaults: - Default plot height bumped 1000 → 1100 so southern coverage features (e.g. Mt Rainier at the edge of KATX's view) get breathing room above the bottom border - DEFAULT_RANGE_KM, DEFAULT_WIDTH, DEFAULT_HEIGHT consolidated as module-level constants in render.py and consumed by service.RenderRequest and the FastAPI Query defaults — the three layers can no longer drift (prior drift had the API silently using range_km=230 while the dataclass said 150) - Y-axis projected limit scales with the axes pixel aspect ratio so a taller figure actually shows more N-S area, not just whitespace - Projected xlim/ylim locked explicitly so Cartopy's default adjustable="box" doesn't introduce uneven internal padding (sides were 14 px while top/bottom were 26 px) Container fix: - The prewarmed Cartopy cache in scripts/cartopy_cache.py was missing admin_2_counties_lakes, roads, LAND (10m), and the newly added lakes_north_america. Without them the unprivileged container uid hit PermissionError trying to download missing layers at request time. The script's docstring already required this list to be kept in sync with render.py; it had drifted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
matplotlib stubs type Colorbar.outline as Spine | None and flag method calls as "Spine not callable [operator]". At runtime it's always a Spine on a freshly-constructed colorbar; suppress with a narrow type: ignore[operator] rather than restructuring runtime code. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 2.13.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
Iterative session focused on visual quality and geographic anchoring of the rendered radar PNG. The default render is now noticeably more professional and spatially intuitive. Bundles a container-runtime bug fix that was masking missing Cartopy cache layers.
Visual upgrades
_PEAKS_BY_STATIONregistry inbasemap.py. Stations without an entry render no markers (opt-in, no warning).ne_10m_lakes_north_america) wired in so Lake Washington, Lake Tahoe, Lake Pontchartrain, etc. render as water. The globalne_10m_lakesshapefile drops every lake smaller than a Great Lake at every resolution.Default render shape
xlim/ylimlocked explicitly so Cartopy's defaultadjustable="box"doesn't introduce uneven internal padding (previously sides=14 px while top/bottom=26 px).Refactor: single source of truth for defaults
DEFAULT_RANGE_KM,DEFAULT_WIDTH,DEFAULT_HEIGHTconsolidated as module-level constants inrender.pyand consumed byservice.RenderRequestand the FastAPIQuerydefaults. The three layers can no longer drift.range_km=230while the dataclass advertised 150 — found and fixed mid-session.test_render_options_defaults_match_route_defaultsupdated to assert against the constants directly.Container fix bundled
The prewarmed Cartopy cache in
scripts/cartopy_cache.pywas missingadmin_2_counties_lakes,roads,LAND(10m), and (now)lakes_north_america. Without them the unprivileged container uid hitPermissionErrortrying to download missing layers at request time. The script's docstring already required this list be kept in sync withrender.py— it had drifted. Build now reports all layers warmed.Test plan
uv run pytest tests/— 67 passeddocker build -t dras-renderer:local .PermissionError(was 500ing before the cartopy_cache fix)/render/KATXoutput — peaks visible, Lake Washington rendering as water, equal margins, colorbar legibleselfhostedns and confirm in-cluster render matches local🤖 Generated with Claude Code