[Global-PGM S2] Horizon-step rendering: +1/+6/+12/+24/+36 PNGs + hover heatmap at +1; explicit months (#232) - #252
Merged
Conversation
Characterizes the silent times[-1] pick: _plot_image_map currently renders only the LAST (furthest, most uncertain) month of a multi-month dataframe with no signal. The fix moves month choice to the Compose boundary and makes multi-month input here a loud error. This test fails at this commit by design (RED); the next commit turns it green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…232) PGM forecast maps now render HORIZON STEPS (+1/+6/+12/+24/+36, clamped to the horizon): one scale-flat PNG per step plus a hover-capable raster heatmap at step +1 — month choice is explicit at the Compose boundary and the image renderer REFUSES multi-month input (the RED test's silent times[-1] pick is gone). CM keeps the whole-horizon choropleth unchanged. New shared views_reporting/_time.py: month_id_to_label (epoch Jan 1980), used by figure titles/alt-text ("Jul 2026 — month_id 559", never the float-cast "594.0") and step headings. The old size-escalation ladder in the template is replaced by the uniform step strategy: at global scale the full-horizon animation is physics-bound (~7.2M lattice cell-frames ≈ 245 MB) while one PNG is ~300 KB and one global month fits the heatmap budget by construction. Render-side guards (max_cells, max_raster_cell_frames) stay injected and armed. Measured on the real rusty_bucket global ensemble (3 targets × 36 months, S=128): report = 36.6 MB, 84 s — 15 step PNGs + 3 hover heatmaps, all months/dates verified; the metadata warning shows exactly the 322 declared unmatched forecast-region cells, matching the stamp to the digit. 384 tests green (Compose-boundary suite rewritten for the step pattern; month-label unit tests added). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ied a pick that no longer exists (#232, review-diff A) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #232. Part of epic #230 (tracker #237).
What
PGM forecast maps now render horizon steps — +1/+6/+12/+24/+36 months ahead (clamped to the horizon) as scale-flat PNGs, plus a hover-capable raster heatmap at step +1 — replacing the single silently-chosen
times[-1]image. Month choice is explicit at the Compose boundary; the image renderer now refuses multi-month input (RED→GREEN in the commit history). CM is unchanged.Why this shape
At global scale the full-horizon interactive animation is physics-bound (~7.2M lattice cell-frames ≈ 245 MB offline HTML), while one PNG is ~300 KB and a single global month (~202k cell-frames) fits the C-209 heatmap budget by construction. Decision recorded on #230 (Simon, 2026-07-20).
Measured (real rusty_bucket global ensemble: 3 targets × 36 months, S=128)
Changes
views_reporting/_time.py(new):month_id_to_label(epoch Jan 1980), shared by mapping titles and template headings.templates/reports/forecast.py: step strategy replaces the size-escalation ladder for PGM; render-side budget guards stay injected;HORIZON_STEPSconstant.mapping/mapping.py:_plot_image_maprenders exactly one month or raises (ADR-008); titles/alt-text carry the human date + integer month id.Ritual
review-diff: 1 naming finding (misleading
latest) — fixed. ship-it: ruff clean, 384 passed (2 skipped, 1 xfailed).🤖 Generated with Claude Code