adding in u-value extraction and handling cases of setting energy efficiency more elegantly

This commit is contained in:
Khalim Conn-Kowlessar 2024-05-21 14:40:57 +01:00
parent 0d1e49f1f3
commit 340e8118eb
2 changed files with 17 additions and 12 deletions

View file

@ -351,7 +351,10 @@ class Property:
# Setting the insulation thickness here to above average should be tested further because we
# don't see a high volume of instances for this
output["walls_insulation_thickness_ending"] = "average"
output["walls_energy_eff_ending"] = "Good"
# In some edge cases, or when running the mds report we might see the energy efficiency already
# in Good or Very Good
if output["walls_energy_eff_ending"] not in ["Good", "Very Good"]:
output["walls_energy_eff_ending"] = "Good"
# Note: often when the wall is insulatied, the internal/external insulation is not noted so we should
# test the impact of using these booleans
@ -384,11 +387,8 @@ class Property:
"Have more than 1 floor insulation part - handle this case"
)
# output["floor_thermal_transmittance_ending"] = recommendation["new_u_value"]
# We don't really see above average for this in the training data
output["floor_insulation_thickness_ending"] = "average"
# This is rarely ever populated in the training data
# output["floor_energy_eff_ending"] = "Good"
else:
if output["floor_thermal_transmittance_ending"] is None:
raise ValueError("We should not have a None value for the u value")
@ -439,7 +439,8 @@ class Property:
if proposed_depth >= 270:
output["roof_energy_eff_ending"] = "Very Good"
else:
output["roof_energy_eff_ending"] = "Good"
if output["roof_energy_eff_ending"] not in ["Good", "Very Good"]:
output["roof_energy_eff_ending"] = "Good"
else:
output["roof_energy_eff_ending"] = "Very Good"
else:
@ -459,7 +460,8 @@ class Property:
if recommendation["type"] == "windows_glazing":
output["multi_glaze_proportion_ending"] = 100
output["windows_energy_eff_ending"] = "Average"
if output["windows_energy_eff_ending"] not in ["Average", "Good", "Very Good"]:
output["windows_energy_eff_ending"] = "Average"
is_secondary_glazing = recommendation["is_secondary_glazing"]

View file

@ -124,12 +124,15 @@ class WallRecommendations(Definitions):
# Function specifically for external wall insulation, for usage in the mds report
self.recommendations = []
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"],
)
u_value = self.property.walls["thermal_transmittance"]
if u_value is None:
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(