From e17983da1a29e2f5a4dd2bdba331ca3855ec5842 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 8 Sep 2023 13:08:54 +0300 Subject: [PATCH] more welsh translations --- model_data/epc_attributes/FloorAttributes.py | 6 ++- .../epc_attributes/HotWaterAttributes.py | 3 +- .../epc_attributes/MainheatAttributes.py | 3 ++ .../MainheatControlAttributes.py | 1 + model_data/epc_attributes/RoofAttributes.py | 10 +++- model_data/epc_attributes/WindowAttributes.py | 2 + .../test_data/test_floor_attributes_cases.py | 5 +- .../test_hot_water_attributes_cases.py | 4 ++ .../test_mainheat_attributes_cases.py | 49 +++++++++++++++++++ .../test_mainheat_control_attributes_cases.py | 4 ++ .../test_data/test_roof_attributes_cases.py | 10 +++- .../test_data/test_window_attributes_cases.py | 6 ++- 12 files changed, 97 insertions(+), 6 deletions(-) diff --git a/model_data/epc_attributes/FloorAttributes.py b/model_data/epc_attributes/FloorAttributes.py index 374753ac..3605f0aa 100644 --- a/model_data/epc_attributes/FloorAttributes.py +++ b/model_data/epc_attributes/FloorAttributes.py @@ -16,8 +16,12 @@ class FloorAttributes(Definitions): WELSH_TEXT = { "(anheddiad arall islaw)": "(another dwelling below)", "solet, dim inswleiddio (rhagdybiaeth)": "solid, no insulation (assumed)", + "solet, dim inswleiddio": "solid, no insulation)", "crog, dim inswleiddio (rhagdybiaeth)": "suspended, no insulation (assumed)", - "(eiddo arall islaw)": "(other premises below)" + "crog, dim inswleiddio": "suspended, no insulation", + "(eiddo arall islaw)": "(other premises below)", + "solet, inswleiddio cyfyngedig (rhagdybiaeth)": "solid, limited insulation (assumed)", + "solet, inswleiddio cyfyngedig": "solid, limited insulation" } def __init__(self, description: str): diff --git a/model_data/epc_attributes/HotWaterAttributes.py b/model_data/epc_attributes/HotWaterAttributes.py index 603b9fff..7f6b78df 100644 --- a/model_data/epc_attributes/HotWaterAttributes.py +++ b/model_data/epc_attributes/HotWaterAttributes.py @@ -99,7 +99,8 @@ class HotWaterAttributes(Definitions): "bwyler/cylchredydd nwy": "gas boiler/circulator", "ogçör brif system, dim thermostat ar y silindr": "from main system, no cylinder thermostat", "twymwr tanddwr, an-frig": "electric immersion, off-peak", - "ogçör brif system, gydag ynnigçör haul": "from main system, plus solar" + "ogçör brif system, gydag ynnigçör haul": "from main system, plus solar", + "twymwr tanddwr, tarriff safonol": "electric immersion, standard tariff" } def __init__(self, description: str): diff --git a/model_data/epc_attributes/MainheatAttributes.py b/model_data/epc_attributes/MainheatAttributes.py index dfc3e218..3f938730 100644 --- a/model_data/epc_attributes/MainheatAttributes.py +++ b/model_data/epc_attributes/MainheatAttributes.py @@ -15,6 +15,7 @@ class MainHeatAttributes(Definitions): "micro-cogeneration", "solar assisted heat pump", "exhaust source heat pump", + "community heat pump", ] FUEL_TYPES = ["electric", "mains gas", "wood logs", "LPG", "coal", "oil", "wood pellets", "anthracite", "dual fuel mineral and wood", "smokeless fuel", "lpg"] @@ -27,6 +28,8 @@ class MainHeatAttributes(Definitions): "st+¦r wresogyddion trydan": "electric storage heaters", "bwyler a rheiddiaduron, olew": "boiler and radiators, oil", "heat pumptrydan": "electric heat pump", + "bwyler a rheiddiaduron, trydan": "boiler and radiators, electric", + "bwyler a gwres dan y llawr, olew": "boiler and underfloor heating, oil" } REMAP = { diff --git a/model_data/epc_attributes/MainheatControlAttributes.py b/model_data/epc_attributes/MainheatControlAttributes.py index 6d47d3a8..0f43fbf8 100644 --- a/model_data/epc_attributes/MainheatControlAttributes.py +++ b/model_data/epc_attributes/MainheatControlAttributes.py @@ -77,6 +77,7 @@ class MainheatControlAttributes(Definitions): "rhaglennydd, dim thermostat ystafell": "programmer, no room thermostat", "rhaglennydd a thermostat ystafell": "programmer and room thermostat", "rheoligçör t+ól +ó llaw": "manual charge control", + "rheolaeth amser a rheolaeth parthau tymheredd": "time and temperature zone control", } def __init__(self, description: str): diff --git a/model_data/epc_attributes/RoofAttributes.py b/model_data/epc_attributes/RoofAttributes.py index c86b52f2..bbaaac94 100644 --- a/model_data/epc_attributes/RoofAttributes.py +++ b/model_data/epc_attributes/RoofAttributes.py @@ -13,6 +13,10 @@ class RoofAttributes(Definitions): "ar oleddf, dim inswleiddio (rhagdybiaeth)": "pitched, no insulation (assumed)", "(annedd arall uwchben)": "(another dwelling above)", "yn wastad, inswleiddio cyfyngedig (rhagdybiaeth)": "Flat, limited insulation (assumed)", + "yn wastad, inswleiddio cyfyngedig": "Flat, limited insulation", + "ar oleddf, wedigçöi inswleiddio (rhagdybiaeth)": "pitched, insulated (assumed)", + "ar oleddf, wedigçöi inswleiddio": "pitched, insulated", + "(eiddo arall uwchben)": "(another dwelling above)" } def __init__(self, description: str): @@ -40,11 +44,15 @@ class RoofAttributes(Definitions): insulation_thickness_match = re.search(r"(\d+ mm) o inswleiddio yn y llofft", self.description) + uvalue_search = re.search(r"trawsyriannedd thermol cyfartalog (\d+(\.\d+)?)\s*w/m-¦k", self.description) + # Step 2: Generalized translation with placeholder if insulation_thickness_match: insulation_thickness = insulation_thickness_match.group(1) - self.description = self.description.replace(insulation_thickness_match.group(0), "") self.description = f"pitched, {insulation_thickness} loft insulation" + elif uvalue_search: + uvalue = uvalue_search.group(1) + self.description = f"average thermal transmittance {uvalue} W/m-¦K" else: translation = self.WELSH_TEXT.get(self.description) if translation: diff --git a/model_data/epc_attributes/WindowAttributes.py b/model_data/epc_attributes/WindowAttributes.py index bce2b6e3..8d5eb252 100644 --- a/model_data/epc_attributes/WindowAttributes.py +++ b/model_data/epc_attributes/WindowAttributes.py @@ -21,6 +21,8 @@ class WindowAttributes(Definitions): "gwydrau dwbl llawn": "full double glazing", "gwydrau dwbl rhannol": "partial double glazing", "gwydrau dwbl gan mwyaf": "Mostly double glazing", + "gwydrau sengl": "single glazed", + "ffenestri perfformiad uchel": "high performance glazing", } def __init__(self, description: str): diff --git a/model_data/tests/test_data/test_floor_attributes_cases.py b/model_data/tests/test_data/test_floor_attributes_cases.py index 40f13e34..ccf8ee81 100644 --- a/model_data/tests/test_data/test_floor_attributes_cases.py +++ b/model_data/tests/test_data/test_floor_attributes_cases.py @@ -346,5 +346,8 @@ clean_floor_cases = [ 'thermal_transmittance_unit': None, 'is_assumed': False, 'is_to_unheated_space': False, 'is_to_external_air': False, 'is_suspended': False, 'is_solid': False, 'insulation_thickness': None, - "another_property_below": True} + "another_property_below": True}, + {'original_description': 'Solet, inswleiddio cyfyngedig (rhagdybiaeth)', 'thermal_transmittance': None, + 'thermal_transmittance_unit': None, 'is_assumed': True, 'is_to_unheated_space': False, 'is_to_external_air': False, + 'is_suspended': False, 'is_solid': True, 'insulation_thickness': 'below average', "another_property_below": False}, ] diff --git a/model_data/tests/test_data/test_hot_water_attributes_cases.py b/model_data/tests/test_data/test_hot_water_attributes_cases.py index 3335f5a0..3003111a 100644 --- a/model_data/tests/test_data/test_hot_water_attributes_cases.py +++ b/model_data/tests/test_data/test_hot_water_attributes_cases.py @@ -151,4 +151,8 @@ hotwater_cases = [ 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': 'plus solar', 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, + {'original_description': 'Twymwr tanddwr, tarriff safonol', 'heater_type': 'electric immersion', + 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, + 'tariff_type': 'standard tariff', 'extra_features': None, 'chp_systems': None, 'distribution_system': None, + 'no_system_present': None, 'assumed': False, "appliance": None} ] diff --git a/model_data/tests/test_data/test_mainheat_attributes_cases.py b/model_data/tests/test_data/test_mainheat_attributes_cases.py index df3dcdd7..5330084a 100644 --- a/model_data/tests/test_data/test_mainheat_attributes_cases.py +++ b/model_data/tests/test_data/test_mainheat_attributes_cases.py @@ -1154,4 +1154,53 @@ mainheat_cases = [ 'has_electricaire': False, 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False, "has_electric_heat_pumps": False, "has_micro-cogeneration": False}, + {"original_description": "Community heat pump, underfloor, Heat pump", 'has_radiators': False, + 'has_fan_coil_units': False, 'has_pipes_in_screed_above_insulation': False, + 'has_pipes_in_insulated_timber_floor': False, 'has_pipes_in_concrete_slab': False, 'has_boiler': False, + 'has_air_source_heat_pump': False, 'has_room_heaters': False, 'has_electric_storage_heaters': False, + 'has_warm_air': False, 'has_electric_underfloor_heating': False, 'has_electric_ceiling_heating': False, + 'has_community_scheme': False, 'has_ground_source_heat_pump': False, 'has_no_system_present': False, + 'has_portable_electric_heaters': False, 'has_water_source_heat_pump': False, 'has_electric_heat_pump': False, + 'has_micro-cogeneration': False, 'has_solar_assisted_heat_pump': False, 'has_exhaust_source_heat_pump': False, + 'has_community_heat_pump': True, 'has_electric': False, 'has_mains_gas': False, 'has_wood_logs': False, + 'has_LPG': False, 'has_coal': False, 'has_oil': False, 'has_wood_pellets': False, 'has_anthracite': False, + 'has_dual_fuel_mineral_and_wood': False, 'has_smokeless_fuel': False, 'has_lpg': False, 'has_assumed': False, + 'has_electricaire': False, 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': True}, + {'original_description': 'Bwyler a rheiddiaduron, trydan', 'has_radiators': True, 'has_fan_coil_units': False, + 'has_pipes_in_screed_above_insulation': False, 'has_pipes_in_insulated_timber_floor': False, + 'has_pipes_in_concrete_slab': False, 'has_boiler': True, 'has_air_source_heat_pump': False, + 'has_room_heaters': False, 'has_electric_storage_heaters': False, 'has_warm_air': False, + 'has_electric_underfloor_heating': False, 'has_electric_ceiling_heating': False, 'has_community_scheme': False, + 'has_ground_source_heat_pump': False, 'has_no_system_present': False, 'has_portable_electric_heaters': False, + 'has_water_source_heat_pump': False, 'has_electric': True, 'has_mains_gas': False, 'has_wood_logs': False, + 'has_LPG': False, 'has_coal': False, 'has_oil': False, 'has_wood_pellets': False, 'has_anthracite': False, + 'has_dual_fuel_mineral_and_wood': False, 'has_smokeless_fuel': False, 'has_lpg': False, 'has_assumed': False, + 'has_electricaire': False, 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False, + "has_electric_heat_pumps": False, + "has_micro-cogeneration": False}, + {'original_description': 'Boiler and underfloor heating, oil', 'has_radiators': False, 'has_fan_coil_units': False, + 'has_pipes_in_screed_above_insulation': False, 'has_pipes_in_insulated_timber_floor': False, + 'has_pipes_in_concrete_slab': False, 'has_boiler': True, 'has_air_source_heat_pump': False, + 'has_room_heaters': False, 'has_electric_storage_heaters': False, 'has_warm_air': False, + 'has_electric_underfloor_heating': False, 'has_electric_ceiling_heating': False, 'has_community_scheme': False, + 'has_ground_source_heat_pump': False, 'has_no_system_present': False, 'has_portable_electric_heaters': False, + 'has_water_source_heat_pump': False, 'has_electric_heat_pump': False, 'has_micro-cogeneration': False, + 'has_solar_assisted_heat_pump': False, 'has_exhaust_source_heat_pump': False, 'has_community_heat_pump': False, + 'has_electric': False, 'has_mains_gas': False, 'has_wood_logs': False, 'has_LPG': False, 'has_coal': False, + 'has_oil': True, 'has_wood_pellets': False, 'has_anthracite': False, 'has_dual_fuel_mineral_and_wood': False, + 'has_smokeless_fuel': False, 'has_lpg': False, 'has_assumed': False, 'has_electricaire': False, + 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': True}, + {'original_description': 'Bwyler a gwres dan y llawr, olew', 'has_radiators': False, 'has_fan_coil_units': False, + 'has_pipes_in_screed_above_insulation': False, 'has_pipes_in_insulated_timber_floor': False, + 'has_pipes_in_concrete_slab': False, 'has_boiler': True, 'has_air_source_heat_pump': False, + 'has_room_heaters': False, 'has_electric_storage_heaters': False, 'has_warm_air': False, + 'has_electric_underfloor_heating': False, 'has_electric_ceiling_heating': False, 'has_community_scheme': False, + 'has_ground_source_heat_pump': False, 'has_no_system_present': False, 'has_portable_electric_heaters': False, + 'has_water_source_heat_pump': False, 'has_electric_heat_pump': False, 'has_micro-cogeneration': False, + 'has_solar_assisted_heat_pump': False, 'has_exhaust_source_heat_pump': False, 'has_community_heat_pump': False, + 'has_electric': False, 'has_mains_gas': False, 'has_wood_logs': False, 'has_LPG': False, 'has_coal': False, + 'has_oil': True, 'has_wood_pellets': False, 'has_anthracite': False, 'has_dual_fuel_mineral_and_wood': False, + 'has_smokeless_fuel': False, 'has_lpg': False, 'has_assumed': False, 'has_electricaire': False, + 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': True} + ] diff --git a/model_data/tests/test_data/test_mainheat_control_attributes_cases.py b/model_data/tests/test_data/test_mainheat_control_attributes_cases.py index f55d3a83..54b45874 100644 --- a/model_data/tests/test_data/test_mainheat_control_attributes_cases.py +++ b/model_data/tests/test_data/test_mainheat_control_attributes_cases.py @@ -143,4 +143,8 @@ mainheat_control_cases = [ {'original_description': 'RheoliGÇÖr t+ól +ó llaw', 'thermostatic_control': None, 'charging_system': 'manual charge control', 'switch_system': None, 'no_control': None, 'dhw_control': None, 'community_heating': None, 'multiple_room_thermostats': False, 'auxiliary_systems': None, 'trvs': None}, + {'original_description': 'Rheolaeth amser a rheolaeth parthau tymheredd', + 'thermostatic_control': 'time and temperature zone control', 'charging_system': None, 'switch_system': None, + 'no_control': None, 'dhw_control': None, 'community_heating': None, 'multiple_room_thermostats': False, + 'auxiliary_systems': None, 'trvs': None}, ] 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 7957ab63..ab006169 100644 --- a/model_data/tests/test_data/test_roof_attributes_cases.py +++ b/model_data/tests/test_data/test_roof_attributes_cases.py @@ -357,5 +357,13 @@ clean_roof_test_cases = [ {'original_description': 'Yn wastad, inswleiddio cyfyngedig (rhagdybiaeth)', 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True, - 'insulation_thickness': 'below average'} + 'insulation_thickness': 'below average'}, + {'original_description': 'Ar oleddf, wediGÇÖi inswleiddio (rhagdybiaeth)', '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': True, 'has_dwelling_above': False, 'is_valid': True, + 'insulation_thickness': 'average'}, + {'original_description': '(eiddo arall uwchben)', 'thermal_transmittance': None, + 'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, + 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': True, 'is_valid': True, + 'insulation_thickness': None}, ] diff --git a/model_data/tests/test_data/test_window_attributes_cases.py b/model_data/tests/test_data/test_window_attributes_cases.py index 127402c2..c25791f8 100644 --- a/model_data/tests/test_data/test_window_attributes_cases.py +++ b/model_data/tests/test_data/test_window_attributes_cases.py @@ -41,5 +41,9 @@ windows_cases = [ {'original_description': 'Gwydrau dwbl rhannol', 'has_glazing': True, 'glazing_coverage': 'partial', 'glazing_type': 'double', 'no_data': False}, {'original_description': 'Gwydrau dwbl gan mwyaf', 'has_glazing': True, 'glazing_coverage': 'most', - 'glazing_type': 'double', 'no_data': False} + 'glazing_type': 'double', 'no_data': False}, + {'original_description': 'Gwydrau sengl', 'has_glazing': True, 'glazing_coverage': 'full', 'glazing_type': 'single', + 'no_data': False}, + {'original_description': 'Ffenestri perfformiad uchel', 'has_glazing': True, 'glazing_coverage': 'full', + 'glazing_type': 'high performance', 'no_data': False}, ]