mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handle empty pps matrix and low C and above for ewi, iwi and cwi
This commit is contained in:
parent
0170272abd
commit
1458cff95c
1 changed files with 6 additions and 0 deletions
|
|
@ -542,6 +542,8 @@ class Funding:
|
|||
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == measure_code]
|
||||
|
||||
if pps.shape[0] != 1:
|
||||
if pps.empty and self.starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]:
|
||||
return 0
|
||||
raise ValueError(f"Invalid IWI category: {measure_code}")
|
||||
return pps.squeeze()["Cost Savings"]
|
||||
|
||||
|
|
@ -554,6 +556,8 @@ class Funding:
|
|||
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == measure_code]
|
||||
|
||||
if pps.shape[0] != 1:
|
||||
if pps.empty and self.starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]:
|
||||
return 0
|
||||
raise ValueError(f"Invalid EWI category: {measure_code}")
|
||||
return pps.squeeze()["Cost Savings"]
|
||||
|
||||
|
|
@ -562,6 +566,8 @@ class Funding:
|
|||
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == measure_code]
|
||||
|
||||
if pps.shape[0] != 1:
|
||||
if pps.empty and self.starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]:
|
||||
return 0
|
||||
raise ValueError(f"Invalid CWI category: {measure_code}")
|
||||
return pps.squeeze()["Cost Savings"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue