From 6ccfff0411ee2af58d6f7dc47b98f2deb70eac5c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 18 Mar 2024 16:14:11 +0000 Subject: [PATCH] Added ha20 --- .../ha_15_32/ha_analysis_batch_3.py | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 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 009064c6..627fcede 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -566,7 +566,8 @@ class DataLoader: "HA107": 51, "HA48": 0, "HA45": 0, - "HA52": 5 + "HA52": 5, + "HA20": 6 } UNMATCHED_ECO3 = { @@ -669,6 +670,17 @@ class DataLoader: 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 == "HA20": + asset_list["matching_address"] = ( + asset_list["House Name"].astype(str).str.lower().str.strip() + ", " + + asset_list["Block"].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["Address Line 4"].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 == "HA21": asset_list["matching_address"] = ( asset_list["Address"].astype(str).str.lower().str.strip() + ", " + @@ -2697,6 +2709,35 @@ class DataLoader: def correct_ha5_survey_list(survey_list): return survey_list + @staticmethod + def correct_ha20_survey_list(survey_list): + # Not in the asset list + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "Abbot Close", "ABBOTS CLOSE" + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "Downbarns Road", "DOWN BARNS ROAD" + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "Austin Lane", "AUSTINS LANE" + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "South Park Way", "SOUTHPARK WAY" + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "OAKLAND ROAD", "OAKWOOD ROAD" + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "ACRE WAY/NORTHWOOD", "ACRE WAY" + ) + + return survey_list + @staticmethod def levenstein_match(matching_string, df): match_to = df["matching_address"].tolist() @@ -3301,7 +3342,8 @@ class DataLoader: "AFF0RDALE WARMTH": "ECO4", "ECO 4 RdSAP CL": "ECO4", "Affordable Warmth (R) ": "ECO4", - "Affordable Warmth ": "ECO4" + "Affordable Warmth ": "ECO4", + "ECO 4 AFFORDABLE WARMTH": "ECO4", } # Since it seems like "subject to archetype check" has some failure conditions, for simplicity, we @@ -6478,11 +6520,11 @@ def app(): # Add in: priority_has = [ - "HA1", "HA2", "HA5", "HA6", "HA7", "HA9", "HA12", "HA13", "HA14", "HA15", "HA16", "HA18", "HA19", "HA24", + "HA1", "HA2", "HA6", "HA7", "HA9", "HA12", "HA13", "HA14", "HA15", "HA16", "HA18", "HA19", "HA24", "HA25", "HA27", "HA28", "HA30", "HA31", "HA32", "HA34", "HA35", "HA39", "HA41", "HA48", "HA49", "HA50", "HA54", "HA56", "HA63", "HA107", "HA117", "HA8", "HA11", "HA21", "HA37", "HA42", # Added as of March 18th - "HA44", "HA45", "HA51", "HA52", "HA17", + "HA44", "HA45", "HA51", "HA52", "HA17", "HA5", "HA20", # New HAS "HAXX", "HAXXX", ]