added new windows rec

This commit is contained in:
Khalim Conn-Kowlessar 2024-10-01 12:42:32 +01:00
parent 4118ad49f2
commit 1b7599015c
2 changed files with 10 additions and 35 deletions

View file

@ -502,43 +502,12 @@ class Property:
output["low_energy_lighting_ending"] = 100
output["lighting_energy_eff_ending"] = "Very Good"
if recommendation["type"] == "windows_glazing":
is_secondary_glazing = recommendation["is_secondary_glazing"]
output["multi_glaze_proportion_ending"] = 100
if output["windows_energy_eff_ending"] not in ["Average", "Good", "Very Good"]:
output["windows_energy_eff_ending"] = "Average" if not is_secondary_glazing else "Good"
if output["glazing_type_ending"] == "multiple":
pass
elif output["glazing_type_ending"] == "single":
output["glazing_type_ending"] = (
"secondary" if is_secondary_glazing else "double"
)
elif output["glazing_type_ending"] == "double":
output["glazing_type_ending"] = (
"multiple" if is_secondary_glazing else "double"
)
elif output["glazing_type_ending"] == "secondary":
output["glazing_type_ending"] = (
"secondary" if is_secondary_glazing else "multiple"
)
elif output["glazing_type_ending"] in ["triple", "high performance"]:
output["glazing_type_ending"] = "multiple"
else:
raise ValueError("Invalid glazing type - implement me")
if is_secondary_glazing:
output["glazed_type_ending"] = "secondary glazing"
else:
output["glazed_type_ending"] = (
"double glazing installed during or after 2002"
)
if recommendation["type"] in [
"heating", "hot_water_tank_insulation", "heating_control", "secondary_heating",
"internal_wall_insulation", "external_wall_insulation", "cavity_wall_insulation",
"cylinder_thermostat", "loft_insulation", "room_roof_insulation", "flat_roof_insulation",
"solid_floor_insulation", "suspended_floor_insulation", "mixed_glazing"
"solid_floor_insulation", "suspended_floor_insulation", "mixed_glazing",
"windows_glazing"
]:
# We update the data, as defined in the recommendaton
for prefix in ["walls", "roof", "floor"]:

View file

@ -634,15 +634,21 @@ class TestWindowRecommendations:
'number_habitable_rooms_starting': 4.0, 'number_habitable_rooms_ending': 4.0,
'number_heated_rooms_starting': 4.0, 'number_heated_rooms_ending': 4.0, 'days_to_starting': 3642,
'days_to_ending': 3713, 'estimated_perimeter_starting': 23.430749027719962,
'estimated_perimeter_ending': 23.430749027719962, 'id': '1+1'
'estimated_perimeter_ending': 23.430749027719962, 'has_glazing_ending': True,
'glazing_coverage_ending': 'full', 'id': '1+1'
}
assert simulated_data[0] == expected_simulated_outcome
# has_glazing_ending and glazing_coverage_ending are not in the starting record - test for this in case it
# changes
assert "has_glazing_ending" not in starting_record
assert "glazing_coverage_ending" not in starting_record
# Check which keys are different
different = []
for k in simulated_data[0].keys():
if k == "id":
if k in ["id", 'has_glazing_ending', 'glazing_coverage_ending']:
continue
if simulated_data[0][k] != starting_record[k]:
different.append(