From 42f02f33d8e37257db96e01735077b5dc8cbf278 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Thu, 11 Jun 2026 11:50:14 +0000 Subject: [PATCH] =?UTF-8?q?Pin=20band-2=20glazing=20scaling=20at=20x1.25?= =?UTF-8?q?=20for=2018.0=20certs=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Behaviour delivered by the band-multiplier dict in the prior slice; this pins the band-2 ("More than typical") case against the inherited 20.0.0 coefficient. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../domain/tests/test_from_rdsap_schema.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index 3c64edc2..8e88bb77 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -1525,3 +1525,31 @@ class TestRdSap18_0ReducedFieldSynthesis: assert sorted(w.orientation for w in result.sap_windows) == [1, 3, 5, 7] total_area = sum(w.window_width * w.window_height for w in result.sap_windows) assert total_area == pytest.approx(0.148 * tfa) + + def test_band_more_than_typical_scales_glazing_by_1_25(self) -> None: + # Arrange — ADR-0028: the glazed_area band scales synthesised area off the + # Normal ratio. Band 2 ("More than typical") = 1.25, the inherited 20.0.0 + # multiplier (18.0's 26 band-2 windowless certs can't re-fit it — no + # measured band-2 windows — so it is reused, not re-derived). A band-2 + # cert with no per-window array. + corpus = _load_18_0_corpus() + if not corpus: + pytest.skip("no RdSAP-Schema-18.0 corpus harvested") + cert = next( + ( + c + for c in corpus + if not c.get("sap_windows") and c.get("glazed_area") == 2 + ), + None, + ) + if cert is None: + pytest.skip("no band-2 corpus cert without sap_windows") + tfa = float(cert["total_floor_area"]) + + # Act + result = EpcPropertyDataMapper.from_api_response(cert) + + # Assert + total_area = sum(w.window_width * w.window_height for w in result.sap_windows) + assert total_area == pytest.approx(0.148 * tfa * 1.25)