Added ha20

This commit is contained in:
Khalim Conn-Kowlessar 2024-03-18 16:14:11 +00:00
parent 443aa585d0
commit 6ccfff0411

View file

@ -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",
]