mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
SAP 10.2 Appendix M1 §6 (p.94): "When calculating the fuel cost benefits ... apply the normal import electricity price to PV energy used within the dwelling and the 'electricity sold to grid, PV' price from Table 12 to the energy exported." Adds the third leg of the β-factor split (PE was S0380.45, CO2 was S0380.46). Now uniform across all three cascades: PE → IMPORT PEF × E_dw + EXPORT PEF × E_ex CO2 → IMPORT CO2 × E_dw + EXPORT CO2 × E_ex Cost → IMPORT £ × E_dw + EXPORT £ × E_ex Mechanism: - `worksheet/fuel_cost.py`: optional `pv_dwelling_kwh_per_yr` + `pv_exported_kwh_per_yr` + `pv_dwelling_import_price_gbp_per_kwh` keyword args; when all three are set, split the credit; otherwise fall back to legacy single-rate-EXPORT (preserves synthetic test constructions). - `rdsap/cert_to_inputs.py`: new `_pv_dwelling_import_price_gbp_per_kwh` helper that pulls Table 32 code 30 (standard electricity = 13.19 p/kWh) for standard tariff; off-peak branch uses `prices.e7_low_rate_p_per_kwh` as the natural extension point when the first off-peak PV cert lands (currently short-circuited by the `Tariff != STANDARD` guard at line 2710). - `calculator.py`: new `pv_dwelling_import_price_gbp_per_kwh` field on `CalculatorInputs` with synthetic-fallback split logic mirroring the precomputed-fuel_cost path. Maintains the cross-cascade architecture documented in the prior handover. Cohort impact: **none**. Per ADR-0010 RdSAP10 amendment, Table 32 collapses code 30 (standard electricity import) and code 60 (electricity sold to grid, PV) to the SAME 13.19 p/kWh rate. So the β-split's E_dw × 13.19 + E_ex × 13.19 == E_total × 13.19, matching the legacy single-rate credit at 1e-4 — 763 pass + 0 fail across the full chain test suite (Elmhurst U985, cohort-1 ASHP, cohort-2 38-cert sweep, 15-cert golden fixtures). The β-split shape is now in place for the off-peak case (where weighted Table 12a high/low rates would diverge) and any future amendment that splits import/export prices. Pyright net-zero on touched files (34 errors before, 34 after — all pre-existing). |
||
|---|---|---|
| .. | ||
| addresses | ||
| sap10_calculator | ||
| sap10_ml | ||
| tasks | ||
| postcode.py | ||