From 0b75b7214f06a4bec8e03a4a0a66c36bdda08af6 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 7 Sep 2023 15:21:12 +0300 Subject: [PATCH] Debugging EpcCleaner and adding additional cases --- model_data/app.py | 5 ++++- model_data/epc_attributes/HotWaterAttributes.py | 3 ++- model_data/epc_attributes/MainFuelAttributes.py | 2 ++ .../tests/test_data/test_hot_water_attributes_cases.py | 4 ++++ .../tests/test_data/test_main_fuel_attributes_cases.py | 8 ++++++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/model_data/app.py b/model_data/app.py index 8d167993..97f05531 100644 --- a/model_data/app.py +++ b/model_data/app.py @@ -80,7 +80,7 @@ def app(): # pickle.dump(address_meta, f) epc_directories = [entry for entry in EPC_DIRECTORY.iterdir() if entry.is_dir()] - for directory in epc_directories: + for directory in tqdm(epc_directories): data = pd.read_csv(directory / "certificates.csv", low_memory=False) # Rename the columns to the same format as the api returns data.columns = [c.replace("_", "-").lower() for c in data.columns] @@ -108,3 +108,6 @@ def app(): uvalue_estimates = UvalueEstimations(data=data) uvalue_estimates.get_estimates(cleaner=cleaner) # TODO: Store these to a s3 + uvalue_estimates.walls + uvalue_estimates.floors + uvalue_estimates.roofs diff --git a/model_data/epc_attributes/HotWaterAttributes.py b/model_data/epc_attributes/HotWaterAttributes.py index 2535032b..92ad8818 100644 --- a/model_data/epc_attributes/HotWaterAttributes.py +++ b/model_data/epc_attributes/HotWaterAttributes.py @@ -16,7 +16,8 @@ class HotWaterAttributes(Definitions): 'electric instantaneous', # Similar to gas instantaneous, but uses electricity as its energy source 'gas multipoint', # A gas water heater that can supply hot water to multiple points of use at once '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 boiler', # burns solid materials to generate heat for water heating and/or space heating + 'solid fuel range cooker', ] # 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 363d0ec3..fe5a498c 100644 --- a/model_data/epc_attributes/MainFuelAttributes.py +++ b/model_data/epc_attributes/MainFuelAttributes.py @@ -28,6 +28,8 @@ class MainFuelAttributes(Definitions): 'wood pellets', 'b30k', 'dual fuel appliance mineral and wood', + 'coal', + 'b30d', ] COMPLEX_FUEL_KEYWORDS = [ 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 b420a74b..405bc339 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 @@ -131,6 +131,10 @@ hotwater_cases = [ 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Oil boiler/circulator', 'heater_type': None, 'system_type': 'oil boiler', + 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, + 'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None, + 'assumed': False, "appliance": None}, + {'original_description': 'Solid fuel range cooker', 'heater_type': 'solid fuel range cooker', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None, 'assumed': False, "appliance": None} 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 49502e88..d28e5f75 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 @@ -65,5 +65,13 @@ mainfuel_cases = [ 'fuel_type': 'dual fuel appliance mineral and wood', 'tariff_type': None, 'is_community': False, 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, + {'original_description': 'coal (community)', + 'fuel_type': 'coal', + 'tariff_type': None, 'is_community': True, + 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, + {'original_description': 'B30D (community)', + 'fuel_type': 'b30d', + 'tariff_type': None, 'is_community': True, + 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, ]