mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
allow costing for flats ewi
This commit is contained in:
parent
e95a2d0113
commit
0d1e49f1f3
4 changed files with 18 additions and 11 deletions
|
|
@ -736,7 +736,10 @@ async def build_mds(body: PlanTriggerRequest):
|
|||
p.get_components(cleaned, photo_supply_lookup, floor_area_decile_thresholds)
|
||||
|
||||
mds = Mds(property_instance=p, materials=materials)
|
||||
mds.build()
|
||||
property_representative_recommendations, errors = mds.build()
|
||||
|
||||
if errors:
|
||||
logger.info("Errors occurred during MDS build")
|
||||
|
||||
|
||||
except IntegrityError:
|
||||
|
|
|
|||
|
|
@ -626,12 +626,10 @@ class Costs:
|
|||
preliminaries_rate = self.EWI_SCAFFOLDING_PRELIMINARIES
|
||||
else:
|
||||
preliminaries_rate = self.EWI_NO_SCAFFOLDING_PRELIMINARIES
|
||||
elif self.property.data["property-type"] == "Maisonette":
|
||||
elif self.property.data["property-type"] in ["Maisonette", "Flat"]:
|
||||
preliminaries_rate = self.EWI_SCAFFOLDING_PRELIMINARIES
|
||||
elif self.property.data["property-type"] == "Bungalow":
|
||||
preliminaries_rate = self.EWI_NO_SCAFFOLDING_PRELIMINARIES
|
||||
else:
|
||||
raise ValueError("Unsupported property type - haven't handled flats")
|
||||
|
||||
demolition_data = [x for x in non_insulation_materials if x["type"] == "ewi_wall_demolition"]
|
||||
preparation_data = [x for x in non_insulation_materials if x["type"] == "ewi_wall_preparation"]
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ class Mds:
|
|||
raise NotImplementedError("Not implemented measure in the property - implement me")
|
||||
|
||||
mds_recommendations = []
|
||||
errors = []
|
||||
|
||||
# TODO: Could use a decarator to reduce the boilerplate code - insert_recommendation_id and then the append
|
||||
|
||||
|
|
@ -75,11 +76,15 @@ class Mds:
|
|||
mds_recommendations.append(recs)
|
||||
|
||||
if "loft_insulation" in measure_config_list:
|
||||
recs = self.roof_recommender.mds_loft_insulation(phase=0)
|
||||
if not recs:
|
||||
raise Exception("No recommendations for loft insulation")
|
||||
recs = self.insert_recommendation_id(recs, measures, "loft_insulation")
|
||||
mds_recommendations.append(recs)
|
||||
# Check if the roof is suitable for loft insulation
|
||||
if self.property_instance.roof['is_roof_room']:
|
||||
errors.append("Roof is a room")
|
||||
else:
|
||||
recs = self.roof_recommender.mds_loft_insulation(phase=0)
|
||||
if not recs:
|
||||
raise Exception("No recommendations for loft insulation")
|
||||
recs = self.insert_recommendation_id(recs, measures, "loft_insulation")
|
||||
mds_recommendations.append(recs)
|
||||
|
||||
if "internal_wall_insulation" in measure_config_list:
|
||||
raise Exception("check me out 4")
|
||||
|
|
@ -104,7 +109,7 @@ class Mds:
|
|||
recs = self.heating_recommender.recommend_hhr_storage_heaters(
|
||||
phase=0, system_change=True, heating_controls_only=False, _return=True
|
||||
)
|
||||
recs = self.insert_recommendation_id(recs, measures)
|
||||
recs = self.insert_recommendation_id(recs, measures, "electric_storage_heaters")
|
||||
mds_recommendations.append(recs)
|
||||
|
||||
if "low_energy_lighting" in measure_config_list:
|
||||
|
|
@ -156,6 +161,8 @@ class Mds:
|
|||
mds_recommendations, non_invasive_recommendations=[]
|
||||
)
|
||||
|
||||
return property_representative_recommendations, errors
|
||||
|
||||
@staticmethod
|
||||
def insert_recommendation_id(recommendations, measures, measure_name):
|
||||
# Insert the recommendation identifier into this recommendation
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ class WallRecommendations(Definitions):
|
|||
def mds_recommend_ewi(self, phase=None):
|
||||
# Function specifically for external wall insulation, for usage in the mds report
|
||||
self.recommendations = []
|
||||
insulation_thickness = self.property.walls["insulation_thickness"]
|
||||
|
||||
u_value = get_wall_u_value(
|
||||
clean_description=self.property.walls["clean_description"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue