From b80ffda392e0601f08dd376cfaacba73e733fc9c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 26 Feb 2024 19:29:46 +0000 Subject: [PATCH] updating eligibility pipeline to factor in ciga --- .../ha_15_32/ha_analysis_batch_3.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 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 3d0964c6..ecbb4e0a 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -1159,8 +1159,11 @@ def get_epc_data( eligibility.check_eco4_warmfront() # We check the conditions for checking the penultimate epc - identified_for_gbis = property_meta["ECO Eligibility"] == "gbis" + identified_for_gbis = property_meta["ECO Eligibility"] in ["gbis"] identified_for_eco4 = property_meta["ECO Eligibility"] in ["eco4"] + subject_to_ciga = property_meta["ECO Eligibility"] in [ + "eco4 (subject to ciga)", "eco4 - passed ciga", "failed ciga" + ] # condition 1 - identified for gbis and not eligible condition_1 = ( @@ -1179,8 +1182,11 @@ def get_epc_data( # Nothing identified condition_4 = ( - not identified_for_gbis and not identified_for_eco4 and not eligibility.gbis_warmfront and not - eligibility.eco4_warmfront["eligible"] + not identified_for_gbis + and not identified_for_eco4 + and not eligibility.gbis_warmfront + and not subject_to_ciga + and not eligibility.eco4_warmfront["eligible"] ) # Not identified but seemingly eligible for eco4 or gbis @@ -1190,6 +1196,10 @@ def get_epc_data( ) ) + condition_6 = ( + subject_to_ciga and not eligibility.eco4_warmfront["eligible"] + ) + if condition_1 or condition_2: # We check the penultimate epc eligibility = Eligibility(epc=penultimate_epc, cleaned=cleaned) @@ -1199,8 +1209,7 @@ def get_epc_data( # We don't update just to make data cleaning easier if penultimate_epc.get("estimated") is None: older_epcs = [x for x in searcher.data["rows"] if x["lmk-key"] != penultimate_epc["lmk-key"]] - elif condition_3 or condition_4 or condition_5: - # If we have successfully identified for gbis, we don't need to check the penultimate epc + elif condition_3 or condition_4 or condition_5 or condition_6: pass else: NotImplementedError("Implement me")