From 986174b95d3aef7ad77650dc995df00435470872 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 30 Sep 2024 12:57:42 +0100 Subject: [PATCH] handling new EPC description --- etl/customers/aiha/epc_surveyor_list.py | 31 ++++++++++++++++--- .../epc_attributes/MainheatAttributes.py | 1 + .../test_mainheat_attributes_cases.py | 17 +++++++++- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/etl/customers/aiha/epc_surveyor_list.py b/etl/customers/aiha/epc_surveyor_list.py index b85139ae..cec72928 100644 --- a/etl/customers/aiha/epc_surveyor_list.py +++ b/etl/customers/aiha/epc_surveyor_list.py @@ -34,8 +34,29 @@ def main(): epc_collected_data = pd.DataFrame(epc_collected_data) - for x in epc_collected_data: - keys = x.keys() - # Check for None keys - if any(k is None for k in keys): - frew + epc_collected_data = epc_data[["uprn", "address", "address1", "postcode"]].merge( + epc_collected_data, left_on="uprn", right_on="extracted_uprn" + ) + + elmhurst_surveys = epc_collected_data[ + epc_collected_data["Accreditation scheme"].isin( + ["NHER", "Stroma Certification Ltd", "Elmhurst Energy Systems Ltd"] + ) + ] + + quidos_surveys = epc_collected_data[ + epc_collected_data["Accreditation scheme"].isin( + ["Quidos Limited"] + ) + ] + + ecmk_surveys = epc_collected_data[ + epc_collected_data["Accreditation scheme"].isin( + ["ECMK"] + ) + ] + + # Store the data: + elmhurst_surveys.to_csv("/Users/khalimconn-kowlessar/Documents/hestia/Customers/AIHA/Elmhurst Surveys.csv") + quidos_surveys.to_csv("/Users/khalimconn-kowlessar/Documents/hestia/Customers/AIHA/Quidos Surveys.csv") + ecmk_surveys.to_csv("/Users/khalimconn-kowlessar/Documents/hestia/Customers/AIHA/ECMK Surveys.csv") diff --git a/etl/epc_clean/epc_attributes/MainheatAttributes.py b/etl/epc_clean/epc_attributes/MainheatAttributes.py index 52dc1bc7..051db8c2 100644 --- a/etl/epc_clean/epc_attributes/MainheatAttributes.py +++ b/etl/epc_clean/epc_attributes/MainheatAttributes.py @@ -85,6 +85,7 @@ class MainHeatAttributes(Definitions): "hot-water-only systems, gas": "no system present, electric heaters assumed", "gas-fired heat pumps, electric": "air source heat pump, electric", "radiator heating, heat from boilers - gas": "boiler and radiators, mains gas", + "heat pump, warm air, mains gas": "air source heat pump, warm air, mains gas", } edge_case_result = {} diff --git a/etl/epc_clean/tests/test_data/test_mainheat_attributes_cases.py b/etl/epc_clean/tests/test_data/test_mainheat_attributes_cases.py index 82675a74..51fc3416 100644 --- a/etl/epc_clean/tests/test_data/test_mainheat_attributes_cases.py +++ b/etl/epc_clean/tests/test_data/test_mainheat_attributes_cases.py @@ -1692,6 +1692,21 @@ mainheat_cases = [ 'has_dual_fuel_mineral_and_wood': False, 'has_smokeless_fuel': False, 'has_lpg': False, 'has_b30k': False, 'has_assumed': True, 'has_electricaire': False, 'has_assumed_for_most_rooms': False, 'has_underfloor_heating': False - } + }, + { + "original_description": "heat pump, warm air, mains gas", # This gets remapped to air source 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': True, 'has_room_heaters': False, 'has_electric_storage_heaters': False, + 'has_warm_air': True, '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': True, 'has_wood_logs': 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_b30k': False, + 'has_assumed': False, 'has_electricaire': False, 'has_assumed_for_most_rooms': False, + 'has_underfloor_heating': False + } ]