Added built-form to uvalue estimates

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-22 10:58:47 +01:00
parent b867297c8d
commit 6afc8d2e67
2 changed files with 7 additions and 5 deletions

View file

@ -33,7 +33,7 @@ class UvalueEstimations:
:param cleaner: An instance of the EpcClean class used for cleaning data.
"""
walls_columns = [
"local-authority", "property-type", "walls-description", "walls-energy-eff", "walls-env-eff",
"local-authority", "property-type", "walls-description", "walls-energy-eff", "walls-env-eff", "built-form",
"total-floor-area", "number-habitable-rooms", "number-heated-rooms"
]
@ -59,6 +59,7 @@ class UvalueEstimations:
"property-type",
"walls-energy-eff",
"walls-env-eff",
"built-form",
"number-habitable-rooms",
"number-heated-rooms",
"total-floor-area_group"
@ -71,6 +72,7 @@ class UvalueEstimations:
"property-type",
"walls-energy-eff",
"walls-env-eff",
"built-form",
"number-habitable-rooms",
"number-heated-rooms",
"total-floor-area_group",

View file

@ -235,7 +235,6 @@ class WallRecommendations:
is_cavity_wall = self.property.walls["is_cavity_wall"]
is_solid_brick = self.property.walls["is_solid_brick"]
insulation_thickness = self.property.walls["insulation_thickness"]
wall_energy_efficiency = self.property.data["walls-energy-eff"]
if u_value:
if self.property.walls["thermal_transmittance_unit"] != self.U_VALUE_UNIT:
@ -341,11 +340,15 @@ class WallRecommendations:
u_value_estimate = self.uvalue_estimates.walls[
(self.uvalue_estimates.walls["local-authority"] == self.property.data["local-authority"]) &
(self.uvalue_estimates.walls["property-type"] == self.property.data["property-type"]) &
(self.uvalue_estimates.walls["built-form"] == self.property.data["built-form"]) &
(self.uvalue_estimates.walls["walls-energy-eff"] == self.property.data["walls-energy-eff"]) &
(self.uvalue_estimates.walls["walls-env-eff"] == self.property.data["walls-env-eff"]) &
(self.uvalue_estimates.walls["total-floor-area_group"] == total_floor_area_group_decile)
]
if u_value_estimate.empty:
raise ValueError("No U-value estimate found for the given property")
# Because of how spuriously populated the data is for number-habitable-rooms and number-heated-rooms,
# we will try and filter on these to see if we get a result
@ -363,9 +366,6 @@ class WallRecommendations:
if any(heated_rooms_filter):
u_value_estimate = u_value_estimate[heated_rooms_filter]
if u_value_estimate.empty:
raise ValueError("No U-value estimate found for the given property")
# It's possible for us to have multiple rows if we didn't do a habitable/heated rooms filter so we
# average