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 4dbf326b..d4de589a 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -188,7 +188,8 @@ class DataLoader: "HA25": 154, "HA41": 26, "HA50": 5, - "HA63": 0 + "HA63": 0, + "HA117": 4 } def __init__(self, directories, december_figures_filepath, use_cache, rebuild): @@ -308,6 +309,11 @@ class DataLoader: asset_list["District"].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 == "HA117": + asset_list["matching_address"] = asset_list["Address1"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["Address2"].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() else: raise NotImplementedError("implement me") @@ -1800,6 +1806,17 @@ class DataLoader: return eco3_list + @staticmethod + def correct_ha117_eco3_list(eco3_list): + # Delete rows where postcode is null - there are some placeholder rows where this happens + eco3_list = eco3_list[~pd.isnull(eco3_list["Post Code"])] + + eco3_list["Street / Block Name"] = eco3_list["Street / Block Name"].str.replace( + "TARRING ROAD", "155 TARRING ROAD" + ) + + 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") @@ -4505,13 +4522,13 @@ def app(): # Add in: priority_has = [ "HA1", "HA2", "HA6", "HA7", "HA12", "HA14", "HA15", "HA16", "HA24", "HA25", "HA28", "HA32", "HA39", "HA41", - "HA48", "HA50", "HA63", "HA107", + "HA48", "HA50", "HA63", "HA107", "HA117" ] # 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], 28 [DONE], 41 [DONE], 50 [DONE], 48 [DONE], 2 [DONE], 63 [DONE], 12 [DONE] - # - # Consider for ECO4: 13, 136, 117 - # COnsider for GBIS: 56, 35, 34 + # 117 [WIP] + # Consider for ECO4: 13 + # Consider for GBIS: 56, 35, 34 # Ignore for now: # 38 [problematic, but no ECO4], 10 problematic (no eligibility), 20 has barely any in # Filter down the directories to only the priority HAs