From 9d26c94ae571ce1ba5363e9c850b8017f110bc9d Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 6 Mar 2024 11:35:14 +0000 Subject: [PATCH] removed stray comma causing bugs --- .../ha_15_32/ha_analysis_batch_3.py | 32 ++++++++++++++++--- 1 file changed, 28 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 7bfbd7f5..e58c7799 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -1526,14 +1526,40 @@ class DataLoader: asset_list["ECO Eligibility"] = np.where( (asset_list["ECO Eligibility"] == "gbis") & ( asset_list["installation_status"].isin( - ["ECO4 - installed", "ECO4 - cancelled"] + ["ECO4 - installed", "ECO4 - cancelled", "ECO4 - in progress"] ) ), "eco4", asset_list["ECO Eligibility"] ) + # 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"] + )) & ( + asset_list["installation_status"].isin( + ["GBIS - installed", "GBIS - cancelled", "GBIS - in progress"] + ) + ), + "gbis", + asset_list["ECO Eligibility"] + ) + # Update the cases where a property is marked as not eligible, but sold for GBIS + if ((asset_list["ECO Eligibility"] == "not eligible") & ( + asset_list["installation_status"].isin( + ["GBIS - in progress", "GBIS - installed", "GBIS - cancelled"] + ))).sum(): + bah + asset_list["ECO Eligibility"] = np.where( + (asset_list["ECO Eligibility"] == "not eligible") & ( + asset_list["installation_status"].isin( + ["GBIS - in progress", "GBIS - installed", "GBIS - cancelled"] + )), + "gbis", + asset_list["ECO Eligibility"] + ) - asset_list = asset_list.drop(columns=["has_a_survey_record"]) + asset_list = asset_list.drop(columns=["has_a_survey_record", "installation_status"]) # Update the survey list with installation status self.data[ha_name]["survey_list"] = survey_list @@ -2897,8 +2923,6 @@ def forecast_remaining_sales(loader): gbis_rate = 600 eco4_rate = 1710 - # old_gbis_rate = 432 - # old_eco4_rate = 1456 # 1) Calculate the conversion rate from passed CIGA to actual sale converted_ciga_jobs = []