Added ewi and loft insulation

This commit is contained in:
Khalim Conn-Kowlessar 2024-05-21 12:22:47 +01:00
parent 6998119208
commit e95a2d0113
3 changed files with 54 additions and 7 deletions

View file

@ -60,12 +60,14 @@ class Mds:
mds_recommendations = []
# TODO: Could use a decarator to reduce the boilerplate code - insert_recommendation_id and then the append
if "external_wall_insulation" in measure_config_list:
raise Exception("check me out")
self.wall_recommender.recommend(phase=0)
# TODO: Get just ewi
ewi_recommendations = self.wall_recommender.recommendations
# TODO: Insert the recommendation identifier into this recommendation
recs = self.wall_recommender.mds_recommend_ewi(phase=0)
if not recs:
raise Exception("No recommendations for external wall insulation")
recs = self.insert_recommendation_id(recs, measures, "external_wall_insulation")
mds_recommendations.append(recs)
if "cavity_wall_insulation" in measure_config_list:
recs = self.wall_recommender.mds_recommend_cavity_wall_insulation(phase=0)
@ -73,8 +75,11 @@ class Mds:
mds_recommendations.append(recs)
if "loft_insulation" in measure_config_list:
raise Exception("check me out 3")
self.roof_recommender.recommend(phase=0)
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")

View file

@ -54,6 +54,26 @@ class RoofRecommendations:
]
]
def mds_loft_insulation(self, phase):
"""
For usages within the mds report
:param phase:
:return:
"""
self.recommendations = []
insulation_thickness = convert_thickness_to_numeric(
self.property.roof["insulation_thickness"],
self.property.roof["is_pitched"],
self.property.roof["is_flat"]
)
u_value = get_roof_u_value(**{**self.property.roof, "age_band": self.property.age_band})
self.recommend_roof_insulation(u_value, insulation_thickness, self.property.roof, phase)
return self.recommendations
def recommend(self, phase):
if self.property.roof["has_dwelling_above"]:

View file

@ -120,6 +120,28 @@ class WallRecommendations(Definitions):
return self.recommendations
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"],
age_band=self.property.age_band,
is_granite_or_whinstone=self.property.walls["is_granite_or_whinstone"],
is_sandstone_or_limestone=self.property.walls["is_sandstone_or_limestone"],
)
# EWI
ewi_recommendations = self._find_insulation(
u_value=u_value,
insulation_materials=pd.DataFrame(self.external_wall_insulation_materials),
non_insulation_materials=self.external_wall_non_insulation_materials,
phase=phase
)
return ewi_recommendations
def recommend(self, phase=0):
# if building built after 1990 + we're able to identify U-value +
# U-value less than 0.18 and if in or close to a conversation area,