refactored roof attributes and extended unit tests

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-13 11:36:23 +01:00
parent 3305d1464a
commit 66a18cf39d
7 changed files with 425 additions and 446 deletions

View file

@ -51,6 +51,6 @@ class EpcClean:
self.cleaned[field].append(
{
"original_description": description,
**cleaning_cls(description).clean()
**cleaning_cls(description).process()
}
)

View file

@ -40,11 +40,11 @@ def handler():
cleaner.clean()
# For testing:
from epc_data.attributes.WallAttributes import WallAttributes
descriptions = {x["walls-description"] for x in data}
from epc_data.attributes.RoofAttributes import RoofAttributes
descriptions = {x["roof-description"] for x in data}
out = []
for description in descriptions:
res = WallAttributes(description).process()
res = RoofAttributes(description).process()
out.append(
{
"original_description": description,

View file

@ -12,9 +12,9 @@ class FloorAttributes:
"""
self.description: str = description
def clean(self) -> Dict[str, Union[str, bool, int, None]]:
def process(self) -> Dict[str, Union[str, bool, int, None]]:
"""
Cleans the given description based on predefined rules.
Processes the given description based on predefined rules.
:return: Cleaned data in a dictionary format.
"""

View file

@ -1,178 +1,69 @@
from typing import Dict, Union, Optional
from epc_data.attributes.attribute_utils import extract_thermal_transmittence, search_split_description
import re
from typing import Dict, Union
class RoofAttributes:
def __init__(self, description):
def __init__(self, description: str):
"""
:param description: Description of the roof.
"""
self.description: str = description
def clean(self) -> Dict[str, Union[str, bool, int, None]]:
"""
We aim to extract features about the roof, so we can characterise it. We will check:
- If the roof is pitched
- If there is a room roof
- if there is a loft
- If it has insulation
- if so, what degree of insulation
def process(self) -> Dict[str, Union[float, str, bool, None]]:
result: Dict[str, Union[float, str, bool, None]] = {}
description = self.description.lower()
:return: Dictionary of attributes of the roof.
"""
description_lower = self.description.lower().strip()
if "another dwelling above" in description_lower or "other premises above" in description_lower:
return self._make_clean_output(
is_valid="invalid" not in description_lower,
at_rafters="at rafters" in description_lower,
is_pitched=False,
is_roof_room=False,
has_loft=False,
insulation_thickness=0,
has_dwelling_above=True,
assumed="assumed" in description_lower,
is_flat="flat" in description_lower,
is_thatched=False,
thermal_transmittence=None,
thermal_transmittence_unit=None
)
is_pitched = "pitched" in description_lower
is_roof_room = "roof room" in description_lower
has_loft = "loft" in description_lower
is_flat = "flat" in description_lower
is_thatched = "thatched" in description_lower
at_rafters = "at rafters" in description_lower
thermal_transmittence, thermal_transmittence_unit, insulation_thickness = None, None, None
if "insulation" in description_lower or "insulated" in description_lower:
insulation_thickness = self._find_insulation_thickness(description_lower, is_pitched, is_roof_room, is_flat)
elif "thermal transmittance" in description_lower:
thermal_transmittence, thermal_transmittence_unit = extract_thermal_transmittence(description_lower)
elif is_thatched:
# Search for these features:
thermal_transmittence, thermal_transmittence_unit = extract_thermal_transmittence(description_lower)
insulation_thickness = self._find_insulation_thickness(
description_lower, is_pitched, is_roof_room, is_flat
)
elif description_lower == "pitched":
thermal_transmittence, thermal_transmittence_unit, insulation_thickness = None, None, None
# thermal transmittance
match = re.search(r"average thermal transmittance (-?\d+\.\d+)\s(w/m-¦k)", description)
if match:
result['thermal_transmittance'] = float(match.group(1))
result['thermal_transmittance_unit'] = match.group(2)
# Remove the match from the description
description = re.sub(r"average thermal transmittance (-?\d+\.\d+)\s(w/m-¦k)", "", description)
else:
raise NotImplementedError("Not handled this")
result['thermal_transmittance'] = None
result['thermal_transmittance_unit'] = None
return self._make_clean_output(
is_valid="invalid" not in description_lower,
at_rafters=at_rafters,
is_pitched=is_pitched,
is_roof_room=is_roof_room,
has_loft=has_loft,
insulation_thickness=insulation_thickness,
has_dwelling_above=False,
assumed="assumed" in description_lower,
is_flat=is_flat,
is_thatched=is_thatched,
thermal_transmittence=thermal_transmittence,
thermal_transmittence_unit=thermal_transmittence_unit
# roof type
roof_types = ['pitched', 'roof room', 'loft', 'flat', 'thatched', 'at rafters', 'assumed']
for rt in roof_types:
result[f'is_{rt.replace(" ", "_")}'] = rt in description
# Remove the roof type from the description
description = description.replace(rt, "")
result["has_dwelling_above"] = (
"another dwelling above" in description or "other premises above" in description
)
for dwelling_above in ["another dwelling above", "other premises above"]:
description = description.replace(dwelling_above, "")
@staticmethod
def _make_clean_output(
is_valid: bool,
at_rafters: bool,
is_pitched: bool,
is_roof_room: bool,
has_loft: bool,
insulation_thickness: str | int | None,
has_dwelling_above: bool,
assumed: bool,
is_flat: bool,
is_thatched: bool,
thermal_transmittence: Optional[float],
thermal_transmittence_unit: Optional[str]
) -> Dict[str, Union[bool, str, None]]:
"""
Utility function to ensure all the keys are present in the output.
result["is_valid"] = "invalid" not in description
description = description.replace("invalid", "")
:param is_valid: True if the roof descrption is valid, False otherwise
:param at_rafters: True if the insulation is at the rafters, False otherwise
:param is_pitched: True if the roof is pitched, False otherwise
:param is_roof_room: True if there is a room in the roof, False otherwise
:param has_loft: True if there is a loft, False otherwise
:param insulation_thickness: The thickness of the insulation
:param has_dwelling_above: True if there is a dwelling above, False otherwise
:param assumed: True if the roof type was assumed based on property age, False otherwise
:param is_flat: True if the roof is flat, False otherwise
:param is_thatched: True if the roof is thatched, False otherwise
:param thermal_transmittence: The thermal transmittence value of the roof, if known
:param thermal_transmittence_unit: The unit of thermal transmittence, if known
:return: A dictionary containing all the information about the roof.
"""
return {
"is_valid": is_valid,
"at_rafters": at_rafters,
"is_pitched": is_pitched,
"is_roof_room": is_roof_room,
"has_loft": has_loft,
"insulation_thickness": insulation_thickness,
"has_dwelling_above": has_dwelling_above,
"assumed": assumed,
"is_flat": is_flat,
"is_thatched": is_thatched,
"thermal_transmittence": thermal_transmittence,
"thermal_transmittence_unit": thermal_transmittence_unit
# insulation thickness
thickness_map = {
"ceiling insulated": "average",
"insulated": "average",
"limited": "below average",
"no insulation": "none",
"limited insulation": "below average",
"additional insulation": "above average",
}
for key, value in thickness_map.items():
if key in description:
result['insulation_thickness'] = value
# Remove the match from the description
# description = description.replace(key, "")
break
else:
# Extract insulation thickness in mm, if present
match = re.search(r'(\d+\+?)\s*mm', description)
if match:
result['insulation_thickness'] = match.group(1)
@staticmethod
def _find_insulation_thickness(
description_lower: str, is_pitched: bool, is_roof_room: bool, is_flat: bool
) -> Union[int, str, None]:
"""
Finds insulation thickness in the description.
if "insulation_thickness" not in result:
result['insulation_thickness'] = None
:param description_lower: Lowercase description.
:param is_pitched: Whether the roof is pitched.
:param is_roof_room: Whether there is a room in the roof.
:param is_flat: Whether the roof is flat.
:return: Insulation thickness if found, else None.
"""
if "no insulation" in description_lower:
return 0
if is_pitched:
try:
thickness = description_lower.split("pitched,")[-1].split("mm")[0].strip()
if "+" in thickness:
return thickness
try:
return int(thickness)
except ValueError as int_error:
raise ValueError(int_error)
except ValueError as _:
if "invalid input" in description_lower:
return None
desc = description_lower.split("pitched,")[-1].strip().split(" ")[0]
return search_split_description(desc)
if is_roof_room:
desc_split_lookup = {
"ceiling insulated": "average",
"thatched": "average",
}
# Just search for specific phrases
desc_split = description_lower.split("roof room(s),")[-1].strip()
res = desc_split_lookup.get(desc_split)
if res:
return res
desc = desc_split.split(" ")[0]
return search_split_description(desc)
if is_flat:
# Just search for specific phrases
desc = description_lower.split("flat,")[-1].lstrip().split(" ")[0]
return search_split_description(desc)
return None
return result

View file

@ -1,261 +1,348 @@
clean_roof_test_cases = [
{'original_description': 'Flat, limited insulation (assumed)', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 'below average', 'has_dwelling_above': False, 'assumed': True,
'is_flat': True, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': '(another dwelling above)', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 0, 'has_dwelling_above': True, 'assumed': False, 'is_flat': False, 'is_thatched': False,
'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, insulated (assumed)', 'is_pitched': True, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': True,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Flat, insulated (assumed)', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': True, 'is_flat': True,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 200 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 200, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 50 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 50, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, no insulation (assumed)', 'is_pitched': True, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 0, 'has_dwelling_above': False, 'assumed': True, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 150 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 150, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Flat, no insulation (assumed)', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 0, 'has_dwelling_above': False, 'assumed': True, 'is_flat': True,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Roof room(s), insulated (assumed)', 'is_pitched': False, 'is_roof_room': True,
'has_loft': False, 'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': True,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, 350 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 350, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 300 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 300, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.14 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.14, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, no insulation', 'is_pitched': True, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 0, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False, 'is_thatched': False,
'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, 100 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 100, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': '(other premises above)', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 0, 'has_dwelling_above': True, 'assumed': False, 'is_flat': False, 'is_thatched': False,
'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, 270 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 270, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, limited insulation (assumed)', 'is_pitched': True, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 'below average', 'has_dwelling_above': False, 'assumed': True,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, 250 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 250, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, insulated at rafters', 'is_pitched': True, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': False,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': True},
{'original_description': 'Pitched', 'is_pitched': True, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Roof room(s), insulated', 'is_pitched': False, 'is_roof_room': True, 'has_loft': False,
'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 75 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 75, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Roof room(s), no insulation (assumed)', 'is_pitched': False, 'is_roof_room': True,
'has_loft': False, 'insulation_thickness': 0, 'has_dwelling_above': False, 'assumed': True, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Flat, insulated', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': False, 'is_flat': True,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.1 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.1, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, *** INVALID INPUT Code : 57 *** loft insulation', 'is_pitched': True,
'is_roof_room': False, 'has_loft': True, 'insulation_thickness': None, 'has_dwelling_above': False,
'assumed': False, 'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None,
'thermal_transmittence_unit': None, 'is_valid': False, 'at_rafters': False},
{'original_description': 'Pitched, 12 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 12, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.10 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.1, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.13 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.13, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.11 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.11, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Roof room(s), ceiling insulated', 'is_pitched': False, 'is_roof_room': True,
'has_loft': False, 'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': False,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.12 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.12, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.20 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.2, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.16 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.16, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.15 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.15, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 0 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 0, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.08 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.08, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Flat, limited insulation', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 'below average', 'has_dwelling_above': False, 'assumed': False, 'is_flat': True,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Roof room(s), limited insulation (assumed)', 'is_pitched': False, 'is_roof_room': True,
'has_loft': False, 'insulation_thickness': 'below average', 'has_dwelling_above': False, 'assumed': True,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Pitched, insulated', 'is_pitched': True, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': 'average', 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.18 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.18, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, limited insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': 'below average', 'has_dwelling_above': False, 'assumed': False,
'is_flat': False, 'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None,
'is_valid': True, 'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.19 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.19, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.17 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.17, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.48 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.48, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.42 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.42, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.58 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.58, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.45 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.45, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 1.00 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 1.0, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.2 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.2, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 400+ mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': '400+', 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 25 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 25, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.49 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.49, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.37 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.37, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Thatched', 'is_pitched': False, 'is_roof_room': False, 'has_loft': False,
'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False, 'is_thatched': True,
'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True, 'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.09 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.09, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.21 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.21, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.24 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.24, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Pitched, 400 mm loft insulation', 'is_pitched': True, 'is_roof_room': False,
'has_loft': True, 'insulation_thickness': 400, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.23 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.23, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.28 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.28, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.4 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.4, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Thatched, with additional insulation', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': True, 'thermal_transmittence': None, 'thermal_transmittence_unit': None, 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.26 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.26, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False},
{'original_description': 'Average thermal transmittance 0.22 W/m-¦K', 'is_pitched': False, 'is_roof_room': False,
'has_loft': False, 'insulation_thickness': None, 'has_dwelling_above': False, 'assumed': False, 'is_flat': False,
'is_thatched': False, 'thermal_transmittence': 0.22, 'thermal_transmittence_unit': 'w/m-¦k', 'is_valid': True,
'at_rafters': False}]
{'original_description': '(another dwelling above)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': True, 'is_valid': True,
'insulation_thickness': None},
{'original_description': '(other premises above)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None,
'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': True, 'is_valid': True,
'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.06 W/m-¦K', 'thermal_transmittance': 0.06,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.07 W/m-¦K', 'thermal_transmittance': 0.07,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.08 W/m-¦K', 'thermal_transmittance': 0.08,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.09 W/m-¦K', 'thermal_transmittance': 0.09,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.1 W/m-¦K', 'thermal_transmittance': 0.1,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.10 W/m-¦K', 'thermal_transmittance': 0.1,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.11 W/m-¦K', 'thermal_transmittance': 0.11,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.12 W/m-¦K', 'thermal_transmittance': 0.12,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.13 W/m-¦K', 'thermal_transmittance': 0.13,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.14 W/m-¦K', 'thermal_transmittance': 0.14,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.15 W/m-¦K', 'thermal_transmittance': 0.15,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.16 W/m-¦K', 'thermal_transmittance': 0.16,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.17 W/m-¦K', 'thermal_transmittance': 0.17,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.18 W/m-¦K', 'thermal_transmittance': 0.18,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.19 W/m-¦K', 'thermal_transmittance': 0.19,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.2 W/m-¦K', 'thermal_transmittance': 0.2,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.20 W/m-¦K', 'thermal_transmittance': 0.2,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.21 W/m-¦K', 'thermal_transmittance': 0.21,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.22 W/m-¦K', 'thermal_transmittance': 0.22,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.23 W/m-¦K', 'thermal_transmittance': 0.23,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.24 W/m-¦K', 'thermal_transmittance': 0.24,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.25 W/m-¦K', 'thermal_transmittance': 0.25,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.26 W/m-¦K', 'thermal_transmittance': 0.26,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.27 W/m-¦K', 'thermal_transmittance': 0.27,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.28 W/m-¦K', 'thermal_transmittance': 0.28,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.29 W/m-¦K', 'thermal_transmittance': 0.29,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.3 W/m-¦K', 'thermal_transmittance': 0.3,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.30 W/m-¦K', 'thermal_transmittance': 0.3,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.31 W/m-¦K', 'thermal_transmittance': 0.31,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.32 W/m-¦K', 'thermal_transmittance': 0.32,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.33 W/m-¦K', 'thermal_transmittance': 0.33,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.34 W/m-¦K', 'thermal_transmittance': 0.34,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.35 W/m-¦K', 'thermal_transmittance': 0.35,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.36 W/m-¦K', 'thermal_transmittance': 0.36,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.37 W/m-¦K', 'thermal_transmittance': 0.37,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.38 W/m-¦K', 'thermal_transmittance': 0.38,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.4 W/m-¦K', 'thermal_transmittance': 0.4,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.42 W/m-¦K', 'thermal_transmittance': 0.42,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.44 W/m-¦K', 'thermal_transmittance': 0.44,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.45 W/m-¦K', 'thermal_transmittance': 0.45,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.48 W/m-¦K', 'thermal_transmittance': 0.48,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.49 W/m-¦K', 'thermal_transmittance': 0.49,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.58 W/m-¦K', 'thermal_transmittance': 0.58,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.70 W/m-¦K', 'thermal_transmittance': 0.7,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.89 W/m-¦K', 'thermal_transmittance': 0.89,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 0.94 W/m-¦K', 'thermal_transmittance': 0.94,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 1.00 W/m-¦K', 'thermal_transmittance': 1.0,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 1.19 W/m-¦K', 'thermal_transmittance': 1.19,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Average thermal transmittance 2.30 W/m-¦K', 'thermal_transmittance': 2.3,
'thermal_transmittance_unit': 'w/m-¦k', 'is_pitched': False, 'is_roof_room': False, 'is_loft': False,
'is_flat': False, 'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False,
'is_valid': True, 'insulation_thickness': None},
{'original_description': 'Flat, insulated', 'thermal_transmittance': None, 'thermal_transmittance_unit': None,
'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Flat, insulated (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Flat, limited insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'below average'},
{'original_description': 'Flat, limited insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'below average'},
{'original_description': 'Flat, no insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': True,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'none'},
{'original_description': 'Pitched', 'thermal_transmittance': None, 'thermal_transmittance_unit': None,
'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': None},
{'original_description': 'Pitched, *** INVALID INPUT Code : 57 *** loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': False,
'insulation_thickness': None},
{'original_description': 'Pitched, 0 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '0'},
{'original_description': 'Pitched, 100 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '100'},
{'original_description': 'Pitched, 12 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '12'},
{'original_description': 'Pitched, 150 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '150'},
{'original_description': 'Pitched, 200 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '200'},
{'original_description': 'Pitched, 25 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '25'},
{'original_description': 'Pitched, 250 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '250'},
{'original_description': 'Pitched, 270 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '270'},
{'original_description': 'Pitched, 300 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '300'},
{'original_description': 'Pitched, 350 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '350'},
{'original_description': 'Pitched, 400 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '400'},
{'original_description': 'Pitched, 400+ mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '400+'},
{'original_description': 'Pitched, 50 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '50'},
{'original_description': 'Pitched, 75 mm loft insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': True, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': '75'},
{'original_description': 'Pitched, insulated', 'thermal_transmittance': None, 'thermal_transmittance_unit': None,
'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Pitched, insulated (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Pitched, insulated at rafters', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': True, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Pitched, limited insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'below average'},
{'original_description': 'Pitched, limited insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'below average'},
{'original_description': 'Pitched, no insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None,
'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'none'},
{'original_description': 'Pitched, no insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': True, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'none'},
{'original_description': 'Roof room(s), ceiling insulated', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Roof room(s), insulated', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Roof room(s), insulated (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'average'},
{'original_description': 'Roof room(s), limited insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'below average'},
{'original_description': 'Roof room(s), no insulation (assumed)', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': True, 'is_loft': False, 'is_flat': False,
'is_thatched': False, 'is_at_rafters': False, 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'none'},
{'original_description': 'Thatched', 'thermal_transmittance': None, 'thermal_transmittance_unit': None,
'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': True,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': None},
{'original_description': 'Thatched, with additional insulation', 'thermal_transmittance': None,
'thermal_transmittance_unit': None, 'is_pitched': False, 'is_roof_room': False, 'is_loft': False, 'is_flat': False,
'is_thatched': True, 'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
'insulation_thickness': 'above average'}
]

View file

@ -64,7 +64,7 @@ class TestEpcClean:
def test_clean_floor(self):
for test_case in clean_floor_cases:
result = FloorAttributes(test_case['original_description']).clean()
result = FloorAttributes(test_case['original_description']).process()
# Ensure the output ordering is correct
expected_result = {key: test_case[key] for key in result.keys()}
expected_result["desc"] = test_case["original_description"]

View file

@ -32,32 +32,32 @@ class TestEpcClean:
self.cleaner._init_empty_cleaned_obj()
assert all([len(values) == 0 for values in self.cleaner.cleaned.values()])
def test__find_insulation_thickness(self):
assert RoofAttributes._find_insulation_thickness("no insulation", False, False, False) == 0
def test_clean_roof(self):
result = RoofAttributes('Pitched, 270 mm loft insulation').clean()
result = RoofAttributes('Pitched, 270 mm loft insulation').process()
# change the expected output based on your requirement
expected_output = {
"is_valid": True,
"at_rafters": False,
"is_at_rafters": False,
"is_pitched": True,
"is_roof_room": False,
"has_loft": True,
"insulation_thickness": 270,
"is_loft": True,
"insulation_thickness": "270",
"has_dwelling_above": False,
"assumed": False,
"is_assumed": False,
"is_flat": False,
"is_thatched": False,
"thermal_transmittence": None,
"thermal_transmittence_unit": None
"thermal_transmittance": None,
"thermal_transmittance_unit": None
}
for k in expected_output:
assert result[k] == expected_output[k]
assert result == expected_output
for test_case in clean_roof_test_cases:
result = RoofAttributes(test_case['original_description']).clean()
result = RoofAttributes(test_case['original_description']).process()
# Ensure the output ordering is correct
expected_result = {key: test_case[key] for key in result.keys()}
expected_result["desc"] = test_case["original_description"]
@ -65,21 +65,22 @@ class TestEpcClean:
assert result == expected_result
def test_clean_roof_with_dwelling_above(self):
result = RoofAttributes('(another dwelling above)').clean()
result = RoofAttributes('(another dwelling above)').process()
expected_output = {
"is_valid": True,
"at_rafters": False,
"is_at_rafters": False,
"is_pitched": False,
"is_roof_room": False,
"has_loft": False,
"insulation_thickness": 0,
"is_loft": False,
"insulation_thickness": None,
"has_dwelling_above": True,
"assumed": False,
"is_assumed": False,
"is_flat": False,
"is_thatched": False,
"thermal_transmittence": None,
"thermal_transmittence_unit": None,
"thermal_transmittance": None,
"thermal_transmittance_unit": None,
}
assert result == expected_output
for k in expected_output:
assert result[k] == expected_output[k]