Curated scenario surface: deltas-only API over the cached pinned run - #4
Merged
Conversation
- src/define_uk/scenarios.py: registry of all 22 upstream scenarios (4 blocks; power-sector block under 5 expectation regimes); run_scenario() returns annualised scenario-minus-baseline delta paths with calendar years, provenance, and mandatory deltas-only framing. Reads the cached run only; never runs R. - tests/test_scenarios.py: gates deltas finite, cross-block baseline consistency, cached-number-grounded sign sanity, 11 pinned points. - VALIDATION.md targets 2/3 PARTIAL (oracle-gated; published-figure comparison pending — no machine-readable numbers on define-model.org). - README: scenario surface documented, local-only, deltas-only. Co-Authored-By: Claude Fable 5 <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
src/define_uk/scenarios.py: curated registry of all 22 upstream scenarios found in the cached pinned run (blocks:gvt_investment,housing_regulation,power_sector_regulationunder five expectation regimes,mixed).list_scenarios()-> [{name, block, description}];run_scenario(name, variables=("GDP_R","EMIS","UPLOT","CONS_R"), horizon_years=15)-> annualised scenario-minus-baseline delta paths (level and %), calendar years (1987Q1 anchor), provenance (pinned commit, cache path, R run date),result_type="scenario deltas"and mandatory caveats (demand-led closure; deltas only — baseline levels not validated; emissions vintage divergence; experimental; unlicensed upstream, local cache only). Reads the CACHED run; never runs R — raises with instructions if no cache.tests/test_scenarios.py(skips without cache): deltas finite + framing fields present for all 22 scenarios; baselines identical across block folders; sign sanity grounded in the cached numbers (green public investment: early GDP dip then +4.08/+7.75 by 2030/2035 with emissions falling; housing regulation contractionary throughout with emissions falling; mixed policy largest 2035 emissions cut); 11 pinned delta points so silent changes fail.Tests
116 passed, 1 skipped locally against the cached run at
846081a.🤖 Generated with Claude Code