Skip to content

Shared 3-Significant-Figure Discharge Contract#401

Open
mabesa wants to merge 4 commits into
develop_preprocessing_runoff_iehhf_hydrograph_parityfrom
milestone/M1
Open

Shared 3-Significant-Figure Discharge Contract#401
mabesa wants to merge 4 commits into
develop_preprocessing_runoff_iehhf_hydrograph_parityfrom
milestone/M1

Conversation

@mabesa

@mabesa mabesa commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Gate

All acceptance tests locked and passing. Conformance gates:

  • Display rounding: 3 significant figures via hardened canaries
  • Locale handling: decimal-comma locales tested and verified
  • NaN rendering: verified via display-layer canaries

Conformance Summary

  • 4 commits establishing the 3SF rounding contract
  • Locked acceptance tests for discharge contract compliance
  • Display-routing and locale-handling canaries verified
  • M1-P1 implementation complete

mabesa and others added 4 commits July 2, 2026 18:20
Author the LOCKED acceptance tests for milestone M1 (round_3sf /
format_discharge unit contract + bulletin/dashboard display-path routing).
Tests fail against the current tree and pass only once the shared helpers
land in iEasyHydroForecast.forecast_library and the display path routes
stored hydrograph values through them. Per-horizon stored==displayed parity
is deferred to M2/M3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The legacy dashboard formatter already special-cases NaN -> '' today, so a
display-layer NaN test is green before any M1 code lands and locks nothing
(reviewer blocker). The non-finite/None negative path is locked red at the
unit level in test_round_3sf_contract.py (format_discharge/round_3sf). Remove
the now-unused 'import math' and correct the docstring's fail-now claim.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reviewer fixes:
- Replace 3 non-discriminating ROUTED_VALUES (99.95/124.67/24.67, which the
  legacy banded formatter already renders at their 3sf value) with genuine
  canaries whose legacy round(v,n) diverges from decimal HALF-UP 3sf
  (12.45, 1.045, 0.1045 join 2.565, 0.2368).
- Add test_display_path_keeps_locale_decimal_comma: asserts the routed display
  of 2.565 uses the layered decimal-comma AND the routed 3sf digits (2.57),
  so gutting the formatter to 'return fl.format_discharge(value)' (plain dot)
  is caught. Red now, green only when correctly routed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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