From 6efbd4649dc09f36145d53e83802b35f514f6ea2 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:13:43 +0000 Subject: [PATCH 1/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20ope?= =?UTF-8?q?n=5Fchimneys=5Fcount=20to=200=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/tests/test_from_rdsap_schema.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index a2463eae..3ba24124 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -431,6 +431,15 @@ class TestFromRdSapSchema21_0_1: assert result.wet_rooms_count == 0 + def test_omitted_open_chimneys_count_defaults_to_zero_not_none(self) -> None: + data = load("21_0_1.json") + data.pop("open_chimneys_count", None) + schema = from_dict(RdSapSchema21_0_1, data) + + result = EpcPropertyDataMapper.from_rdsap_schema_21_0_1(schema) + + assert result.open_chimneys_count == 0 + def test_uprn(self, result: EpcPropertyData) -> None: assert result.uprn == 12457 From a01a940df2b827bc09695648e00308f5bb286d1d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:14:36 +0000 Subject: [PATCH 2/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20ope?= =?UTF-8?q?n=5Fchimneys=5Fcount=20to=200=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 10ec411d..75736ea2 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -2172,7 +2172,7 @@ class EpcPropertyDataMapper: # to 0 like every other mapper (RdSAP "not lodged" → calc minimum 1). wet_rooms_count=schema.wet_rooms_count or 0, extensions_count=schema.extensions_count, - open_chimneys_count=schema.open_chimneys_count, + open_chimneys_count=schema.open_chimneys_count or 0, insulated_door_count=schema.insulated_door_count, draughtproofed_door_count=schema.draughtproofed_door_count, # Mechanical ventilation PCDB plumbing — feeds the §5 Table 4f From d36fa2b5cd1f0c88e0dab3773c0943e5afd77f48 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:15:37 +0000 Subject: [PATCH 3/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20cfl?= =?UTF-8?q?=5Ffixed=5Flighting=5Fbulbs=5Fcount=20to=200=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/tests/test_from_rdsap_schema.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index 3ba24124..bada4abc 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -440,6 +440,15 @@ class TestFromRdSapSchema21_0_1: assert result.open_chimneys_count == 0 + def test_omitted_cfl_fixed_lighting_bulbs_count_defaults_to_zero_not_none(self) -> None: + data = load("21_0_1.json") + data.pop("cfl_fixed_lighting_bulbs_count", None) + schema = from_dict(RdSapSchema21_0_1, data) + + result = EpcPropertyDataMapper.from_rdsap_schema_21_0_1(schema) + + assert result.cfl_fixed_lighting_bulbs_count == 0 + def test_uprn(self, result: EpcPropertyData) -> None: assert result.uprn == 12457 From 71269637efd9d2d85e3d2f9afa7070d1e662fdd6 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:16:29 +0000 Subject: [PATCH 4/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20cfl?= =?UTF-8?q?=5Ffixed=5Flighting=5Fbulbs=5Fcount=20to=200=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 75736ea2..4379f8b3 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -2189,7 +2189,7 @@ class EpcPropertyDataMapper: mechanical_vent_duct_type=schema.mechanical_vent_duct_type, # Lighting led_fixed_lighting_bulbs_count=schema.led_fixed_lighting_bulbs_count, - cfl_fixed_lighting_bulbs_count=schema.cfl_fixed_lighting_bulbs_count, + cfl_fixed_lighting_bulbs_count=schema.cfl_fixed_lighting_bulbs_count or 0, incandescent_fixed_lighting_bulbs_count=schema.incandescent_fixed_lighting_bulbs_count, # Energy elements roofs=EpcPropertyDataMapper._map_energy_elements(schema.roofs), From e906bbecf8983532898cfd510eb9a64b1a2d8169 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:17:19 +0000 Subject: [PATCH 5/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20led?= =?UTF-8?q?=5Ffixed=5Flighting=5Fbulbs=5Fcount=20to=200=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/tests/test_from_rdsap_schema.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/datatypes/epc/domain/tests/test_from_rdsap_schema.py b/datatypes/epc/domain/tests/test_from_rdsap_schema.py index bada4abc..440325ce 100644 --- a/datatypes/epc/domain/tests/test_from_rdsap_schema.py +++ b/datatypes/epc/domain/tests/test_from_rdsap_schema.py @@ -449,6 +449,15 @@ class TestFromRdSapSchema21_0_1: assert result.cfl_fixed_lighting_bulbs_count == 0 + def test_omitted_led_fixed_lighting_bulbs_count_defaults_to_zero_not_none(self) -> None: + data = load("21_0_1.json") + data.pop("led_fixed_lighting_bulbs_count", None) + schema = from_dict(RdSapSchema21_0_1, data) + + result = EpcPropertyDataMapper.from_rdsap_schema_21_0_1(schema) + + assert result.led_fixed_lighting_bulbs_count == 0 + def test_uprn(self, result: EpcPropertyData) -> None: assert result.uprn == 12457 From 40a079e46419aa151423d28230c16a3f6baa330b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:19:10 +0000 Subject: [PATCH 6/7] =?UTF-8?q?21.0.1=20mapper=20coalesces=20omitted=20led?= =?UTF-8?q?=5Ffixed=5Flighting=5Fbulbs=5Fcount=20to=200=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- datatypes/epc/domain/mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datatypes/epc/domain/mapper.py b/datatypes/epc/domain/mapper.py index 4379f8b3..26704922 100644 --- a/datatypes/epc/domain/mapper.py +++ b/datatypes/epc/domain/mapper.py @@ -2188,7 +2188,7 @@ class EpcPropertyDataMapper: ), mechanical_vent_duct_type=schema.mechanical_vent_duct_type, # Lighting - led_fixed_lighting_bulbs_count=schema.led_fixed_lighting_bulbs_count, + led_fixed_lighting_bulbs_count=schema.led_fixed_lighting_bulbs_count or 0, cfl_fixed_lighting_bulbs_count=schema.cfl_fixed_lighting_bulbs_count or 0, incandescent_fixed_lighting_bulbs_count=schema.incandescent_fixed_lighting_bulbs_count, # Energy elements From 10c975b1ae34777ba9c3748395ca30acbd9b0530 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 24 Jun 2026 13:31:02 +0000 Subject: [PATCH 7/7] =?UTF-8?q?Fix=20test=20asserting=20None=20for=20cfl?= =?UTF-8?q?=5Ffixed=5Flighting=5Fbulbs=5Fcount=20on=2021.0.1=20cert=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- tests/harness/test_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/harness/test_report.py b/tests/harness/test_report.py index 6b8bc9a4..304f8940 100644 --- a/tests/harness/test_report.py +++ b/tests/harness/test_report.py @@ -179,7 +179,7 @@ def test_few_measure_cert_surfaces_only_its_fired_measures_triggers() -> None: } assert triggers["low_energy_lighting"].triggers == { "incandescent_fixed_lighting_bulbs_count": 0, - "cfl_fixed_lighting_bulbs_count": None, + "cfl_fixed_lighting_bulbs_count": 0, "low_energy_fixed_lighting_bulbs_count": 7, }