From 5f1fe923e7aa7f3da13643c84a61d984ae5363fe Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sat, 1 Jul 2023 17:44:53 +0100 Subject: [PATCH] Added another case for main fuel --- model_data/app.py | 2 +- model_data/epc_attributes/MainFuelAttributes.py | 3 ++- .../tests/test_data/test_main_fuel_attributes_cases.py | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/model_data/app.py b/model_data/app.py index 42ec1c9b..f8b4353e 100644 --- a/model_data/app.py +++ b/model_data/app.py @@ -97,7 +97,7 @@ def handler(): ) ) - z = pd.DataFrame([x for x in data if x["hotwater-description"] == "From second main heating system"]) + z = pd.DataFrame([x for x in data if x["main-fuel"] == "To be used only when there is no heating/hot-water system"]) # Incorporate input data into cleaning cleaner = EpcClean(data + [p.data for p in input_properties]) diff --git a/model_data/epc_attributes/MainFuelAttributes.py b/model_data/epc_attributes/MainFuelAttributes.py index 96749944..91adb3de 100644 --- a/model_data/epc_attributes/MainFuelAttributes.py +++ b/model_data/epc_attributes/MainFuelAttributes.py @@ -35,7 +35,8 @@ class MainFuelAttributes(BaseUtility): UNKNOWN_FUEL = "unknown" NO_INDIVIDUAL_HEATING_OR_COMMUNITY_NETWORK = [ - 'to be used only when there is no heatinghotwater system or data is from a community network' + 'to be used only when there is no heatinghotwater system or data is from a community network', + 'to be used only when there is no heatinghotwater system' ] def __init__(self, description: str): 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 219dcc03..27b8974e 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 @@ -52,5 +52,9 @@ mainfuel_cases = [ 'fuel_type': 'waste combustion', 'tariff_type': None, 'is_community': False, 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, {'original_description': 'wood logs', 'fuel_type': 'wood logs', 'tariff_type': None, 'is_community': False, - 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None} + 'no_individual_heating_or_community_network': False, 'complex_fuel_type': None}, + { + 'original_description': 'To be used only when there is no heating/hot-water system', + 'fuel_type': 'unknown', 'tariff_type': None, 'is_community': False, + 'no_individual_heating_or_community_network': True, 'complex_fuel_type': None} ]