From c43349a5777326145107a6406779eadcdc6e9dab Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 7 Mar 2024 16:39:47 +0000 Subject: [PATCH] Added ha41 matching --- .../ha_15_32/ha_analysis_batch_3.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py index 0720a686..4cf447aa 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -174,7 +174,8 @@ class DataLoader: UNMATCHED_ECO3 = { "HA25": 154, - "HA50": 5 + "HA41": 26, + "HA50": 5, } def __init__(self, directories, december_figures_filepath, use_cache, rebuild): @@ -264,6 +265,14 @@ class DataLoader: asset_list["add_5"].astype(str).str.lower().str.strip() + ", " + \ asset_list["post_code"].astype(str).str.lower().str.strip() asset_list["matching_postcode"] = asset_list["post_code"].astype(str).str.lower().str.strip() + elif ha_name == "HA41": + asset_list["matching_address"] = asset_list["AddressLine1"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["AddressLine2"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["AddressLine3"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["AddressLine4"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["AddressLine5"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["Postcode"].astype(str).str.lower().str.strip() + asset_list["matching_postcode"] = asset_list["Postcode"].astype(str).str.lower().str.strip() elif ha_name == "HA50": asset_list["matching_address"] = asset_list["Address Line 1"].astype(str).str.lower().str.strip() + ", " + \ asset_list["Post Code"].astype(str).str.lower().str.strip() @@ -1683,6 +1692,10 @@ class DataLoader: def correct_ha50_eco3_list(eco3_list): return eco3_list + @staticmethod + def correct_ha41_eco3_list(eco3_list): + return eco3_list + def merge_eco3_to_assets(self, asset_list, eco3_list, ha_name): eco3_list_correction_function = getattr(self, f"correct_{ha_name.lower()}_eco3_list") @@ -4384,15 +4397,14 @@ def app(): # Add in: # TODO: Remove ECO3 sales from HA25 priority_has = [ - "HA1", "HA6", "HA7", "HA14", "HA15", "HA16", "HA24", "HA25", "HA28", "HA32", "HA39", "HA50", "HA107", + "HA1", "HA6", "HA7", "HA14", "HA15", "HA16", "HA24", "HA25", "HA28", "HA32", "HA39", "HA41", "HA50", "HA107", ] # Next HAs to do: 14 [DONE], 15[DONE], 32 [DONE], 33 [Input format is 4 parts and no eco4 jobs identified - come # back on this], # Then: 28 [DONE], # 41, 48, 50 - # 38[problematic, but no ECO4], 10 problematic (no eligibility), - # 20 has barely any in - # TODO - do 50 + # Ignore for now: + # TODO: 38[problematic, but no ECO4], 10 problematic (no eligibility), 20 has barely any in # Filter down the directories to only the priority HAs directories = [d for d in directories if d.split("/")[2] in priority_has]