slice S-B14: cert-calibration E7 codes include 691-696 (electric room heaters)

Hand-trace cert 0340-2394 (73m² mid-floor flat, code 691 electric room
heater, actual SAP 75, predicted 56) confirmed the cert software
applies off-peak rates to electric room heaters when the dwelling has
the E7-tariff hallmarks (electric immersion HW cylinder). Extending
the cert-calibration E7-eligible set from {191-196, 401-409, 421-425}
to add {691-696}.

100-cert parity probe:
  MAE 4.48 → 4.40    (-0.08)
  RMSE 5.81 → 5.63
  bias -0.52 → +0.16 (essentially centered)
  within ±10: 95% → 96%

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-05-18 16:07:51 +00:00
parent d004dc3f5c
commit 64fce04169

View file

@ -100,13 +100,19 @@ def _build_cert_calibration_table():
`PriceTable` value at validation-script init time."""
from domain.sap.rdsap.cert_to_inputs import PriceTable
# Cert-calibration empirically extends the E7 off-peak set to
# direct-electric codes (191-196) — the cert assessor applies the
# off-peak rate to these even though SAP 10.2 Table 12a says 90%
# high-rate. Confirmed by hand-tracing cert 0800-1364 (Detached
# bungalow, code 191, actual SAP 71, predicted 37 before this fix).
# Cert-calibration empirically extends the E7 off-peak set:
# 191-196 direct-electric (boilers etc) — S-B11 finding
# 401-409 electric storage heaters (spec-correct)
# 421-425 high-heat-retention storage (spec-correct)
# 691-696 electric room heaters — S-B14 finding (cert 0340-2394:
# 73m² mid-floor flat, code 691, actual SAP 75, predicted
# 56 before this; cert software applies off-peak to all-
# electric dwellings regardless of heating typology).
cert_calibration_e7_codes = frozenset(
list(range(191, 197)) + list(range(401, 410)) + list(range(421, 426))
list(range(191, 197))
+ list(range(401, 410))
+ list(range(421, 426))
+ list(range(691, 697))
)
return PriceTable(
unit_price_p_per_kwh=unit_price_p_per_kwh,