From 4d421af78b69e99748d958504ccd557507db0ee4 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 11 Sep 2023 18:36:41 +0100 Subject: [PATCH] multiple translations --- model_data/app.py | 3 - model_data/epc_attributes/FloorAttributes.py | 2 +- .../epc_attributes/HotWaterAttributes.py | 1 + .../epc_attributes/MainFuelAttributes.py | 3 + .../epc_attributes/MainheatAttributes.py | 7 ++- .../MainheatControlAttributes.py | 3 +- model_data/epc_attributes/RoofAttributes.py | 4 +- .../generate_rdsap_change.py | 2 +- .../test_main_fuel_attributes_cases.py | 6 ++ .../test_mainheat_attributes_cases.py | 60 +++++++++++++++++++ .../test_mainheat_control_attributes_cases.py | 3 + .../test_data/test_roof_attributes_cases.py | 4 ++ 12 files changed, 90 insertions(+), 8 deletions(-) diff --git a/model_data/app.py b/model_data/app.py index 5106a0e4..45c4a4f0 100644 --- a/model_data/app.py +++ b/model_data/app.py @@ -32,9 +32,6 @@ def app(): :return: """ - # Begin by setting up an empty cleaner - cleaner = EpcClean([]) - epc_directories = [entry for entry in EPC_DIRECTORY.iterdir() if entry.is_dir()] for directory in tqdm(epc_directories): data = pd.read_csv(directory / "certificates.csv", low_memory=False) diff --git a/model_data/epc_attributes/FloorAttributes.py b/model_data/epc_attributes/FloorAttributes.py index 2426dea8..629581eb 100644 --- a/model_data/epc_attributes/FloorAttributes.py +++ b/model_data/epc_attributes/FloorAttributes.py @@ -58,7 +58,7 @@ class FloorAttributes(Definitions): # Step 2: Generalized translation with placeholder if uvalue_match: uvalue = uvalue_match.group(1) - self.description = f"average thermal transmittance {uvalue} W/m-¦K" + self.description = f"average thermal transmittance {uvalue} w/m-¦K" else: translation = self.WELSH_TEXT.get(self.description) diff --git a/model_data/epc_attributes/HotWaterAttributes.py b/model_data/epc_attributes/HotWaterAttributes.py index 2a981674..cd0f373b 100644 --- a/model_data/epc_attributes/HotWaterAttributes.py +++ b/model_data/epc_attributes/HotWaterAttributes.py @@ -18,6 +18,7 @@ class HotWaterAttributes(Definitions): 'heat pump', # A general category for heat pumps, regardless of the energy source 'solid fuel boiler', # burns solid materials to generate heat for water heating and/or space heating 'solid fuel range cooker', + 'room heaters', # Generic/unspecified category ] # SYSTEM_TYPES refer to the larger system within which the heater operates. diff --git a/model_data/epc_attributes/MainFuelAttributes.py b/model_data/epc_attributes/MainFuelAttributes.py index 83a34291..4f4f8079 100644 --- a/model_data/epc_attributes/MainFuelAttributes.py +++ b/model_data/epc_attributes/MainFuelAttributes.py @@ -31,6 +31,9 @@ class MainFuelAttributes(Definitions): 'coal', 'b30d', 'bioethanol', + 'solid fuel', + 'manufactured smokeless fuel', + "lng" # Liquified natural gas ] COMPLEX_FUEL_KEYWORDS = [ diff --git a/model_data/epc_attributes/MainheatAttributes.py b/model_data/epc_attributes/MainheatAttributes.py index dbed54fb..f37e3baf 100644 --- a/model_data/epc_attributes/MainheatAttributes.py +++ b/model_data/epc_attributes/MainheatAttributes.py @@ -44,7 +44,12 @@ class MainHeatAttributes(Definitions): "gwresogyddion ystafell, glo carreg": "room heaters, coal", "pwmp gwres sygçön tarddu yn yr awyr, rheiddiaduron, trydan": "air source heat pump, radiators, electric", "gwresogyddion ystafell, nwy prif gyflenwad": "room heaters, mains gas", - "bwyler a rheiddiaduron, dau danwydd mwynau a choed": "boiler and radiators, dual fuel mineral and wood" + "bwyler a rheiddiaduron, dau danwydd mwynau a choed": "boiler and radiators, dual fuel mineral and wood", + "pwmp gwres sygçön tarddu yn y ddaear, dan y llawr, trydan": "ground source heat pump, underfloor, electric", + "gwresogi dan y llawr trydan": "electric underfloor heating", + # This descripton is slightly unclear & was repeated + "st+¦r wresogyddion trydan, st+¦r wresogyddion trydan": "room heaters, electric", + "pwmp gwres sygçön tarddu yn y ddaear, rheiddiaduron, trydan": "ground source heat pump, radiators, electric", } REMAP = { diff --git a/model_data/epc_attributes/MainheatControlAttributes.py b/model_data/epc_attributes/MainheatControlAttributes.py index 5448e01d..b1519a24 100644 --- a/model_data/epc_attributes/MainheatControlAttributes.py +++ b/model_data/epc_attributes/MainheatControlAttributes.py @@ -99,7 +99,8 @@ class MainheatControlAttributes(Definitions): "room thermostat " "only", "dim": "none", - "dim rheolaeth thermostatig ar dymheredd yr ystafell": "no thermostatic control of room temperature" + "dim rheolaeth thermostatig ar dymheredd yr ystafell": "no thermostatic control of room temperature", + "thermostatau ar y cyfarpar": "appliance thermostats", } def __init__(self, description: str): diff --git a/model_data/epc_attributes/RoofAttributes.py b/model_data/epc_attributes/RoofAttributes.py index 1b0d640a..14f08f88 100644 --- a/model_data/epc_attributes/RoofAttributes.py +++ b/model_data/epc_attributes/RoofAttributes.py @@ -28,7 +28,9 @@ class RoofAttributes(Definitions): "ystafell(oedd) to, wedigçöi hinswleiddio (rhagdybiaeth)": "roof room(s), insulated (assumed)", "ystafell(oedd) to, inswleiddio cyfyngedig (rhagdybiaeth)": "roof room(s), limited insulation (assumed)", "ystafell(oedd) to, inswleiddio cyfyngedig": "roof room(s), limited insulation", - "ystafell(oedd) to, nenfwd wedigçöi inswleiddio": "roof room(s), ceiling insulated" + "ystafell(oedd) to, nenfwd wedigçöi inswleiddio": "roof room(s), ceiling insulated", + "ystafell(oedd) to, dim inswleiddio (rhagdybiaeth)": "roof room(s), no insulation (assumed)", + "ystafell(oedd) to, dim inswleiddio": "roof room(s), no insulation", } def __init__(self, description: str): diff --git a/model_data/simulation_system/generate_rdsap_change.py b/model_data/simulation_system/generate_rdsap_change.py index ec895408..9aa16438 100644 --- a/model_data/simulation_system/generate_rdsap_change.py +++ b/model_data/simulation_system/generate_rdsap_change.py @@ -35,7 +35,7 @@ def app(): # TODO [x] : If SAP hasn't changed, we don't include the record # TODO [x]: If SAP gets worse, it genuinely looks like in the vast majority of cases that the building looks # worse in the newer epc, so we can switch the orders - # TODO [] : Have a look at temporal features + # TODO [x] : Have a look at temporal features # TODO [x] : Floor area will impact the EPC so instead of averaging, we should have a starting and ending value. # TODO [x]: Same as floor area for floor height # TODO []: If fundamental building fabric changes, we should proabably discard the record diff --git a/model_data/tests/test_data/test_main_fuel_attributes_cases.py b/model_data/tests/test_data/test_main_fuel_attributes_cases.py index d28e5f75..72ec9bfb 100644 --- a/model_data/tests/test_data/test_main_fuel_attributes_cases.py +++ b/model_data/tests/test_data/test_main_fuel_attributes_cases.py @@ -73,5 +73,11 @@ mainfuel_cases = [ 'fuel_type': 'b30d', 'tariff_type': None, 'is_community': True, 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, + {'original_description': 'Solid fuel: manufactured smokeless fuel', 'fuel_type': 'manufactured smokeless fuel', + 'tariff_type': None, + 'is_community': False, + 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, + {'original_description': "LNG", 'fuel_type': 'lng', 'tariff_type': None, 'is_community': False, + 'no_individual_heating_or_community_network': False, 'complex_fuel_type': 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 6a5116e8..41de6dc1 100644 --- a/model_data/tests/test_data/test_mainheat_attributes_cases.py +++ b/model_data/tests/test_data/test_mainheat_attributes_cases.py @@ -1470,4 +1470,64 @@ 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': 'Pwmp gwres syGÇÖn tarddu yn y ddaear, dan y llawr, trydan', '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': True, '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': True, "has_electric_heat_pumps": False, + "has_micro-cogeneration": False}, + {'original_description': 'Gwresogi dan y llawr trydan', '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': True, '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': True, + "has_electric_heat_pumps": False, + "has_micro-cogeneration": False}, + {'original_description': 'Room heaters, electric', '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': True, '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': 'St+¦r wresogyddion trydan, St+¦r wresogyddion trydan', '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': True, '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': 'Pwmp gwres syGÇÖn tarddu yn y ddaear, 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': 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': True, '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}, ] 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 a13826d0..b5197a84 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 @@ -201,4 +201,7 @@ mainheat_control_cases = [ {'original_description': 'Dim rheolaeth thermostatig ar dymheredd yr ystafell', 'thermostatic_control': None, 'charging_system': None, 'switch_system': None, 'no_control': 'no thermostatic control', 'dhw_control': None, 'community_heating': None, 'multiple_room_thermostats': False, 'auxiliary_systems': None, 'trvs': None}, + {'original_description': 'Thermostatau ar y cyfarpar', 'thermostatic_control': 'appliance thermostats', + '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 647d4fe5..8c4415fe 100644 --- a/model_data/tests/test_data/test_roof_attributes_cases.py +++ b/model_data/tests/test_data/test_roof_attributes_cases.py @@ -390,4 +390,8 @@ clean_roof_test_cases = [ 'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, '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': 'average'}, + {'original_description': 'Ystafell(oedd) to, dim inswleiddio (rhagdybiaeth)', 'thermal_transmittance': None, + 'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, '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': 'none'}, ]