Added placeholder conversation area boolean and added internal wall insulation parts

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-21 10:48:50 +01:00
parent cea77aee1c
commit 9965767ae6

View file

@ -106,18 +106,75 @@ external_wall_insulation_parts = [
internal_wall_insulation_parts = [
{
# Example product
# https://www.insulationshop.co/25mm_polystyrene_insulation_eps_70jablite.html
"type": "internal_wall_insulation",
"description": "Internal wall insulation",
"depths": [30, 50, 70, 80, 90, 100, 150],
"description": "Rigid Insulation Boards Internal Wall Insulation",
"depths": [25, 40, 50, 75, 100],
"depth_unit": "mm",
"cost": None,
"cost_unit": None,
# The u-value here is just a placehoder for now and we probably want to have multiple
# options for internal wall insulation (e.g. 50mm, 100mm, 150mm), with different material types
# and costs
"r_value_per_mm": 0.0278,
"r_value_unit": "m2K/W"
}
"r_value_per_mm": 0.026315789473684213,
"r_value_unit": "square_meter_kelvin_per_watt",
"thermal_conductivity": 0.038,
"thermal_conductivity_unit": "watt_per_meter_kelvin"
},
{
# Example product
# https://www.rockwool.com/siteassets/rw-uk/downloads/datasheets/flexi.pdf
"type": "internal_wall_insulation",
"description": "Mineral Wool Internal Wall Insulation",
"depths": [140],
"depth_unit": "mm",
"cost": None,
"cost_unit": None,
"r_value_per_mm": 0.02857142857142857,
"r_value_unit": "square_meter_kelvin_per_watt",
"thermal_conductivity": 0.035,
"thermal_conductivity_unit": "watt_per_meter_kelvin"
},
{
# Example product
# https://www.kingspan.com/gb/en/products/insulation-boards/wall-insulation-boards/kooltherm-k118-insulated
# -plasterboard/
"type": "internal_wall_insulation",
"description": "Insulated Plasterboard Internal Wall Insulation",
"depths": [25, 80],
"depth_unit": "mm",
"cost": None,
"cost_unit": None,
"r_value_per_mm": 0.02857142857142857,
"r_value_unit": "square_meter_kelvin_per_watt",
"thermal_conductivity": 0.019,
"thermal_conductivity_unit": "watt_per_meter_kelvin"
},
{
"type": "internal_wall_insulation",
"description": "Reflective Internal Wall Insulation",
"depths": [],
"depth_unit": "mm",
"cost": None,
"cost_unit": None,
"r_value_per_mm": None,
"r_value_unit": "square_meter_kelvin_per_watt",
"thermal_conductivity": None,
"thermal_conductivity_unit": "watt_per_meter_kelvin"
},
{
# Example product
# https://www.insulationsuperstore.co.uk/product/vacutherm-vacupor-nt-b2-vacuum-insulated-panel-1m-x-600mm-x
# -30mm.html
"type": "internal_wall_insulation",
"description": "Vacuum Insulation Panels Wall Insulation",
"depths": [20, 30],
"depth_unit": "mm",
"cost": None,
"cost_unit": None,
"r_value_per_mm": 0.125,
"r_value_unit": "square_meter_kelvin_per_watt",
"thermal_conductivity": 0.008,
"thermal_conductivity_unit": "watt_per_meter_kelvin"
},
]
wall_parts = external_wall_insulation_parts + internal_wall_insulation_parts
@ -139,6 +196,8 @@ class WallRecommendations:
def __init__(self, property_instance: Property):
self.property = property_instance
self.year_built = self._year_property_was_built()
# TODO: Need to properly implement this
self.in_converation_area = False
# Will contains a list of recommended measures
self.recommendations = []
@ -153,9 +212,11 @@ class WallRecommendations:
return pd.to_datetime(self.property.full_sap_epc["lodgement-date"]).year
if self.property.data["construction-age-band"]:
# Take the upper limit
# Take the lower limit. If we're pessimistic about the age of the property, that at least means we have
# more options for recommendations if that age falls before the year that insulation in walls became
# common practice
band = [int(x) for x in re.findall(r'\b\d{4}\b', self.property.data["construction-age-band"])]
return band[1]
return band[0]
raise NotImplementedError("Implement me!")
@ -197,9 +258,10 @@ class WallRecommendations:
u_value = self.DEFAULT_U_VALUES["solid_brick"]
# Recommend external and internal wall insulation
parts = [
part for part in wall_parts if part["type"] in ["external_wall_insulation", "internal_wall_insulation"]
]
part_types = ["external_wall_insulation", "internal_wall_insulation"] if not self.in_converation_area else \
["internal_wall_insulation"]
parts = [part for part in wall_parts if part["type"] in part_types]
for part in parts:
for depth in part["depths"]: