insulation of floor to unheated space complete

This commit is contained in:
Khalim Conn-Kowlessar 2023-10-24 17:32:48 +08:00
parent 0c5ff1153c
commit 22a0bb1ffd
3 changed files with 25 additions and 15 deletions

View file

@ -140,6 +140,17 @@ async def trigger_plan(body: PlanTriggerRequest):
# with open("materials_by_type", "rb") as f:
# materials_by_type = pickle.load(f)
# materials_by_type["floor"].append(
# {'id': 18, 'type': 'exposed_floor_insulation', 'description': 'Rockwool Stone Wool insulation',
# 'depths': [50, 100, 140], 'depth_unit': 'mm', 'cost': [8, 11, 15],
# 'cost_unit': 'gbp_sq_meter', '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',
# 'link': 'https://insulation4less.co.uk/products/rockwool-flexi-slab-all-sizes?variant=33409590853685',
# 'created_at': datetime(2023, 8, 10, 16, 59, 10, 815531), 'is_active': True}
#
# )
recommendations = {}
recommendations_scoring_data = []

View file

@ -10,23 +10,22 @@ from utils.s3 import read_dataframe_from_s3_parquet
from tqdm import tqdm
# Handy code for selecting testin data
# Handy code for selecting testing data
# import pickle
#
# with open("sap_change_dataset.pickle", "rb") as f:
# with open("sap_dataset.pickle", "rb") as f:
# sap_change_dataset = pickle.load(f)
#
# search_from = sap_change_dataset[
# (sap_change_dataset["walls_thermal_transmittance_ENDING"] == sap_change_dataset["walls_thermal_transmittance"])
# ]
# (sap_change_dataset["walls_thermal_transmittance_ENDING"] == sap_change_dataset["walls_thermal_transmittance"]) &
# sap_change_dataset["is_to_unheated_space"]
# ]
# search_from = search_from[
# (search_from["roof_thermal_transmittance_ENDING"] == search_from["roof_thermal_transmittance"]) &
# (search_from["floor_thermal_transmittance_ENDING"] == search_from["floor_thermal_transmittance"]) &
# (search_from["floor_thermal_transmittance_ENDING"] != search_from["floor_thermal_transmittance"]) &
# (search_from["MECHANICAL_VENTILATION_ENDING"] == search_from["MECHANICAL_VENTILATION_STARTING"]) &
# (search_from["SECONDHEAT_DESCRIPTION_ENDING"] == search_from["SECONDHEAT_DESCRIPTION_STARTING"]) &
# (search_from["GLAZED_TYPE_ENDING"] == search_from["GLAZED_TYPE_STARTING"]) &
# (search_from["NUMBER_OPEN_FIREPLACES_STARTING"] > 0) &
# (search_from["NUMBER_OPEN_FIREPLACES_ENDING"] == 0)
# (search_from["GLAZED_TYPE_ENDING"] == search_from["GLAZED_TYPE_STARTING"])
# ]
#
# # Find a record where the only difference is cavity wall getting filled
@ -54,7 +53,7 @@ from tqdm import tqdm
# starting_cols.append(starting_col)
#
# # We want them to be different
# if c == "NUMBER_OPEN_FIREPLACES_ENDING":
# if c == "floor_thermal_transmittance_ENDING":
# if (row[c] == row[starting_col]) | (row[starting_col] != "natural"):
# same = False
# break
@ -82,11 +81,11 @@ from tqdm import tqdm
#
# compare = pd.concat([start, end], axis=1)
#
# ending_lmk = "bab3983fa167717b8bb4a36ef395046d53937f9b880a45bcc751270d72e5de45"
# starting_lmk = "736b6f4803a11d9e45b49bf98f36eb8a7f357b0dd24f3e7cddef5295518e5bef"
# ending_lmk = "1252008839062019090910572351658131"
# starting_lmk = "1252008819542014122308482236142128"
#
# client = EpcClient(auth_token=EPC_AUTH_TOKEN)
# result = client.domestic.search(params={"address": "9 Glebe Road, Asfordby Hill", "postcode": "LE14 3QT"})
# result = client.domestic.search(params={"address": "Flat 14 Charles House, Freemens Way", "postcode": "CT14 9DL"})
# starting_epc = [x for x in result["rows"] if x["lmk-key"] == starting_lmk][0]
# ending_epc = [x for x in result["rows"] if x["lmk-key"] == ending_lmk][0]
@ -101,7 +100,7 @@ from tqdm import tqdm
# ) as f:
# cleaning_data = pickle.load(f)
# TODO: Need to do floors, both suspended and solid
# TODO: Need to do floors, suspended and solid and to unheated space
class TestSapModelPrep:

View file

@ -58,7 +58,7 @@ class FloorRecommendations(Definitions):
)
property_type = self.property.data["property-type"]
floor_area = self.property.floor_area / self.property.number_of_storeys
floor_area = self.property.floor_area / self.property.number_of_floors
year_built = self.property.year_built
if self.property.floor["another_property_below"] | (self.property.floor["insulation_thickness"] in [
@ -137,7 +137,7 @@ class FloorRecommendations(Definitions):
if new_u_value <= self.BUILDING_REGULATIONS_PART_L_MAX_U_VALUE:
lowest_selected_u_value = update_lowest_selected_u_value(lowest_selected_u_value, new_u_value)
quantity = self.property.floor_area / self.property.number_of_storeys
quantity = self.property.floor_area / self.property.number_of_floors
estimated_cost = cost_per_unit * quantity