From f03485d4f49045e8f68cf7a8dcc5caf58113ede1 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Sat, 9 Mar 2024 14:41:38 +0000 Subject: [PATCH] updating facts and figures to treat archetype dependent properties separately --- .../ha_15_32/ha_analysis_batch_3.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 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 15a4f438..c0f3ab12 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -2172,13 +2172,12 @@ class DataLoader: eco_eligibility_map = { "not eligble": "not eligible", "eco 4(subject to ciga)": "eco4 (subject to ciga)", - "eco4 (subject to ciga/archetype check": "eco4 (subject to ciga)", - "eco4 (subject to archetype check)": "eco4 (subject to ciga)", - "eco4 (subject to ciga/archetype)": "eco4 (subject to ciga)", + "eco4 (subject to ciga/archetype check": "eco4 (subject to ciga) (subject to archetype)", + "eco4 (subject to archetype check)": "eco4 (subject to archetype)", + "eco4 (subject to ciga/archetype)": "eco4 (subject to ciga) (subject to archetype)", "eco4 (subject to ciga)": "eco4 (subject to ciga)", "eco4(subject to ciga)": "eco4 (subject to ciga)", "eco4 subject to ciga": "eco4 (subject to ciga)", - "eco4 (subject to archetype)": "eco4 (subject to ciga)", } ha_facts_and_figures = [] @@ -2330,7 +2329,7 @@ class DataLoader: asset_list = asset_list.merge(survey_list_to_merge, how='left', on="asset_list_row_id") # Update the cases where properties have sold, but are missing a CIGA check asset_list["ECO Eligibility"] = np.where( - (asset_list["ECO Eligibility"] == "eco4 (subject to ciga)") & ( + (asset_list["ECO Eligibility"].str.contains("(subject to ciga)")) & ( asset_list["has_a_survey_record"] == True ), "eco4 - passed ciga", @@ -2349,7 +2348,14 @@ class DataLoader: # Update the cases where a property was marked as eligible for ECO4, but sold for GBIS asset_list["ECO Eligibility"] = np.where( (asset_list["ECO Eligibility"].isin( - ["eco4", "eco4 (subject to ciga)", "eco4 - passed ciga", "failed ciga"] + [ + "eco4", + "eco4 (subject to ciga)", + "eco4 - passed ciga", + "failed ciga", + "eco4 (subject to archetype)", + "eco4 (subject to ciga) (subject to archetype)" + ] )) & ( asset_list["installation_status"].isin( ["GBIS - installed", "GBIS - cancelled", "GBIS - in progress"]