Model/backend/documents_parser/tests
Khalim Conn-Kowlessar 3542186f18 Slice S0380.137: extend Table 4a R-dispatch to electric storage / direct-acting / underfloor / ceiling (cluster)
Continuation of S0380.135's Table 4a per-heating-system responsiveness
dispatch (`_RESPONSIVENESS_BY_SAP_CODE` in cert_to_inputs.py). The
solid-fuel coverage closed 10 corpus variants; this slice extends the
dispatch to the electric heating SAP code ranges from SAP 10.2 Table
4a (PDF p.170):

  401  Old (large volume) storage heaters             R=0.00
  402  Slimline storage heaters                       R=0.20
  403  Convector storage heaters                      R=0.20
  404  Fan storage heaters                            R=0.40
  405  Slimline storage heaters + Celect-type ctrl    R=0.40
  407  Fan storage heaters + Celect-type ctrl         R=0.60
  408  Integrated storage+direct-acting heater        R=0.60
  409  High heat retention storage heaters (§9.2.8)   R=0.80
  421  In concrete slab (off-peak only)               R=0.00
  422  Integrated (storage+direct-acting)             R=0.25
  423  Integrated with low off-peak                   R=0.50
  424  In screed above insulation                     R=0.75
  425  In timber floor / immediately below covering   R=1.00
  515  Electricaire system                            R=0.75
  691  Panel, convector or radiant heaters            R=1.00
  694  Water- or oil-filled radiators                 R=1.00
  701  Electric ceiling heating                       R=0.75

A few electric storage codes (402, 403, 405, 407) carry a *different*
R value in the 24-hour tariff section of Table 4a vs the off-peak
section (e.g. Slimline 402 = R=0.20 off-peak / R=0.40 24-hour). This
dict captures the off-peak value as the default because the 24-hour
tariff is rare in the corpus (no variant lodges it). If a 24-hour-
tariff cert surfaces with one of these codes the dispatch needs to be
promoted to a (sap_code, tariff) lookup; until then the off-peak
default applies.

Heating-systems corpus impact — 6 electric corpus variants re-pinned:

  variant       SAP  R    ΔSAP   was       ΔPE      was
  electric 3    401  0.00 +9.43  +14.70   -1059   -3189
  electric 5    402  0.20 +6.76  +10.97     -96   -1798
  electric 6    404  0.40 +7.82  +10.97    -494   -1770
  electric 7    408  0.60 +7.58   +9.68    -428   -1277
  electric 8    409  0.80 +5.84   +6.89    +200    -224
  electric 9    421  0.00 +6.77  +12.03    +154   -1976

3/6 PE residuals close to ±200 kWh (electric 5/8/9). The remaining
+5..+9 SAP residuals across all electric variants suggest a separate
shared cascade gap (likely Table 12a high/low-rate fraction or pumps/
fans electric handling — fuel cost is consistently under-counted by
~£100-£220 across the cluster). Queued for follow-up.

electric 1 (SAP 191 Direct acting electric boiler) and electric 2
(SAP 524 Air source heat pump) unchanged — both have spec R=1.0
already (matched the Table 4d emitter fallback).

Extended handover suite: 880 pass / 0 fail (+1 new AAA test
covering the 17 electric R-dispatch entries).

Pyright net-zero on touched files (43 → 43).

No golden fixture impact — no golden cert lodges a covered electric
SAP code via the cascade path that would shift residuals.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 17:03:46 +00:00
..
fixtures Slice S0380.52: cert 000565 Elmhurst-only mapper-driven cascade pin + glazing-label coverage 2026-05-28 22:03:52 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
test_elmhurst_end_to_end.py Slice S0380.17: map Elmhurst §11 glazing-type labels to SAP10 codes 2026-05-27 23:05:52 +00:00
test_elmhurst_extractor.py extract window frame details from elmhurst site notes 🟥 2026-04-27 15:50:25 +00:00
test_end_to_end.py P6.1 follow-on: unbox BuildingPartIdentifier at backend boundaries 2026-05-20 09:58:23 +00:00
test_extractor.py Handle wall thickness "Unmeasurable" 🟩 2026-04-30 16:41:16 +00:00
test_heating_systems_corpus.py Slice S0380.137: extend Table 4a R-dispatch to electric storage / direct-acting / underfloor / ceiling (cluster) 2026-05-31 17:03:46 +00:00
test_pdf.py rename example site notes to PasHub_ and add Elmhurst example 2026-04-24 13:01:51 +00:00
test_summary_pdf_mapper_chain.py Slice S0380.133: derive solid-fuel main fuel from §14.0 EES Code 2026-05-31 10:04:28 +00:00