feat(regression): stabilise committed-bundle bytes, fix docs & lint coverage#744
Conversation
…igures Committed regression bundles stored full-precision float64, whose least significant digits are platform-dependent (CPU, BLAS, library versions). Those digits churned byte-for-byte between a local run and a CI mint even when the result was numerically identical, producing noisy committed diffs. Round every float in the committed series.json / diagnostic.json to seven significant figures at write time, in core, so it applies to all providers and to both run and mint. Seven figures is one digit finer than the rtol=1e-6 regression compare, so rounding stays an order of magnitude under tolerance and never flips a gate verdict. output.json is float-free and left untouched; native blobs and their content-addressed digests are never touched.
…s guides Fix inaccuracies verified against source: remove the non-existent TestCase.datasets attribute and the three-level "Dataset Resolution Priority" (resolution is datasets_file or solve-from-catalog); correct the size-flagging attribution (ref test-cases run / --size-threshold, not a pre-commit hook, which in fact excludes regression paths); and fix the execution_regression factory + check() example. Document the manifest schema field, add check-store to the verb table, cover CMIP7Request and the cmip7-converted cache, and note the committed-bundle float precision behaviour.
The exclude pattern .*/regression/.* was intended to skip the committed baseline data, but it also matched the regression source package (climate_ref_core/regression/) and its unit tests, so ruff never checked them (CI runs only make pre-commit). Narrow the pattern to data under test-data/ locations so the source package is linted like any other code; the baseline bundles remain excluded.
Document the committed-bundle float quantisation (improvement), the regression documentation corrections (docs), and the narrowed pre-commit regression exclude (trivial).
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Replace the unicode arrow with -> to match the project's ASCII convention.
89fa2c2 to
619d3aa
Compare
|
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds a new ChangesFloat quantisation for stable committed regression bundle bytes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ff6d2c9d-82fb-4974-b0f5-cd5ee48aa2f0
📒 Files selected for processing (10)
.pre-commit-config.yamlchangelog/744.docs.mdchangelog/744.improvement.mdchangelog/744.trivial.mddocs/background/regression-baselines.mddocs/how-to-guides/testing-diagnostics.mdpackages/climate-ref-core/src/climate_ref_core/regression/_quantise.pypackages/climate-ref-core/src/climate_ref_core/regression/capture.pypackages/climate-ref-core/tests/unit/regression/test_capture.pypackages/climate-ref-core/tests/unit/regression/test_quantise.py
Reflow the prose in the regression docs and the touched code comments and docstrings onto semantic line breaks at the project's 110-column width. Wording, punctuation, and rendered output are unchanged; only line wrapping differs.
Description
Three orthogonal core/tooling improvements surfaced while doing the ILAMB cmip6 baseline work (handoff from #743). Each is cross-cutting — it affects every provider's regression bundle — so they are grouped here as one small PR with separate commits. None re-runs or re-mints any baselines.
1. Committed-bundle float quantisation (
feat). Committedseries.json/diagnostic.jsonstored full-precisionfloat64whose least-significant digits are platform-dependent (CPU, BLAS, library versions), so they churned byte-for-byte between a localrunand a CIminteven when numerically identical. Floats are now rounded to 7 significant figures at write time, in core, so it applies to all providers and to bothrunandmint. Seven figures is deliberately one digit finer than thertol=1e-6regression compare, so the rounding error stays an order of magnitude under tolerance and can never flip a gate verdict.output.jsonis float-free and left untouched; native blobs and their content-addressed digests are never touched. This is non-breaking without a re-mint: the gate compares values atrtol=1e-6, so 7-s.f. output still matches the existing full-precision baselines — a one-time re-mint to refresh the stored bytes can follow separately whenever convenient.2. Documentation fixes (
docs). Corrected inaccuracies intesting-diagnostics.md(a non-existentTestCase.datasetsattribute and three-level resolution priority; the size-flagging attribution, which isref test-cases run --size-threshold, not a pre-commit hook; and theexecution_regressionfactory +check()example), and filled gaps inregression-baselines.md(the manifestschemafield, thecheck-storeverb,CMIP7Requestand thecmip7-convertedcache, and a note on the new committed-bundle float precision).3. Pre-commit exclude fix (
ci). The.*/regression/.*exclude — intended to skip the committed baseline data — also matched the regression source package (climate_ref_core/regression/) and its unit tests, so ruff never linted them (CI runs onlymake pre-commit). The pattern is narrowed to data undertest-data/locations so the source is linted like any other code while the baseline bundles stay excluded; zero pre-existing errors surfaced.Verification
38 new + 191 existing regression unit tests pass;
ruff,ruff formatandmypyare clean; the fullmake pre-commitrun is green and modifies no files.Checklist
Please confirm that this pull request has done the following:
changelog/Summary by CodeRabbit
New Features
Bug Fixes
Documentation
check-storelifecycle guidance, dataset resolution workflow changes, and float precision details.Chores
test-data/, and enabled linting for the regression source and tests.Tests