Conversation
Three things the audit flagged as small quality-of-life: 1. Simulation.save() raises a helpful ValueError when output_dataset is None rather than the raw AttributeError from None.save(). Names the missing step (run()/ensure()). 2. scripts/check_data_staleness.py — a ~60 line script that prints a one-line verdict per country comparing the bundled release manifest's model_package.version against the installed country package. Exits non-zero when any country is stale so CI can gate on it. No network access; reads both sides locally. 3. Clarified the load() docstring — the "created_at/updated_at round-trip" claim was misleading; these are filesystem ctime/mtime approximations because save() doesn't persist them. Regression tests in tests/test_small_follow_ups.py: - save() raises ValueError with "no output_dataset" in the message when output_dataset is None - check_data_staleness script runs and emits one verdict line per configured country - direct test of check_country() against a tmp manifest with a drifted pin, so we don't have to reinstall a country package to exercise the drift path All 430 existing tests still pass.
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.
Three small quality-of-life items the v4 audit flagged:
1.
Simulation.save()unhelpful errorBefore:
AttributeError: 'NoneType' object has no attribute 'save'After:
ValueError: Simulation.save() called with no output_dataset. Run simulation.run() or simulation.ensure() first so there is something to persist.One-line fix in
common/model_version.py.2.
scripts/check_data_staleness.py~60 lines of Python. Prints one verdict line per country comparing the bundled release manifest's
model_package.versionagainst the installed country package. Exits non-zero when any country is stale so CI can gate on it. No network access; reads both sides locally viaimportlib.metadata+ the bundled JSON.Example output:
Targeted fix for the "is our data stale?" pain flagged in #311. Doesn't require the larger storage-substrate design to ship.
3. Clarified
load()docstringThe old docstring claimed
save()+load()round-tripcreated_at/updated_at. They don't —save()doesn't persist them;load()reads filesystemctime/mtimeinstead. Docstring now says so.Tests
tests/test_small_follow_ups.py— 3 tests:save()raisesValueErrorwith "no output_dataset" in the messagecheck_data_stalenessscript emits one line per countrycheck_country()test against a tmp manifest with a drifted pin430/430 existing tests still pass.
🤖 Generated with Claude Code