mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
slight restructure of floor recommendations, removing repeated code
This commit is contained in:
parent
c6464801f1
commit
77b5c87fbe
1 changed files with 11 additions and 17 deletions
|
|
@ -201,20 +201,23 @@ class FloorRecommendations(BaseUtility):
|
||||||
# The floor is already compliant
|
# The floor is already compliant
|
||||||
return
|
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"]:
|
if self.property.walls["is_solid_brick"]:
|
||||||
wall_type = "solid brick"
|
wall_type = "solid brick"
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("Implement me")
|
raise NotImplementedError("Implement me")
|
||||||
|
|
||||||
if is_suspended:
|
total_floor_area = float(self.property.data["total-floor-area"])
|
||||||
total_floor_area = float(self.property.data["total-floor-area"])
|
number_of_rooms = float(self.property.data["number-habitable-rooms"])
|
||||||
number_of_rooms = float(self.property.data["number-habitable-rooms"])
|
|
||||||
|
|
||||||
if self.property.data["property-type"] == "House":
|
if self.property.data["property-type"] == "House":
|
||||||
num_floors = self._estimate_floors(total_floor_area, number_of_rooms)
|
num_floors = self._estimate_floors(total_floor_area, number_of_rooms)
|
||||||
else:
|
elif self.property.data["property-type"] == "Flat":
|
||||||
raise NotImplementedError("Implement me")
|
num_floors = 1
|
||||||
|
else:
|
||||||
|
raise NotImplementedError("Implement me")
|
||||||
|
|
||||||
|
if is_suspended:
|
||||||
|
|
||||||
if insulation_thickness == "none":
|
if insulation_thickness == "none":
|
||||||
|
|
||||||
|
|
@ -238,15 +241,6 @@ class FloorRecommendations(BaseUtility):
|
||||||
self.recommend_floor_insulation(u_value=u_value, parts=suspended_floor_insulation_parts)
|
self.recommend_floor_insulation(u_value=u_value, parts=suspended_floor_insulation_parts)
|
||||||
|
|
||||||
if is_solid:
|
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":
|
if insulation_thickness == "none":
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue