mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
added override to roof insulation
This commit is contained in:
parent
0ede95cc4a
commit
1c5ccb2c8c
1 changed files with 8 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ from typing import List
|
||||||
from datatypes.enums import QuantityUnits
|
from datatypes.enums import QuantityUnits
|
||||||
from recommendations.recommendation_utils import (
|
from recommendations.recommendation_utils import (
|
||||||
get_roof_u_value, r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns,
|
get_roof_u_value, r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns,
|
||||||
update_lowest_selected_u_value, get_recommended_part, convert_thickness_to_numeric
|
update_lowest_selected_u_value, get_recommended_part, convert_thickness_to_numeric, override_costs
|
||||||
)
|
)
|
||||||
from recommendations.Costs import Costs
|
from recommendations.Costs import Costs
|
||||||
|
|
||||||
|
|
@ -207,12 +207,18 @@ class RoofRecommendations:
|
||||||
floor_area=self.property.insulation_floor_area,
|
floor_area=self.property.insulation_floor_area,
|
||||||
material=material
|
material=material
|
||||||
)
|
)
|
||||||
|
is_override = "loft_insulation" in cost_result
|
||||||
|
if is_override:
|
||||||
|
cost_result = override_costs(cost_result)
|
||||||
elif material["type"] == "flat_roof_insulation":
|
elif material["type"] == "flat_roof_insulation":
|
||||||
cost_result = self.costs.flat_roof_insulation(
|
cost_result = self.costs.flat_roof_insulation(
|
||||||
floor_area=self.property.insulation_floor_area,
|
floor_area=self.property.insulation_floor_area,
|
||||||
material=material,
|
material=material,
|
||||||
non_insulation_materials=non_insulation_materials
|
non_insulation_materials=non_insulation_materials
|
||||||
)
|
)
|
||||||
|
is_override = "flat_roof_insulation" in cost_result
|
||||||
|
if is_override:
|
||||||
|
cost_result = override_costs(cost_result)
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid material type")
|
raise ValueError("Invalid material type")
|
||||||
|
|
||||||
|
|
@ -232,6 +238,7 @@ class RoofRecommendations:
|
||||||
"starting_u_value": u_value,
|
"starting_u_value": u_value,
|
||||||
"new_u_value": new_u_value,
|
"new_u_value": new_u_value,
|
||||||
"sap_points": None,
|
"sap_points": None,
|
||||||
|
"is_override": is_override,
|
||||||
**cost_result
|
**cost_result
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue