Skip to content

Allow 'quarter' horizon on preprocessing hydrograph read/write#5

Merged
mabesa merged 1 commit into
mainfrom
feature/quarter-hydrograph-horizon
Jun 8, 2026
Merged

Allow 'quarter' horizon on preprocessing hydrograph read/write#5
mabesa merged 1 commit into
mainfrom
feature/quarter-hydrograph-horizon

Conversation

@mabesa

@mabesa mabesa commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What

Adds "quarter" to the shared VALID_HORIZONS allowlist so the preprocessing hydrograph read/write path accepts quarterly norm rows end to end.

Why

The preprocessing service now supports a QUARTER horizon on its hydrographs table (server-side HorizonType enum + Alembic migration). preprocessing_runoff writes quarterly hydrograph norm rows via write_hydrograph, and the forecast dashboard reads them via read_hydrograph. Both previously raised ValueError because the client's allowlist lacked quarter. This was the only client-side blocker.

Changes

  • VALID_HORIZONS widened by exactly one value (quarter).
  • read_hydrograph / read_runoff now validate quarter as allowed (shared set); write_hydrograph passes record dicts through untouched.
  • Tests: validator regression (six legacy horizons still valid, fortnight still rejected), read_hydrograph(horizon="quarter"), write_hydrograph quarter record, repurposed runoff test.
  • Version bump 0.1.00.4.0 (aligned source files to CHANGELOG history) + CHANGELOG entry.

Notes

  • prepare_hydrograph_records's Literal type hint is intentionally left unchanged (signature change out of scope; static-only, not enforced at runtime).
  • pyproject.toml/__version__ had lagged the CHANGELOG (was 0.1.0 vs CHANGELOG 0.3.0); realigned and bumped to 0.4.0.

Tests: 193 passed, zero skips. mypy clean.

🤖 Generated with Claude Code

Add "quarter" to the shared VALID_HORIZONS allowlist so the preprocessing
hydrograph read/write path accepts quarterly norm rows end to end. This
unblocks preprocessing_runoff (writes quarterly hydrograph norms) and the
forecast dashboard (reads them), which previously raised ValueError.

The allowlist is widened by exactly one value. As VALID_HORIZONS is shared
with read_runoff, quarter is now accepted there too. Bump version to 0.4.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mabesa mabesa merged commit 7bd3491 into main Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant