Skip to content

Curated scenario surface: deltas-only API over the cached pinned run - #4

Merged
vahid-ahmadi merged 1 commit into
mainfrom
scenario-surface
Aug 5, 2026
Merged

Curated scenario surface: deltas-only API over the cached pinned run#4
vahid-ahmadi merged 1 commit into
mainfrom
scenario-surface

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Contributor

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_regulation under 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.
  • VALIDATION.md targets 2/3 moved to PARTIAL: scenario deltas are gated against the pinned oracle run; the published-figure comparison remains pending (define-model.org publishes no machine-readable scenario numbers — the paper's results are figure-only).
  • README: status + scenario-surface section (local-only, deltas-only).

Tests

116 passed, 1 skipped locally against the cached run at 846081a.

🤖 Generated with Claude Code

- 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>
@vahid-ahmadi
vahid-ahmadi merged commit d7fdd64 into main Aug 5, 2026
1 check passed
@vahid-ahmadi
vahid-ahmadi deleted the scenario-surface branch August 5, 2026 10:12
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