Skip to content

Bind local-authority energy and regional bus journeys before the Budget (#1207) - #1286

Merged
juaristi22 merged 21 commits into
mainfrom
uk-local-energy-bus-1207
Oct 15, 2026
Merged

juaristi22 merged 21 commits into
mainfrom
uk-local-energy-bus-1207

Conversation

@juaristi22

@juaristi22 juaristi22 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Delivers the ready items of #1207 under María's rulings of 2026-10-14 and 2026-10-15, in one PR as she ruled: DESNZ sub-national domestic energy as local-authority targets, DfT BUS01a journeys by English region, and the other #1207 items that can land before the Budget build. It does not close #1207; what still waits is listed at the end.

Based on main at 8a7f79a82 (after #1283; policyengine-uk 2.130.1). The 735820c feed artifact is in: the new resource is vendored from it, and the references are regenerated on it against main.

What changes

Energy stage text (C1). The energy_pricing header, the energy_rake gate docstring, the region crosswalk's policy text and the stage note now describe the calendar-2024 level, the connect leg and the household kWh ceilings (#1113, #1164). Text only; the coverage manifest and the H2 spine fixture move with the stage note (regenerated in the last commit).

Northern Ireland bus fares from their own yields (C2). Northern Ireland publishes no bus fares index, so its 2024-25 yield was re-priced to calendar 2024 with England's local bus fares index, which carries the January 2025 English fare-cap rise. A new price_index basis, own_fiscal_yields, weights NI's own published yields of the fiscal years opening in 2023 and 2024 three months and nine over the later yield. The factor moves from 0.982 to 0.989. This is the PR's only change to a spine column: between the two spines, only NI's bus fare columns and the receipts should differ.

Report-only receipts (C3, C4).

  • division_capture gains, per COICOP division, the donor's weighted total and the frame's over it, so the furnishings and health over-draw can be read on any build against the 2024-25 donor. The recompose receipt records the donor's other fuels beside ONS 04.5.3 and 04.5.4.
  • The measure resolver's receipt gains bus_engine_parity: the locked engine's gov.dft.bus.boardings_per_trip and yield_per_boarding beside the stage's, area by area, against a 0.1% tolerance. An engine without the parameters records why.
  • consumption_drift gains the full-rate VAT base at design and final weights.

Crosswalk vintage (C5). DESNZ stamps every authority with publication_2025_nspl; the England, Wales and Scotland accept-sets gain it. Barnsley and Sheffield resolve through the existing lad_2025 aliases.

Local energy appliers (C6). uk_runtime/domestic_energy_targets.py:

Local energy family (C7). Three local-authority rows for England, Wales and Scotland: desnz.subnational.electricity_kwh, desnz.subnational.gas_kwh and desnz.subnational.gas_connected_households (census family domestic_energy, two DESNZ sources, four fences).

  • Metrics energy/electricity_kwh, energy/gas_kwh and energy/gas_connected_households, appended after the high-value homes metrics, local authorities only. They read the stored spend at the dataset period: policyengine-uk uprates electricity and gas spend by CPI away from the period they were supplied for (an engine test pins this).
  • The kWh rows declare local_routes: no_higher_control (DESNZ's region rows are the authorities' sums, and a gas bridge would put the three authorities without gas rows in controlled legs).
  • The gas-connected rows join the census household partition (census_gas_connected_share) and take the census-household uprating, so their share does not drift.
  • Orkney and Shetland have no mains gas: their gas cells are signed deferrals, never zeros. The Isles of Scilly and the City of London take the existing support-floor deferral.
  • Weight bases: kWh rows are amounts, gas-connected households a count. The appliers read desnz_local_energy_facts.json (authority meter counts and four ONS household totals, with the OGL v3.0 attribution for DESNZ and ONS).

BUS01a journeys by English region (C8). Nine national rows, family dft_bus_journeys: London and the eight other English regions, FY2024-25. The frame carries NTS trips, not boardings, so the resolver's new household measures bus_in_london_boardings and other_local_bus_boardings price each household's trips at the boardings per trip the stage priced each series at; a persisted column of either name is refused. London's row counts every resident's bus-in-London trips and has no residence filter. The selectors take BUS01a only (dimensions: []; BUS01c's concessionary rows carry a journey category). They pin no year; instead each row's uprating_index, dft.bus01.stage_pricing_year, holds it at the fiscal year the stage prices boardings per trip from and refuses any other year. The stage's bus receipt sets each English region's share of the eight regions' other local bus trips, at prior weights, beside its share of BUS01a's journeys.

Loss-share floors (C9). UK_LOCAL_FAMILY_LOSS_SHARE_FLOORS: a check-only minimum share of the dense solve's loss weight for domestic_energy (2.5%) and dft_bus_journeys (1.25%), against about 2.8% and 1.5% under the doctrine rule (one of nine local-authority families; one of seventeen nation and region families). It runs after the row-metadata rule builds the weights and is recorded in the problem's bindings; the weights do not change. A share equal to its floor meets it.

Fixes and guards found in local lanes. The kWh read-back decodes the engine's region enum, and it skips households that pay nothing: a defensive guard for a region no QEP price covers (policyengine-uk's UNKNOWN; the frame has none). The bus parity reads engine parameters at the year, as the resolver's other reads do.

Vendoring and regeneration on 735820c.

  • desnz_local_energy_facts.json, declared in uk/country_package.json: 701 rows. They are the domestic electricity meter counts of 350 authorities, the gas meter counts of 347 (the Isles of Scilly, Orkney and Shetland have no gas rows), and four ONS household totals (England, Wales, Scotland and the UK). The licence is in its header.
  • desnz_domestic_energy_facts.json and ofgem_price_cap_facts.json take the C1 purpose texts; no value moves. The lcfs_consumption stage pins the first, so the H2 spine fixture's stage contract hash moves.
  • National references: 1,283 to 1,292 active (the nine BUS01a rows).
  • Local references: 24,269 to 25,309 active. Of the 1,050 new cells (350 authorities, three rows), 1,040 compile. Seven are signed deferrals: the support floor's five (the Isles of Scilly and the City of London on the electricity and gas-connected rows, and the City of London on gas kWh), and Orkney and Shetland's gas-connected cells. The Isles of Scilly, Orkney and Shetland have no gas kWh row; for Orkney and Shetland that absence is signed.
  • Compile parity receipts: the new rows are all ledger_only (national 691 to 700, local 4,991 to 6,031); no calibration_drift or fixture_only count moves.
  • The coverage manifest and the H2 spine fixture are regenerated in the last commit for the whole PR: the rebase onto main after UK local surface: band domain, signed small-cell rules, renewals, support flag (#1278) #1283 kept main's copies in the C1 and C2 commits.

Review round 1 (Vahid, 2026-10-15)

  1. Period guard: the journey rows' uprating_index (dft.bus01.stage_pricing_year) holds each row at the stage's pricing year and refuses another, as the energy rows refuse a DESNZ year other than their level's.
  2. One factor for eight regions: the stage's bus receipt now has england_outside_london_regions (prior-weight trip shares beside BUS01a's journey shares, and London residents' share of the other local trips). Per-region factors need NTS0318 (trips and stages by mode and region of residence), which the feed does not carry yet; it is item 6 of UK local energy, area classification and Welsh bus facts: DESNZ Northern Ireland and sub-local consumption, rural-urban lookups, BUS04 country rows (PolicyEngine/microcosm#1207) chronicle#356.
  3. Electricity period: the texts now say non-half-hourly meters from 31 January to 30 January and half-hourly meters over the calendar year, both counted.
  4. Zero-spend guard: kept as a defensive guard, with a test for the case it covers.
  5. Licence: a vendored resource may declare its publishers' licence; desnz_local_energy_facts.json declares OGL v3.0 for DESNZ and ONS.
  6. WIP titles: reworded in round 2.

Review round 2 (Vahid, 2026-10-15)

  • Artifact and the four artifact-bound tests: the resource is vendored and the references regenerated (above); the four tests pass.
  • 6. WIP titles: reworded with git rebase --exec; the tree did not change. After the rebase they are 30681db03, 0eb83e8c9 and 1cd20e248.
  • 7. Full engine-free run: the verification below runs CI's own engine-free file list without --maxfail.
  • 8. Body: the verification is at the new head, and the last paragraph now says how the branch was rebased.

Rulings (María)

  • 2026-10-14: the whole issue in one PR; local-authority grain only for energy; rows reconciled onto the stage's Energy Trends level; no constituency rows before the Budget; a check-only floor.
  • 2026-10-15, signed in the registers (each expires 2026-12-15):
    • the kWh rows are held at 2024 (matched_period): both sides are 2024 by design, and Energy Trends 2025 was weighed as an index and not taken, so the weights do not absorb the change in use per household;
    • the gas-connected rows keep their 2024 meter share under the household controls (control_rescaled);
    • the BUS01a rows are held at FY2024-25 (matched_period; journeys have no published index);
    • the four domestic_energy fences;
    • floors of 2.5% and 1.25%, checked under the doctrine's row-metadata rules only.

Verification (local, at e2e38751a)

The full runs were at 2ec0c12df, which differs from the head only by the scorer pin below; at the head, the scorer's tests and the dataset-size tool's tests pass.

  • Engine-free, CI's own file list without --maxfail (581 files, 18,819 tests): the four artifact-bound tests pass. Six tests failed. Five come from this machine's environment:

    • test_spawned_workers_score_identically_to_sequential_cli: its worker flag needs Python 3.14.7, and this machine has 3.14.6;
    • test_live_latest_pointer_resolves_to_a_coherent_certified_release[uk-2025-national]: it reads the live published release pointer;
    • the two Orrery parser tests: tools/orrery-contract has no node_modules here, and CI installs them;
    • test_engine_is_reported_unavailable_without_the_uk_extra: this environment has the UK extra installed.

    The sixth was the local candidate scorer's count, which UK local surface, consumption and high-value homes: remaining items (consolidation) #1278 ties to the committed active references. The last commit moves it to 25,309.

  • Engine UK lane (51 files, 209 tests, policyengine-uk 2.130.1): green.

  • tools/ci_test_plan.py verify, tools/graph_acceptance_burndown.py --verify, ruff check . and ruff format --check on every touched Python file: clean.

  • Disclosure: the new commit holds publishers' rows (DESNZ meter counts, ONS household totals), reference and cell counts, hashes and pins. It holds no microdata quantity.

  • Not run here: the integration smoke (CI runs it).

Disclosure control

The committed values are publishers' (DESNZ, DfT, ONS) or declared rules. No per-authority model estimate, error or support count is committed or posted. Build receipts will report, per family, counts and shares of areas within 10% and 25%, support in bands, and no maxima, minima or single areas.

Next

Two spines (control at main, candidate here), two dense arms at K=15, and R1 on the candidate spine, one heavy job at a time; receipts in experiments/1207-local-energy-bus-receipts.md; and the exclusion figures restated from R1. The PR was retargeted to main on 2026-10-15 after #1270 merged and rebased onto main (579296653) so that CI runs. It was rebased again the same day after #1283 merged (8a7f79a82).

🤖 Generated with Claude Code

Loading
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.

UK consumption-tax levels: open items after #1167

2 participants