mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added additional room roof unit tests
This commit is contained in:
parent
ec7b4c7b47
commit
a2694de7e6
3 changed files with 114 additions and 3 deletions
|
|
@ -248,7 +248,7 @@ def extract_thickness(thickness, is_roof_room, is_at_rafters, is_loft, is_flat):
|
||||||
thickness_map = {
|
thickness_map = {
|
||||||
"below average": "50",
|
"below average": "50",
|
||||||
"average": "100",
|
"average": "100",
|
||||||
"above average": "270",
|
"above average": "150",
|
||||||
"none": "0",
|
"none": "0",
|
||||||
}
|
}
|
||||||
thickness = thickness_map[thickness]
|
thickness = thickness_map[thickness]
|
||||||
|
|
@ -287,7 +287,7 @@ def get_u_value_from_s9(
|
||||||
):
|
):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if thickness in [0, "0"] and is_loft:
|
if thickness in [0, "0"] and (is_loft or is_roof_room):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Determine the column to refer based on the roof type
|
# Determine the column to refer based on the roof type
|
||||||
|
|
|
||||||
|
|
@ -352,4 +352,115 @@ roof_uvalue_test_cases = [
|
||||||
'age_band': 'L',
|
'age_band': 'L',
|
||||||
'uvalue': 0.18
|
'uvalue': 0.18
|
||||||
},
|
},
|
||||||
|
# Room roof - age band A
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'none',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'A',
|
||||||
|
'uvalue': 2.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'below average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'A',
|
||||||
|
'uvalue': 0.68
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'A',
|
||||||
|
'uvalue': 0.4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'above average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'A',
|
||||||
|
'uvalue': 0.3
|
||||||
|
},
|
||||||
|
# Room roof - age band E
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'none',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'E',
|
||||||
|
'uvalue': 1.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'E',
|
||||||
|
'uvalue': 0.4
|
||||||
|
},
|
||||||
|
# Room roof - age band H
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'none',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'H',
|
||||||
|
'uvalue': 0.35
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'below average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'H',
|
||||||
|
'uvalue': 0.68
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'insulation_thickness': 'average',
|
||||||
|
'is_loft': False,
|
||||||
|
'is_roof_room': True,
|
||||||
|
'is_thatched': False,
|
||||||
|
'has_dwelling_above': False,
|
||||||
|
'is_flat': False,
|
||||||
|
'is_pitched': False,
|
||||||
|
'is_at_rafters': False,
|
||||||
|
'age_band': 'H',
|
||||||
|
'uvalue': 0.4
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ class TestRecommendationUtils:
|
||||||
}
|
}
|
||||||
|
|
||||||
u_value = recommendation_utils.get_roof_u_value(**inputs)
|
u_value = recommendation_utils.get_roof_u_value(**inputs)
|
||||||
assert u_value == 0.16, f"Expected 0.16, but got {u_value}"
|
assert u_value == 0.3, f"Expected 0.3, but got {u_value}"
|
||||||
|
|
||||||
def test_get_roof_u_value_case_8(self):
|
def test_get_roof_u_value_case_8(self):
|
||||||
# Test case where there is a dwelling above the roof, U-value should be 0
|
# Test case where there is a dwelling above the roof, U-value should be 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue