Allow 'quarter' horizon on preprocessing hydrograph read/write#5
Merged
Conversation
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>
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.
What
Adds
"quarter"to the sharedVALID_HORIZONSallowlist so the preprocessing hydrograph read/write path accepts quarterly norm rows end to end.Why
The preprocessing service now supports a
QUARTERhorizon on itshydrographstable (server-sideHorizonTypeenum + Alembic migration).preprocessing_runoffwrites quarterly hydrograph norm rows viawrite_hydrograph, and the forecast dashboard reads them viaread_hydrograph. Both previously raisedValueErrorbecause the client's allowlist lackedquarter. This was the only client-side blocker.Changes
VALID_HORIZONSwidened by exactly one value (quarter).read_hydrograph/read_runoffnow validatequarteras allowed (shared set);write_hydrographpasses record dicts through untouched.fortnightstill rejected),read_hydrograph(horizon="quarter"),write_hydrographquarter record, repurposed runoff test.0.1.0→0.4.0(aligned source files to CHANGELOG history) + CHANGELOG entry.Notes
prepare_hydrograph_records'sLiteraltype hint is intentionally left unchanged (signature change out of scope; static-only, not enforced at runtime).pyproject.toml/__version__had lagged the CHANGELOG (was0.1.0vs CHANGELOG0.3.0); realigned and bumped to0.4.0.Tests:
193 passed, zero skips. mypy clean.🤖 Generated with Claude Code