slight restructure of floor recommendations, removing repeated code

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-26 18:44:54 +01:00
parent c6464801f1
commit 77b5c87fbe

View file

@ -201,20 +201,23 @@ class FloorRecommendations(BaseUtility):
# The floor is already compliant
return
# For these methods, we need to know the wall material
# For these methods, we need to know the additional details about the property
if self.property.walls["is_solid_brick"]:
wall_type = "solid brick"
else:
raise NotImplementedError("Implement me")
if is_suspended:
total_floor_area = float(self.property.data["total-floor-area"])
number_of_rooms = float(self.property.data["number-habitable-rooms"])
total_floor_area = float(self.property.data["total-floor-area"])
number_of_rooms = float(self.property.data["number-habitable-rooms"])
if self.property.data["property-type"] == "House":
num_floors = self._estimate_floors(total_floor_area, number_of_rooms)
else:
raise NotImplementedError("Implement me")
if self.property.data["property-type"] == "House":
num_floors = self._estimate_floors(total_floor_area, number_of_rooms)
elif self.property.data["property-type"] == "Flat":
num_floors = 1
else:
raise NotImplementedError("Implement me")
if is_suspended:
if insulation_thickness == "none":
@ -238,15 +241,6 @@ class FloorRecommendations(BaseUtility):
self.recommend_floor_insulation(u_value=u_value, parts=suspended_floor_insulation_parts)
if is_solid:
total_floor_area = float(self.property.data["total-floor-area"])
number_of_rooms = float(self.property.data["number-habitable-rooms"])
if self.property.data["property-type"] == "House":
num_floors = self._estimate_floors(total_floor_area, number_of_rooms)
elif self.property.data["property-type"] == "Flat":
num_floors = 1
else:
raise NotImplementedError("Implement me")
if insulation_thickness == "none":