From f8948ff60f9e00d9501bd2f71f4269152cf3ab51 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sun, 3 Mar 2024 16:47:10 +0000 Subject: [PATCH] ha38 wip: --- .../ha_15_32/ha_analysis_batch_3.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 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 3ded09ba..4af7d9b9 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -234,6 +234,13 @@ class DataLoader: 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 == "HA38": + asset_list["matching_address"] = asset_list["House_Number"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["Address_Line_1"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["Address_Line_2"].astype(str).str.lower().str.strip() + ", " + \ + asset_list["Address_Line_3"].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 == "HA39": # Create matching_address by concatenating add_1, add_2, add_3, add_4, add_5, post_code asset_list["matching_address"] = asset_list["add_1"].astype(str).str.lower().str.strip() + ", " + \ @@ -332,6 +339,8 @@ class DataLoader: asset_list["HouseNo"] = asset_list["Dwelling num"].copy() elif ha_name == "HA28": asset_list["HouseNo"] = asset_list["House Number"].copy() + elif ha_name == "HA38": + asset_list["HouseNo"] = asset_list["House_Number"].copy() else: split_addresses = asset_list['matching_address'].str.split(',', expand=True) house_numbers = split_addresses[0].str.split(' ', expand=True) @@ -912,6 +921,12 @@ class DataLoader: return survey_list + @staticmethod + def correct_ha38_survey_list(survey_list): + # Rename the "No" column to "No." to align with the other survey sheets + survey_list = survey_list.rename(columns={"NO ": "NO."}) + return survey_list + @staticmethod def correct_ha32_survey_list(survey_list): survey_list["Street / Block Name"] = np.where( @@ -3490,10 +3505,11 @@ def app(): december_figures_filepath = "local_data/ha_data/HA_December_figures.csv" priority_has = [ - "HA1", "HA6", "HA7", "HA14", "HA15", "HA16", "HA24", "HA25", "HA28", "HA32", "HA39", "HA107", + "HA1", "HA6", "HA7", "HA14", "HA15", "HA16", "HA24", "HA25", "HA28", "HA32", "HA38", "HA39", "HA107", ] # Next HAs to do: 15[DONE], 32 [DONE], 33 [Input format is 4 parts and no eco4 jobs identified - come back on this], - # Then: 28, 41, 38, 10, 14, 20, 48 + # Then: 28 [DONE], + # 38, 41, 10, 14, 20, 48 # Filter down the directories to only the priority HAs directories = [d for d in directories if d.split("/")[2] in priority_has]