Model/datatypes/epc/schema
Khalim Conn-Kowlessar 3ac07bd04a Slice 37: sap_ventilation mapper fix (21.0.1) + per-cert golden pin
The 21.0.1 mapper produced EpcPropertyData with sap_ventilation=None,
so the cert→inputs cascade defaulted every ventilation count to zero
even when the cert lodged extract fans (most schema-21 certs do).
extract_fans_count was double-mapped — surfaced as a top-level field
the calculator never reads, but missing from the SapVentilation slice
the cascade does read.

Fix: populate sap_ventilation in from_rdsap_schema_21_0_1 with
extract_fans_count. Drives ~⅓ of the rating-cohort drift on a clean
no-PV no-secondary gas-combi cert.

Refactored test_golden_fixtures.py from global tolerance ceilings
(±13 SAP / ±35 PE) to per-cert pinned residuals at abs SAP=0,
PE=0.01 kWh/m², CO2=0.001 t/yr. Each cert's _GoldenExpectation now
records the actual current residual (SAP/PE/CO2 — CO2 newly pinned
via the postcode-cascade environmental section). Drift in either
direction fires the test: tighten the pin on improvement, document
on regression.

Recorded residuals reflect known remaining mapper gaps (RR room-in-
roof extraction on cert 0240, oil cascade on 0390, etc.) — tracked
in each cert's notes: field, not acceptance bounds.

930/930 Elmhurst cascade pins unchanged (site-notes EPCs already
populate sap_ventilation). 257/257 mapper tests green. 10/10 golden
cohort green under the new pins. Pyright net-zero (34 errors before
and after).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:30:12 +00:00
..
tests Slice 37: sap_ventilation mapper fix (21.0.1) + per-cert golden pin 2026-05-24 11:30:12 +00:00
__init__.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
common.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
helpers.py slice 10.5: PhotovoltaicArray on SAP10 schema + EpcPropertyData 2026-05-16 16:00:25 +00:00
rdsap_schema_17_0.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
rdsap_schema_17_1.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
rdsap_schema_18_0.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
rdsap_schema_19_0.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
rdsap_schema_20_0_0.py first draft dataclasses with loading tests 2026-04-10 11:33:17 +00:00
rdsap_schema_21_0_0.py slice 14j: Optional sweep across schema 21.0.1 + mapper guards 2026-05-16 20:35:28 +00:00
rdsap_schema_21_0_1.py slice 15d: +50 features (gap fill + secondary building part); drop 2 derived 2026-05-17 10:13:03 +00:00