Shared 3-Significant-Figure Discharge Contract#401
Open
mabesa wants to merge 4 commits into
Open
Conversation
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>
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.
Gate
All acceptance tests locked and passing. Conformance gates:
Conformance Summary