From ddb2ce88e7f0069f753c88a9db3b8b575304e108 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 8 Sep 2023 12:43:07 +0300 Subject: [PATCH] handling more cases in EpcClean, 14% of data covered --- .../epc_attributes/MainheatAttributes.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/model_data/epc_attributes/MainheatAttributes.py b/model_data/epc_attributes/MainheatAttributes.py index 75c4c304..dfc3e218 100644 --- a/model_data/epc_attributes/MainheatAttributes.py +++ b/model_data/epc_attributes/MainheatAttributes.py @@ -8,7 +8,7 @@ class MainHeatAttributes(Definitions): "boiler", "air source heat pump", "room heaters", "electric storage heaters", "warm air", "electric underfloor heating", "electric ceiling heating", "community scheme", "ground source heat pump", "no system present", "portable electric heaters", - "water source heat pump", "electric heat pumps", + "water source heat pump", "electric heat pump", # "Micro-cogeneration", also known as micro combined heat and power (micro-CHP), is a technology that # generates heat and electricity simultaneously from the same energy source in residential or commercial # buildings. The main output of micro-CHP systems is heat, with electricity generation as a secondary output. @@ -25,11 +25,13 @@ class MainHeatAttributes(Definitions): WELSH_TEXT = { "bwyler a rheiddiaduron, nwy prif gyflenwad": "boiler and radiators, mains gas", "st+¦r wresogyddion trydan": "electric storage heaters", - "bwyler a rheiddiaduron, olew": "boiler and radiators, oil" + "bwyler a rheiddiaduron, olew": "boiler and radiators, oil", + "heat pumptrydan": "electric heat pump", } REMAP = { - "electric ceiling": "electric ceiling heating" + "electric ceiling": "electric ceiling heating", + "electric heat pumps": "electric heat pump", } def __init__(self, description: str): @@ -45,9 +47,16 @@ class MainHeatAttributes(Definitions): self.nodata = False self.description = translation - remap = self.REMAP.get(self.description) - if remap: - self.description = remap + remapped = [] + for term in self.description.split(", "): + remap = self.REMAP.get(term) + if remap: + remapped.append(remap) + else: + remapped.append(term) + remapped = ", ".join(remapped) + + self.description = remapped if not description or not any( rt in self.description for rt in