From ac854f161a7eb9d7cc3b97dcdef6735e6035b3e8 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 21 Apr 2026 10:40:07 +0000 Subject: [PATCH] =?UTF-8?q?extract=20water=20heating=20cylinder=20thicknes?= =?UTF-8?q?s=20=F0=9F=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fixtures/site_notes_example_2_text.json | 737 ++++++++++++++++++ .../documents_parser/tests/test_extractor.py | 16 + 2 files changed, 753 insertions(+) create mode 100644 backend/documents_parser/tests/fixtures/site_notes_example_2_text.json diff --git a/backend/documents_parser/tests/fixtures/site_notes_example_2_text.json b/backend/documents_parser/tests/fixtures/site_notes_example_2_text.json new file mode 100644 index 00000000..fb4ae41c --- /dev/null +++ b/backend/documents_parser/tests/fixtures/site_notes_example_2_text.json @@ -0,0 +1,737 @@ +[ + "SMART EPC: Record of", + "Inspection & Site Notes", + "Inspection Surveyor:", + "Rebecca Mcwilliam", + "E-Mail Address:", + "rebeccamcdea@gmail.com", + "Report Reference:", + "ADD992DF-BE9B-47EB-8121-4C6143C6A7C9", + "Created On:", + "15 October 2025", + "Date of Inspection:", + "13 October 2025", + "Property Address:", + "13,", + "Sandfield Avenue ,", + "Wrenbury,", + "CW5 8EU", + "Property Photo", + "Page 1", + "", + "Photo of electricity meter:", + "Photo of electricity meter:", + "Photo of electricity meter:", + "Photo of electricity meter:", + "RdSAP Assessment", + "General", + "Confirm you have checked for the existence of an", + "EPC before carrying out another energy assessment.", + "Yes", + "Does an EPC exist at the point of carrying out this", + "energy assessment?", + "Yes", + "Please select why another energy assessment needs", + "to be undertaken:", + "Assessor instructed to produce a new EPC upon request from building", + "owner/tenant/landlord after confirming to the requestor that a valid EPC", + "already exists", + "Inspection Date:", + "13/10/2025", + "Transaction Type:", + "None of the Above", + "Tenure:", + "Rented Social", + "Type of Property:", + "House", + "Detachment Type:", + "End-terrace", + "Number of storeys:", + "2 Storeys", + "Terrain Type:", + "Suburban", + "Number of Extensions:", + "No Extensions", + "Is an electricity smart meter present?", + "Yes", + "Electric meter type:", + "Single", + "Page 2", + "", + "Photo of electricity meter:", + "Photo of electricity meter:", + "External indicators of Cavity Wall Construction:", + "Is the dwelling export-capable?", + "Yes", + "Is mains gas available?", + "No", + "Select Measurements Location:", + "Internal", + "Building Construction", + "Main Building", + "Age Range:", + "1950-1966", + "Record indicators of property age:", + "local knowledge, enquiries of owner, period building features", + "Walls - Construction Type:", + "Cavity", + "Record external indicators of Cavity Construction:", + "stretcher bond, wall thickness over 270 mm", + "Walls - Insulation Type:", + "Filled Cavity", + "Record indicators of filled cavity:", + "evidence of cavity fill drill holes, Boroscope", + "Page 3", + "", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Page 4", + "", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Page 5", + "", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Page 6", + "", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Page 7", + "", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Photo indicators of filled cavity insulation:", + "Page 8", + "", + "Photo wall thickness:", + "Photo wall thickness:", + "Thermal conductivity of wall insulation:", + "Unknown", + "Wall U-Value known?", + "Not Known", + "Wall thickness:", + "300 mm", + "Party wall construction type:", + "Unable to determine", + "Floor type:", + "Ground Floor", + "Floor Construction:", + "Solid", + "Floor Insulation Type:", + "As Built", + "Floor U-Value known?", + "Not Known", + "Building Measurements", + "Area (m2)", + "Height (m)", + "Heat Loss Perimeter (m)", + "PWL (m)", + "Main Building", + "Floor 1", + "43.29", + "2.45", + "19.74", + "6.58", + "Floor 0", + "43.29", + "2.46", + "19.74", + "6.58", + "Roof Space", + "Main Building", + "Roofs - Construction Type:", + "Pitched roof (Slates or tiles), Access to loft", + "Roofs - Insulation At:", + "Joists", + "Roof U-Value:", + "Not Known", + "Roofs - Insulation Thickness:", + "150 mm", + "Page 9", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 10", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 11", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 12", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 13", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 14", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Page 15", + "", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Loft insulation:", + "Record indicators of Cavity Wall Construction in roof", + "space:", + "No indicator of construction visible", + "Page 16", + "", + "Record indicators of party wall construction in roof space:", + "Are there rooms in the roof?", + "No", + "Windows", + "Window 1", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "1.27 m", + "Window width:", + "1.55 m", + "Orientation:", + "North West", + "Page 17", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Window 2", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.97 m", + "Window width:", + "1.04 m", + "Orientation:", + "North West", + "Page 18", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Window 3", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.97 m", + "Window width:", + "1.53 m", + "Orientation:", + "North West", + "Window 4", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing, Unknown install date", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Page 19", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "What size is the glazing gap?", + "12 mm", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.98 m", + "Window width:", + "0.57 m", + "Orientation:", + "North West", + "Window 5", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Thermal spacer bar", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "1.29 m", + "Window width:", + "0.57 m", + "Orientation:", + "South West", + "Page 20", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Window 6", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.98 m", + "Window width:", + "0.53 m", + "Orientation:", + "South West", + "Window 7", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Thermal spacer bar", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.98 m", + "Window width:", + "1.09 m", + "Orientation:", + "South East", + "Page 21", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Window 8", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.96 m", + "Window width:", + "1.54 m", + "Orientation:", + "South East", + "Page 22", + "", + "Photo of glazing type:", + "Window 9", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing installed between 2002 - 2021", + "Identify basis of window dating:", + "Manufacturing date stamp", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.97 m", + "Window width:", + "1.53 m", + "Orientation:", + "South East", + "Window 10", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing, Unknown install date", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "What size is the glazing gap?", + "12 mm", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.95 m", + "Window width:", + "1.04 m", + "Orientation:", + "South East", + "Page 23", + "", + "Photo of glazing type:", + "Photo of glazing type:", + "Photo of glazing type:", + "Window 11", + "Window location:", + "Main Building", + "Window wall type:", + "External wall", + "Glazing Type:", + "Double glazing, Unknown install date", + "Window type:", + "Window", + "Window frame type:", + "Wooden or PVC", + "What size is the glazing gap?", + "12 mm", + "Is the window draught proofed?", + "Yes", + "Are there permanent shutters present?", + "No", + "Window height:", + "0.97 m", + "Window width:", + "1.53 m", + "Orientation:", + "South East", + "Page 24", + "", + "Photo of heating system:", + "Photo of heating system:", + "Photo of heating system:", + "Photo of heating system:", + "Heating & Hot Water", + "Main Heating Systems", + "Main Heating 1", + "How would you like to select the Heating System?", + "Manual Entry", + "System type:", + "Room heaters", + "Fuel:", + "Dual fuel appliance (mineral and wood)", + "Heating System (Other):", + "Open fire with back boiler (No radiators)", + "Controls:", + "No thermostatic control of room temperature", + "Secondary Heating System", + "Secondary Fuel", + "Dual Fuel Appliance (Mineral and Wood)", + "Secondary System:", + "Open fire in grate", + "Page 25", + "", + "Photo of secondary heating system", + "Photo of water heating system:", + "Photo of water heating system:", + "Water Heating & Cylinder", + "Water Heating Type:", + "Regular", + "Water Heating System:", + "From main heating 1", + "Page 26", + "", + "Photo of water heating system:", + "Photo of water heating system:", + "Photo of water heating system:", + "Photo of water heating system:", + "Page 27", + "", + "Photo of water heating system:", + "Photo of cylinder and thermostat if present:", + "Photo of cylinder and thermostat if present:", + "Photo of ventilation type:", + "Cylinder Size:", + "Normal (90-130 litres)", + "What is the cylinder measured heat loss:", + "Not known", + "Insulation Type:", + "Factory fitted", + "Thickness:", + "38 mm", + "Has thermostat?", + "No", + "Ventilation", + "Ventilation type:", + "Mechanical Extract - Decentralised", + "Has fixed air conditioning?", + "No", + "Is the ventilation in the PCDF database?", + "No", + "Page 28", + "", + "Photo of boiler flues:", + "Photo of extract fans:", + "Number of open flues:", + "0", + "Number of closed flues:", + "0", + "Number of boiler flues:", + "1", + "Number of other flues:", + "0", + "Number of extract fans:", + "1", + "Number of passive vents:", + "0", + "Number of flueless gas fires:", + "0", + "Pressure test:", + "No test", + "Is there a draught lobby?", + "No", + "Conservatories", + "Is there conservatory?", + "No conservatory", + "Page 29", + "", + "Photo of open chimneys:", + "Renewables", + "Wind Turbines", + "Has wind turbines?", + "No", + "Solar hot water", + "Has solar hot water?", + "No", + "Photovoltaics", + "Has photovoltaic array?", + "No", + "Number of PV batteries:", + "None", + "Hydro", + "Is the dwelling connected to Hydro?", + "No", + "Room Count Elements", + "Number of habitable rooms?", + "5", + "Are any of these rooms unheated?", + "Yes", + "Please enter the number of HEATED rooms:", + "0", + "Number of external doors?", + "2", + "Number of insulated external doors?", + "0", + "Number of draughtproofed external doors?", + "2", + "Number of open chimneys?", + "1", + "Number of blocked chimneys?", + "1", + "Page 30", + "", + "Photo of blocked chimneys:", + "Photo of blocked chimneys:", + "Photo of blocked chimneys:", + "Photo of incandescent bulbs:", + "Number of fixed incandescent bulbs:", + "1", + "Is the exact number of LED and CFL bulbs known?", + "Yes", + "Number of fixed LED bulbs:", + "4", + "Page 31", + "", + "Photo of LED bulbs:", + "Photo of LED bulbs:", + "Photo of LED bulbs:", + "Photo of LED bulbs:", + "Photo of CFL bulbs:", + "Photo of CFL bulbs:", + "Number of fixed CFL bulbs:", + "4", + "Page 32", + "", + "Photo of CFL bulbs:", + "Photo of CFL bulbs:", + "Photo of shower:", + "Photo of shower:", + "Are there any waste water heat recovery systems?", + "None", + "Number of baths:", + "1", + "How many special features are there at the", + "property?", + "0", + "Showers", + "Shower 1", + "Shower outlet type:", + "Electric Shower", + "Page 33", + "", + "Photo of shower:", + "Customer Response", + "Customer present?", + "Yes", + "Customer willing to answer satisfaction survey?", + "No", + "Addendum + Related Party Disclosure", + "Addendum", + "None", + "Related party disclosure", + "No related party", + "Hard to treat cavity walls: Property has access", + "issues?", + "No", + "Hard to treat cavity walls: Property has high", + "exposure?", + "No", + "Hard to treat cavity walls: Property has narrow", + "cavities?", + "No", + "Photographs Required", + "Page 34", + "", + "General Photos:", + "General Photos:", + "General Photos:", + "General Photos:", + "External Elevations:", + "External Elevations:", + "Page 35", + "", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "External Elevations:", + "Page 36", + "", + "External Elevations:", + "Page 37", + "", + "Page 38", + "", + "Page 39", + "", + "Page 40", + "", + "Additional Notes", + "Additional Notes", + "Over the years Tenant has refused any sort of heating system upgrade so the", + "property only has an open fire with back boiler in the living room. There are no", + "radiators in habitable rooms. The only radiator is in the bathroom. The hot", + "water cylinder is connected to the back boiler and there is also a backup", + "emersion.", + "Page 41", + "" +] \ No newline at end of file diff --git a/backend/documents_parser/tests/test_extractor.py b/backend/documents_parser/tests/test_extractor.py index 9f672956..6ca35110 100644 --- a/backend/documents_parser/tests/test_extractor.py +++ b/backend/documents_parser/tests/test_extractor.py @@ -41,6 +41,11 @@ def load_text_fixture() -> list[str]: return json.load(f) +def load_text_fixture_2() -> list[str]: + with open(os.path.join(FIXTURES, "site_notes_example_2_text.json")) as f: + return json.load(f) + + class TestInspectionMetadata: def test_full_inspection_metadata(self) -> None: result = PasHubRdSapSiteNotesExtractor(load_text_fixture()).extract_inspection_metadata() @@ -365,6 +370,17 @@ class TestWindows: ) +class TestWaterHeatingCylinderThickness: + @pytest.fixture + def hhw(self) -> HeatingAndHotWater: + return PasHubRdSapSiteNotesExtractor( + load_text_fixture_2() + ).extract_heating_and_hot_water() + + def test_cylinder_insulation_thickness_mm(self, hhw: HeatingAndHotWater) -> None: + assert hhw.water_heating.insulation_thickness_mm == 38 + + class TestHeatingAndHotWater: @pytest.fixture def hhw(self) -> HeatingAndHotWater: