diff --git a/domain/sap10_calculator/worksheet/tests/test_internal_gains.py b/domain/sap10_calculator/worksheet/tests/test_internal_gains.py index 11298313..55bdb058 100644 --- a/domain/sap10_calculator/worksheet/tests/test_internal_gains.py +++ b/domain/sap10_calculator/worksheet/tests/test_internal_gains.py @@ -580,7 +580,15 @@ def _build_section_5_epc(fixture: ModuleType) -> EpcPropertyData: doesn't yet carry: sap_windows (DG air-filled / PVC), low-energy bulb count, and a MainHeatingDetail with the recorded pump age. Kept in test scope so the legacy fixture build_epc()s stay pinned for §1-§4 - conformance + the e2e SAP-score regression.""" + conformance + the e2e SAP-score regression. + + Per S0380.110 the §5 lighting cascade reads per-rooflight glazing + via `epc.sap_roof_windows` (Appendix L §L2a per-window g_L) rather + than a single aggregate area + bulk g_L. Propagate the fixture's + lodged rooflights so `_daylight_factor_from_cert` sees Triple / + Double / Single distinctions for the cohort (e.g. 000516 lodges a + Double-glazed rooflight at 1.18 m² × g_L=0.80 × FF=0.70 × Z_L=1.0). + """ def _window(area: float) -> SapWindow: side = area ** 0.5 return SapWindow( @@ -610,10 +618,12 @@ def _build_section_5_epc(fixture: ModuleType) -> EpcPropertyData: ], has_fixed_air_conditioning=False, ) + fixture_epc = fixture.build_epc() return make_minimal_sap10_epc( total_floor_area_m2=fixture.LINE_4_TFA_M2, low_energy_fixed_lighting_bulbs_count=fixture.SECTION_5_BULB_COUNT_LEL, sap_windows=[_window(a) for a in fixture.SECTION_5_WINDOW_AREAS_M2], + sap_roof_windows=list(fixture_epc.sap_roof_windows) if fixture_epc.sap_roof_windows else None, sap_heating=sap_heating, )