mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
The cascade's `additional_standing_charges_gbp(main_fuel_code, water_heating_fuel_code, tariff)` function (table_32.py:178) was already producing the right values — for cert 000565 it returns £143 (£120 mains gas standing + £23 10-hour high-rate electricity standing per Table 32 page 95). But the value only landed in `FuelCostResult.additional_standing_charges_gbp` inside `_fuel_cost`, which returns `_ZERO_FUEL_COST_FOR_OFF_PEAK` for non-STANDARD tariff. The calculator then falls back to the inline cost math (scalar fuel-cost × kWh) which had no standing-charge component → £143 was silently dropped from the off-peak cost cascade. New `CalculatorInputs.standing_charges_gbp: float = 0.0` field carries the standing-charge total into the fallback path. The inline cost summation adds it before max-clamp + PV credit. STANDARD-tariff certs route via `fuel_cost.additional_standing_ charges_gbp` (set inside `_fuel_cost`) and the calculator ignores this scalar on that path — no double-count. `cert_to_inputs` populates the new field unconditionally; the value is just zero on standard-tariff certs (Table 12 note (a) gates standing-charge inclusion regardless). Cert 000565 cascade impact: - standing_charges_gbp = £143.00 ✓ (exact match to worksheet line 251) - total_fuel_cost_gbp: Δ −310 → −167 (46% reduction) - sap_score_continuous: Δ +3.61 → +1.91 (47% reduction) - co2_kg_per_yr: Δ unchanged (standing charges don't bill CO2) Cohort regression check: 427 pass + 10 expected 000565 fails. The 14 existing Elmhurst fixtures + JSON fixtures all have meter_type= None → STANDARD → standing routes via FuelCostResult unchanged. Spec source: RdSAP 10 Table 32 page 95 standing-charge column; SAP 10.2 Table 12 note (a) inclusion gating. Pyright net-zero on both files (0 / 34). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| addresses | ||
| sap10_calculator | ||
| sap10_ml | ||
| tasks | ||
| postcode.py | ||