Repository navigation
Bind local-authority energy and regional bus journeys before the Budget (#1207) - #1286
Merged
Merged
Conversation
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.
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
mainat8a7f79a82(after #1283; policyengine-uk 2.130.1). The735820cfeed artifact is in: the new resource is vendored from it, and the references are regenerated on it againstmain.What changes
Energy stage text (C1). The
energy_pricingheader, theenergy_rakegate 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_indexbasis,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_capturegains, 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.bus_engine_parity: the locked engine'sgov.dft.bus.boardings_per_tripandyield_per_boardingbeside the stage's, area by area, against a 0.1% tolerance. An engine without the parameters records why.consumption_driftgains 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 existinglad_2025aliases.Local energy appliers (C6).
uk_runtime/domestic_energy_targets.py:desnz.energy_trends.gb_domestic_level: one factor per fuel puts Great Britain's authorities on the stage's Energy Trends level, so the rows carry only DESNZ's split between areas. Northern Ireland's part of the UK level is taken out at Great Britain's share of UK households (ONS LFS 2024) until 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 brings NI's consumption. A row resolved to a DESNZ year other than the level's is refused.desnz.subnational.gas_meter_share: each authority's census households times its gas meters over its electricity meters; a missing meter row or a share outside (0, 1] is refused.household_energy_kwhturns stored spend back into kWh at the stage's declared QEP prices (the inverse of the stage's own step).consumption_driftcarries electricity and gas kWh at both weights.Local energy family (C7). Three local-authority rows for England, Wales and Scotland:
desnz.subnational.electricity_kwh,desnz.subnational.gas_kwhanddesnz.subnational.gas_connected_households(census familydomestic_energy, two DESNZ sources, four fences).energy/electricity_kwh,energy/gas_kwhandenergy/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).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).census_gas_connected_share) and take the census-household uprating, so their share does not drift.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 measuresbus_in_london_boardingsandother_local_bus_boardingsprice 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'suprating_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 fordomestic_energy(2.5%) anddft_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 inuk/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.jsonandofgem_price_cap_facts.jsontake the C1 purpose texts; no value moves. Thelcfs_consumptionstage pins the first, so the H2 spine fixture's stage contract hash moves.ledger_only(national 691 to 700, local 4,991 to 6,031); nocalibration_driftorfixture_onlycount moves.mainafter UK local surface: band domain, signed small-cell rules, renewals, support flag (#1278) #1283 keptmain's copies in the C1 and C2 commits.Review round 1 (Vahid, 2026-10-15)
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.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.desnz_local_energy_facts.jsondeclares OGL v3.0 for DESNZ and ONS.Review round 2 (Vahid, 2026-10-15)
git rebase --exec; the tree did not change. After the rebase they are30681db03,0eb83e8c9and1cd20e248.--maxfail.Rulings (María)
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;control_rescaled);matched_period; journeys have no published index);domestic_energyfences;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;tools/orrery-contracthas nonode_moduleshere, 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 .andruff format --checkon 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 inexperiments/1207-local-energy-bus-receipts.md; and the exclusion figures restated from R1. The PR was retargeted tomainon 2026-10-15 after #1270 merged and rebased ontomain(579296653) so that CI runs. It was rebased again the same day after #1283 merged (8a7f79a82).🤖 Generated with Claude Code