From e7bd4be0b05d583a0e271d4281dc4ae7ddbe3c2d Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 7 Sep 2023 16:03:41 +0300 Subject: [PATCH] Debugging lighting and heating --- model_data/epc_attributes/LightingAttributes.py | 3 +++ model_data/epc_attributes/MainheatAttributes.py | 8 ++++++++ .../tests/test_data/test_lighting_attributes_cases.py | 1 + 3 files changed, 12 insertions(+) diff --git a/model_data/epc_attributes/LightingAttributes.py b/model_data/epc_attributes/LightingAttributes.py index 05e2edd8..e0147202 100644 --- a/model_data/epc_attributes/LightingAttributes.py +++ b/model_data/epc_attributes/LightingAttributes.py @@ -30,6 +30,9 @@ class LightingAttributes: if "all fixed outlets" in description: return {"low_energy_proportion": 1} + if "excellent lighting efficiency" in description: + return {"low_energy_proportion": 1} + if ('good lighting efficiency' in description) or ('excellent lighting efficiency' in description) or \ ('below average lighting efficiency' in description): average = [ diff --git a/model_data/epc_attributes/MainheatAttributes.py b/model_data/epc_attributes/MainheatAttributes.py index 70e78ee0..1cebc257 100644 --- a/model_data/epc_attributes/MainheatAttributes.py +++ b/model_data/epc_attributes/MainheatAttributes.py @@ -24,6 +24,10 @@ class MainHeatAttributes(Definitions): "bwyler a rheiddiaduron, nwy prif gyflenwad": "boiler and radiators, mains gas", } + REMAP = { + "electric ceiling": "electric ceiling heating" + } + def __init__(self, description: str): self.description = switch_chars(description.lower()) @@ -37,6 +41,10 @@ class MainHeatAttributes(Definitions): self.nodata = False self.description = translation + remap = self.REMAP.get(self.description) + if remap: + self.description = remap + if not description or not any( rt in self.description for rt in self.HEAT_SYSTEMS + self.FUEL_TYPES + self.DISTRIBUTION_SYSTEMS + self.OTHERS diff --git a/model_data/tests/test_data/test_lighting_attributes_cases.py b/model_data/tests/test_data/test_lighting_attributes_cases.py index d8e35ee0..461b96a5 100644 --- a/model_data/tests/test_data/test_lighting_attributes_cases.py +++ b/model_data/tests/test_data/test_lighting_attributes_cases.py @@ -33,4 +33,5 @@ test_cases = [ {'original_description': 'Goleuadau ynni-isel mewn 60% oGÇÖr mannau gosod', 'low_energy_proportion': 0.6}, {'original_description': 'Goleuadau ynni-isel ym mhob un oGÇÖr mannau gosod', 'low_energy_proportion': 1}, {'original_description': 'Dim goleuadau ynni-isel', 'low_energy_proportion': 0}, + {'original_description': 'Excellent lighting efficiency', 'low_energy_proportion': 1}, ]