Skip to content

Fix fire hull climate scalar mapping to respect hull time layers#209

Merged
ttuff merged 1 commit intomainfrom
codex/fix-custom-fire-hull-viewer
Mar 28, 2026
Merged

Fix fire hull climate scalar mapping to respect hull time layers#209
ttuff merged 1 commit intomainfrom
codex/fix-custom-fire-hull-viewer

Conversation

@ttuff
Copy link
Copy Markdown
Contributor

@ttuff ttuff commented Mar 28, 2026

Motivation

  • The vase/hull renderer was producing an almost-uniform purple mesh because climate scalars were misaligned with hull time layers when the per-day series included buffer days or different indexing. This change targets the scalar→mesh alignment only to restore meaningful, time-structured coloring.

Description

  • Replaced the earlier prefix/truncate approach with explicit layer-aware mapping by deriving layer days from hull.t_days_vert, computing n_layers, and ensuring n_vertices % n_layers == 0 before expanding scalars to vertices.
  • Map hull layer offsets to calendar dates with hull.event.t0 + pd.to_timedelta(...) and reindex the summary.per_day_mean onto those layer dates, using ffill().bfill() when necessary, then expand day_vals with np.repeat(..., verts_per_layer) to produce per-vertex intensities.
  • Added strict validation checks that raise on obvious mismatches and kept an informative ValueError if expanded scalar length does not match vertex count.
  • Added a diagnostic scalar_debug_mode="slice" (colors by slice index) alongside the existing scalar_debug_mode="z", and enriched the fire_hull_scalar_debug printout to include scalar_dtype, unique_count, n_layers, and verts_per_layer for better pre-render inspection.
  • Added focused unit tests to cover buffered-date alignment and the new slice diagnostic while preserving existing layer-order and z diagnostics (tests/test_fire_hull_viewer_scalars.py).

Testing

  • Ran pytest tests/test_fire_hull_viewer_scalars.py -q and observed all tests passing (4 passed, 1 warning).
  • Ran pytest tests/test_fire_plot_cube_first.py tests/test_fire_plot_loader_calls.py -q to validate integration with the fire_plot paths and observed all tests passing (11 passed, 1 warning).

Codex Task

@ttuff ttuff merged commit ac0ee58 into main Mar 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant