Model/domain
Khalim Conn-Kowlessar 8942d45772 fix(fuel): price secondary dual-fuel/anthracite at their own rate, not the colliding LPG code (RdSAP 10 Table 32)
The gov-API lodges secondary fuel as an enum whose value can COLLIDE with a
different same-valued RdSAP 10 Table 32 / SAP 10.2 Table 12 fuel code:
  - enum 9  = "dual fuel (mineral and wood)"  vs Table code 9  = LPG SC11F
  - enum 5  = "anthracite"                    vs Table code 5  = LPG (bulk)
The main-fuel boundary already canonicalises these (`_GOV_API_COLLISION_
FUELS`), but the SECONDARY-heating cost + CO2/PE paths never did — they took
the bare same-value lookup, so a dual-fuel room heater was priced as LPG
(3.48 vs dual-fuel 3.99 p/kWh) and emitted as LPG (CO2 0.241 vs 0.087),
and an anthracite secondary as bulk LPG (12.19 vs 3.64 p/kWh). The price
under-count over-rates SAP; the CO2 over-count inflates emissions.

Fix: add enum 9 to `_GOV_API_COLLISION_FUELS` (5 and 33 were already there)
and canonicalise the secondary fuel code on both the cost
(`_secondary_fuel_cost_gbp_per_kwh`) and factor (`_secondary_fuel_code`)
paths, mirroring the main-fuel boundary. canonical_fuel_code only touches
{5,9,33}, so genuinely Table-coded secondaries (House coal 11, wood logs 20,
community fuels 30-32) are left unchanged — confirmed by a full-map audit.

Corpus: within-0.5 69.7% -> 70.2% (MAE 0.854 -> 0.845; dual-fuel-secondary
cohort 42.9% -> 49.0%, signed +0.55 -> +0.41) and CO2 MAE 0.12 -> 0.08 t/yr
(bias +0.04 -> 0.00). Ratcheted the corpus floors (within 0.70, MAE 0.85,
CO2 0.09, PE 4.0). A prior session deferred enum 9 ("direction not
understood") while the EPC PE/CO2 lens was confounded by the climate-cascade
bug (fc7c4d2d); on the corrected lens the over-rate direction is clear.

pyright not installed in this codespace (strict gate not run locally).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:52:58 +00:00
..
addresses standardist Address 2026-05-22 10:13:32 +00:00
billing feat(modelling): attribute per-measure bill savings via a telescoping cascade 2026-06-03 18:01:11 +00:00
data_transformation moved classifier data transformation to an easy one 2026-06-01 14:53:34 +00:00
epc Remove EPC and asset_list changes unrelated to SAL handler 2026-06-01 16:39:09 +00:00
epc_prediction refactor(epc-prediction): PR review — rename ComparableProperty, relocate PredictionTarget 2026-06-16 13:34:44 +00:00
fuel_rates feat(fuel-rates): FuelRates snapshot + repository foundation (ADR-0014) 2026-06-02 09:29:07 +00:00
geospatial feat(geospatial): one-read spatial reference (coords + restrictions) 2026-06-04 17:13:39 +00:00
magicplan add todo comment for named ranges 2026-06-10 13:32:11 +00:00
modelling feat(modelling): drive measure scoping from the Scenario's exclusions 2026-06-16 15:26:25 +00:00
property feat(epc-prediction): slice-5a predicted source path on Property 2026-06-16 03:33:47 +00:00
property_baseline feat(baseline): sap_code_to_fuel normalizes via the calculator's own helper 2026-06-05 18:59:25 +00:00
sap10_calculator fix(fuel): price secondary dual-fuel/anthracite at their own rate, not the colliding LPG code (RdSAP 10 Table 32) 2026-06-18 14:52:58 +00:00
sap10_ml fix(uvalues): apply §5.8 insulation R to stone walls (RdSAP 10 p.41-42) 2026-06-17 00:26:25 +00:00
tasks added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
building_geometry.py feat(modelling): floor Recommendation Generator + ground-floor-area geometry 2026-06-03 09:12:29 +00:00
postcode.py get rid of comments 2026-05-20 13:21:11 +00:00