fixed all recommendations apart from windows

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-21 14:09:32 +00:00
parent 5de6b3f029
commit 10c9a6f472
4 changed files with 30 additions and 9 deletions

View file

@ -37,7 +37,8 @@ mock_epc_response = {
"floor-height": 2.5,
"total-floor-area": 100,
"construction-age-band": "England and Wales: 1967-1975",
"floor-description": "Floor Description"
"floor-description": "Floor Description",
"floor-level": "Ground"
},
{
"lmk-key": 2,
@ -68,7 +69,8 @@ mock_epc_response = {
"floor-height": 2.5,
"total-floor-area": 100,
"construction-age-band": "England and Wales: 1967-1975",
"floor-description": "Floor Description"
"floor-description": "Floor Description",
"floor-level": "Ground"
}
]
}
@ -100,7 +102,8 @@ mock_epc_response_dupe = {
"floor-height": 2.5,
"total-floor-area": 100,
"construction-age-band": "England and Wales: 1967-1975",
"floor-description": "Floor Description"
"floor-description": "Floor Description",
"floor-level": "Ground"
},
{
"lmk-key": 2,
@ -128,7 +131,8 @@ mock_epc_response_dupe = {
"floor-height": 2.5,
"total-floor-area": 100,
"construction-age-band": "England and Wales: 1967-1975",
"floor-description": "Floor Description"
"floor-description": "Floor Description",
"floor-level": "Ground"
},
{
"lmk-key": 3,
@ -156,7 +160,8 @@ mock_epc_response_dupe = {
"floor-height": 2.5,
"total-floor-area": 100,
"construction-age-band": "England and Wales: 1967-1975",
"floor-description": "Floor Description"
"floor-description": "Floor Description",
"floor-level": "Ground"
}
]
}

View file

@ -631,6 +631,19 @@ def app():
file_key="sap_change_model/all_equal_rows.parquet",
)
from utils.s3 import read_dataframe_from_s3_parquet
dataset = read_dataframe_from_s3_parquet(
bucket_name="retrofit-data-dev",
file_key="sap_change_model/dataset_test.parquet",
)
z = dataset[dataset["CONSTITUENCY"].isin(["E14000707", "E14000909"])]
z["CONSTITUENCY"].value_counts()
z[z["CONSTITUENCY"] == "E14000909"]["UPRN"].sample(1)
self.data[self.data["UPRN"] == "100030549358"]
if __name__ == "__main__":
app()

View file

@ -68,6 +68,7 @@ class TestFloorRecommendations:
input_properties[2].wall_type = "solid brick"
input_properties[2].floor_type = "suspended"
input_properties[2].number_of_floors = 1
input_properties[2].floor_level = 0
recommender = FloorRecommendations(property_instance=input_properties[2], materials=materials)
assert recommender.estimated_u_value is None
@ -93,6 +94,8 @@ class TestFloorRecommendations:
input_properties[3].insulation_floor_area = 100
input_properties[3].insulation_wall_area = 100
input_properties[3].number_of_floors = 1
input_properties[3].floor_level = 0
recommender = FloorRecommendations(property_instance=input_properties[3], materials=materials)
assert recommender.estimated_u_value is None
recommender.recommend()
@ -114,6 +117,7 @@ class TestFloorRecommendations:
input_properties[4].wall_type = "solid brick"
input_properties[4].floor_type = "solid"
input_properties[4].number_of_floors = 1
input_properties[4].floor_level = 0
# In this case, we have no county, so in this case, it should yse the local-authority-label if possible
input_properties[4].data["county"] = ""

View file

@ -40,8 +40,7 @@ class TestLightingRecommendations:
assert lr.recommendation == [
{'parts': [], 'type': 'low_energy_lighting', 'description': 'Install low energy lighting in 4 outlets',
'starting_u_value': None, 'new_u_value': None, 'sap_points': 0.4, 'total': 458.976, 'subtotal': 382.48,
'vat': 76.49600000000001, 'contingency': 27.320000000000007, 'preliminaries': 27.320000000000007,
'material': 80.0, 'profit': 54.640000000000015, 'labour_hours': 3.2, 'labour_days': 0.4,
'labour_cost': 193.20000000000002}
'starting_u_value': None, 'new_u_value': None, 'sap_points': 0.4, 'total': 240.24,
'subtotal': 200.20000000000002, 'vat': 40.040000000000006, 'contingency': 14.3, 'preliminaries': 14.3,
'material': 80.0, 'profit': 28.6, 'labour_hours': 3.2, 'labour_days': 0.4, 'labour_cost': 63.0}
]