diff --git a/model_data/epc_attributes/RoofAttributes.py b/model_data/epc_attributes/RoofAttributes.py index ec014357..542978a4 100644 --- a/model_data/epc_attributes/RoofAttributes.py +++ b/model_data/epc_attributes/RoofAttributes.py @@ -8,6 +8,10 @@ class RoofAttributes(BaseUtility): ROOF_TYPES = ['pitched', 'roof room', 'loft', 'flat', 'thatched', 'at rafters', 'assumed'] DWELLING_ABOVE = ["another dwelling above", "other premises above"] + WELSH_TEXT = { + "ar oleddf, dim inswleiddio": "pitched, no insulation", + } + def __init__(self, description: str): """ :param description: Description of the roof. @@ -15,7 +19,12 @@ class RoofAttributes(BaseUtility): self.description: str = description.lower() self.nodata = not description or description in self.DATA_ANOMALY_MATCHES - + + translation = self.WELSH_TEXT.get(self.description) + if translation: + self.nodata = False + self.description = translation + if not self.nodata and not any( rt in self.description for rt in self.ROOF_TYPES + self.DWELLING_ABOVE + ["average thermal transmittance"] ): diff --git a/model_data/tests/test_data/test_roof_attributes_cases.py b/model_data/tests/test_data/test_roof_attributes_cases.py index e2334c09..fabace6b 100644 --- a/model_data/tests/test_data/test_roof_attributes_cases.py +++ b/model_data/tests/test_data/test_roof_attributes_cases.py @@ -344,5 +344,10 @@ clean_roof_test_cases = [ {'original_description': 'Thatched, with additional insulation', 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': True, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True, - 'insulation_thickness': 'above average'} + 'insulation_thickness': 'above average'}, + {'original_description': 'Ar oleddf, dim inswleiddio', 'thermal_transmittance': None, + 'thermal_transmittance_unit': None, + 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False, + 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True, + 'insulation_thickness': 'none'} ]