mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #489 from Hestia-Homes/main
Some handling of EPC C properties in funding cals
This commit is contained in:
commit
c60205b0f8
2 changed files with 15 additions and 1 deletions
|
|
@ -323,7 +323,9 @@ class Funding:
|
||||||
|
|
||||||
def _calculate_full_project_abs(self, floor_area_band: str, starting_sap_band: str, ending_sap_band: str):
|
def _calculate_full_project_abs(self, floor_area_band: str, starting_sap_band: str, ending_sap_band: str):
|
||||||
|
|
||||||
if starting_sap_band == ending_sap_band:
|
if (starting_sap_band == ending_sap_band) or (
|
||||||
|
starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]
|
||||||
|
):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
data = self.project_scores_matrix[
|
data = self.project_scores_matrix[
|
||||||
|
|
@ -584,6 +586,11 @@ class Funding:
|
||||||
return pps.squeeze()["Cost Savings"]
|
return pps.squeeze()["Cost Savings"]
|
||||||
|
|
||||||
if measure_type == "suspended_floor_insulation":
|
if measure_type == "suspended_floor_insulation":
|
||||||
|
|
||||||
|
if self.starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]:
|
||||||
|
# We don't fund SFI for properties starting at C or above
|
||||||
|
return 0
|
||||||
|
|
||||||
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == "UFI"]
|
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == "UFI"]
|
||||||
if pps.shape[0] != 1:
|
if pps.shape[0] != 1:
|
||||||
raise ValueError("Invalid UFI category")
|
raise ValueError("Invalid UFI category")
|
||||||
|
|
|
||||||
|
|
@ -417,6 +417,13 @@ def optimise_with_funding_paths(p, input_measures, housing_type, funding: Fundin
|
||||||
axis=1
|
axis=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for _, x in solutions.iterrows():
|
||||||
|
funding._calculate_full_project_abs(
|
||||||
|
floor_area_band=x["floor_area_band"],
|
||||||
|
starting_sap_band=x["starting_band"],
|
||||||
|
ending_sap_band=x["ending_band"],
|
||||||
|
)
|
||||||
|
|
||||||
rate = funding.get_eco4_abs_rate(is_cavity=p.walls["is_cavity_wall"])
|
rate = funding.get_eco4_abs_rate(is_cavity=p.walls["is_cavity_wall"])
|
||||||
solutions["full_project_funding"] = solutions["project_score"] * rate
|
solutions["full_project_funding"] = solutions["project_score"] * rate
|
||||||
# if the scheme is not ECO4, we set the funding to 0 with iloc
|
# if the scheme is not ECO4, we set the funding to 0 with iloc
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue