From f69d345493fae305c03febbeec3cfa3de8c85b62 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 3 Jul 2026 09:41:09 +0000 Subject: [PATCH] =?UTF-8?q?docs(corpus):=20correct=20100061275133=20pin=20?= =?UTF-8?q?comment=20=E2=80=94=20real=20driver=20is=20Table=2011?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prior comment blamed a stale build-side combi artifact (already fixed this session) and my earlier conversational claim that Elmhurst's overall SAP used regional weather was wrong too — verified the worksheet's (5) dwelling volume and wind table match our UK-average rating cascade exactly. The actual, now-quantified driver: Elmhurst's worksheet (201)/(202)/(215) show it unconditionally applies SAP 10.2 Table 11's 10% secondary/portable- electric-heater fraction based on main heating category alone, with no secondary lodged on the cert. Our `_secondary_fraction` deliberately gates this on an actual lodged/forced secondary (see the adjacent S-B30 note: applying it unconditionally regressed the full 1000-cert corpus MAE by +0.16). Forcing Table 11 on for just this cert moves 76.33 -> 73.62 (~62% of the 76.33-vs-72 gap) — confirms this, not a mapping error, drives the residual. Documented so the next reader doesn't re-litigate it. Co-Authored-By: Claude Fable 5 --- .../test_real_cert_sap_accuracy.py | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py index e1877c598..d19acf630 100644 --- a/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py +++ b/tests/domain/sap10_calculator/test_real_cert_sap_accuracy.py @@ -875,10 +875,11 @@ _EXPECTATIONS: Final[tuple[RealCertExpectation, ...]] = ( # U 0.29 (engine) vs 0.30 (Elmhurst) — which VALIDATES the slice-5 # external-insulation default (100 mm added over solid brick, # `_WALL_ADDED_INSULATION_UNKNOWN_THICKNESS_MM`); the suspended ground - # floor is U 0.68 (engine) vs 0.70 (Elmhurst). (Elmhurst''s overall - # worksheet SAP is NOT comparable — the reused-assessment combi entered - # as a "Standard Combi" carries a Table-3a keep-hot loss the lodged - # assessment did not, a build-side heating artifact, not an engine gap.) + # floor is U 0.68 (engine) vs 0.68 (Elmhurst) — EXACT after rebuilding + # with 0 extract fans + PCDB 18908 (was 0.70 pre-rebuild). Ventilation + # (21) shelter-adjusted ACH is EXACT too (0.6938 = 0.6938), and dwelling + # volume (5) 196.8995 m³ matches (confirming the mapper's +0.25 m + # upper-floor height convention mirrors Elmhurst's own internal one). # §5 (12) fix: the Main bp lodges no `floor_construction_type` (gov-API # leaves it None), but `epc.floors[0].description` = "Suspended, no # insulation (assumed)" — `_has_suspended_timber_floor_per_spec` was @@ -886,7 +887,20 @@ _EXPECTATIONS: Final[tuple[RealCertExpectation, ...]] = ( # genuinely suspended-timber floor. Now falls back to the joined # description (mirroring `_main_floor_u_value`'s existing fallback), # applying (12)=0.2 unsealed; engine converges EXACTLY on lodged (76). - # PINNED to the observed exact match. + # Elmhurst's OWN overall worksheet SAP (72) still differs from ours + # (76.33) even on these now-identical inputs — traced to SAP 10.2 + # Table 11: Elmhurst's (201)/(202)/(215) show it assumes 10% of space + # heat comes from a portable-electric secondary (658 kWh/yr @ the + # electric rate) purely from the main system's category (gas boiler), + # with NO secondary lodged (`secondary_heating.description == "None"`). + # `_secondary_fraction` only applies Table 11 when a secondary is + # actually lodged or forced by §A.2.2 — deliberately, per the S-B30 + # note a few lines below: applying Table 11 unconditionally regressed + # the full 1000-cert corpus MAE by +0.16 (lodged software doesn't + # apply Elmhurst's blanket convention). Verified: forcing Table 11 on + # for just this cert moves 76.33 -> 73.62, ~62% of the 76.33-vs-72 gap + # — confirms this is the dominant driver, not a mapping/entry error. + # PINNED to the observed exact match (vs lodged, the correct target). RealCertExpectation( schema="RdSAP-Schema-21.0.1", sample="uprn_100061275133",