From 9c0da8e95818aa283df3eb46933ea297238d05ec Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 8 Jun 2023 16:02:50 +0100 Subject: [PATCH] Added multiple cases to test_EpcClean --- epc_data/EpcClean.py | 107 +++++-- epc_data/app.py | 7 +- epc_data/tests/test_EpcClean.py | 104 +++---- .../test_data/EpcClean_test_roof_cases.py | 261 ++++++++++++++++++ 4 files changed, 377 insertions(+), 102 deletions(-) create mode 100644 epc_data/tests/test_data/EpcClean_test_roof_cases.py diff --git a/epc_data/EpcClean.py b/epc_data/EpcClean.py index a10edb84..08f024f2 100644 --- a/epc_data/EpcClean.py +++ b/epc_data/EpcClean.py @@ -1,9 +1,7 @@ import re -from typing import List, Dict, Any, Union, Tuple +from typing import List, Dict, Any, Union, Tuple, Optional from collections import Counter -import pandas as pd - class EpcClean: """ @@ -46,7 +44,6 @@ class EpcClean: **self.clean_roof(description) } ) - df = pd.DataFrame(self.cleaned["roof-description"]) def _init_empty_cleaned_obj(self) -> None: """ @@ -142,6 +139,54 @@ class EpcClean: return u_value, unit + @staticmethod + def _make_clean_roof_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. + + :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 + } + def clean_roof(self, description: str) -> Dict[str, Union[str, bool, int, None]]: """ We aim to extract features about the roof, so we can characterise it. We will check: @@ -157,24 +202,27 @@ class EpcClean: description_lower = description.lower().strip() if "another dwelling above" in description_lower or "other premises above" in description_lower: - return { - "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, - } + return self._make_clean_roof_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: @@ -192,16 +240,17 @@ class EpcClean: else: raise NotImplementedError("Not handled this") - attributes = { - "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, - "thermal_transmittence": thermal_transmittence, - "thermal_transmittence_unit": thermal_transmittence_unit - } - - return attributes + return self._make_clean_roof_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 + ) diff --git a/epc_data/app.py b/epc_data/app.py index 0ff21400..7788b7d2 100644 --- a/epc_data/app.py +++ b/epc_data/app.py @@ -1,5 +1,3 @@ -import pickle - from tqdm import tqdm from epc_data.temp_inputs import input_data @@ -37,3 +35,8 @@ def handler(): ) cleaner = EpcClean(data) + + cleaner.clean() + + import pandas as pd + df = pd.DataFrame(cleaner.cleaned["roof-description"]) diff --git a/epc_data/tests/test_EpcClean.py b/epc_data/tests/test_EpcClean.py index 5a2086cd..901d250e 100644 --- a/epc_data/tests/test_EpcClean.py +++ b/epc_data/tests/test_EpcClean.py @@ -2,6 +2,7 @@ import pytest import pickle from epc_data.EpcClean import EpcClean from pathlib import Path +from epc_data.tests.test_data.EpcClean_test_roof_cases import clean_roof_test_cases # For local testing if __file__ == "": @@ -11,95 +12,45 @@ else: input_data_path = current_file_path.parent / 'test_data' / 'EpcClean_inputs.obj' -# -# @pytest.fixture -# def data(): -# print("WOW") -# print(input_data_path) -# with open(input_data_path, 'rb') as f: -# data = pickle.load(f) -# return data -# -# -# def test_clean(data): -# epc = EpcClean(data) -# epc.clean() -# assert len(epc.cleaned["roof-description"]) == len(epc.unique_vals["roof-description"]) -# -# -# def test_clean_roof(data): -# epc = EpcClean(data) -# result = epc.clean_roof('Pitched, 270 mm loft insulation') -# -# # change the expected output based on your requirement -# expected_output = { -# "is_pitched": True, -# "is_roof_room": False, -# "has_loft": True, -# "insulation_thickness": 270, -# "has_dwelling_above": False, -# "assumed": False, -# "is_flat": False, -# "thermal_transmittence": None, -# "thermal_transmittence_unit": None -# } -# -# assert result == expected_output -# -# -# def test_clean_roof_with_dwelling_above(data): -# epc = EpcClean(data) -# result = epc.clean_roof('(another dwelling above)') -# -# expected_output = { -# "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, -# } -# -# assert result == expected_output - - class TestEpcClean: + + @staticmethod + def load_data(path): + with open(path, "rb") as file: + return pickle.load(file) + @pytest.fixture(autouse=True) - def load_data(self): - with open(input_data_path, "rb") as file: - self.data = pickle.load(file) - self.ec = EpcClean(self.data) + def setup_class(self): + self.cleaner = EpcClean(self.load_data(input_data_path)) def test_clean(self): - self.ec.clean() - assert len(self.ec.cleaned["roof-description"]) == len(self.ec.unique_vals["roof-description"]) + self.cleaner.clean() + assert len(self.cleaner.cleaned["roof-description"]) == len(self.cleaner.unique_vals["roof-description"]) def test__init_empty_cleaned_obj(self): - self.ec._init_empty_cleaned_obj() - assert all([len(values) == 0 for values in self.ec.cleaned.values()]) + self.cleaner._init_empty_cleaned_obj() + assert all([len(values) == 0 for values in self.cleaner.cleaned.values()]) def test__search_split_roof_description(self): - assert self.ec._search_split_roof_description("insulated") == "average" - assert self.ec._search_split_roof_description("limited") == "below average" + assert self.cleaner._search_split_roof_description("insulated") == "average" + assert self.cleaner._search_split_roof_description("limited") == "below average" with pytest.raises(NotImplementedError): - self.ec._search_split_roof_description("unknown") + self.cleaner._search_split_roof_description("unknown") def test__find_insulation_thickness(self): - assert self.ec._find_insulation_thickness("no insulation", False, False, False) == 0 + assert self.cleaner._find_insulation_thickness("no insulation", False, False, False) == 0 def test__extract_thermal_transmittence(self): description = "U-value of 2.3 w/m-¦k" - assert self.ec._extract_thermal_transmittence(description) == (2.3, "w/m-¦k") + assert self.cleaner._extract_thermal_transmittence(description) == (2.3, "w/m-¦k") def test_clean_roof(self): - result = self.ec.clean_roof('Pitched, 270 mm loft insulation') + result = self.cleaner.clean_roof('Pitched, 270 mm loft insulation') # change the expected output based on your requirement expected_output = { + "is_valid": True, + "at_rafters": False, "is_pitched": True, "is_roof_room": False, "has_loft": True, @@ -107,16 +58,27 @@ class TestEpcClean: "has_dwelling_above": False, "assumed": False, "is_flat": False, + "is_thatched": False, "thermal_transmittence": None, "thermal_transmittence_unit": None } assert result == expected_output + for test_case in clean_roof_test_cases: + result = self.cleaner.clean_roof(test_case['original_description']) + # Ensure the output ordering is correct + expected_result = {key: test_case[key] for key in result.keys()} + expected_result["desc"] = test_case["original_description"] + result["desc"] = test_case["original_description"] + assert result == expected_result + def test_clean_roof_with_dwelling_above(self): - result = self.ec.clean_roof('(another dwelling above)') + result = self.cleaner.clean_roof('(another dwelling above)') expected_output = { + "is_valid": True, + "at_rafters": False, "is_pitched": False, "is_roof_room": False, "has_loft": False, diff --git a/epc_data/tests/test_data/EpcClean_test_roof_cases.py b/epc_data/tests/test_data/EpcClean_test_roof_cases.py new file mode 100644 index 00000000..344d4b55 --- /dev/null +++ b/epc_data/tests/test_data/EpcClean_test_roof_cases.py @@ -0,0 +1,261 @@ +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}]