From 2838beaa8ad043bae6f7e983ea38cff36d8b0637 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 15 May 2025 17:03:15 +0100 Subject: [PATCH] Added missing floor heights --- backend/engine/engine.py | 2 +- etl/epc/Record.py | 2 ++ .../tests/test_data/heating_recommendations_data.py | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/engine/engine.py b/backend/engine/engine.py index 408d044e..58c3dc8e 100644 --- a/backend/engine/engine.py +++ b/backend/engine/engine.py @@ -528,7 +528,7 @@ async def model_engine(body: PlanTriggerRequest): prepared_epc = EPCRecord( epc_records=epc_records, run_mode="newdata", - cleaning_data=cleaning_data + cleaning_data=cleaning_data, ) input_properties.append( diff --git a/etl/epc/Record.py b/etl/epc/Record.py index 1ed33567..b8950757 100644 --- a/etl/epc/Record.py +++ b/etl/epc/Record.py @@ -531,6 +531,8 @@ class EPCRecord: or (self.prepared_epc["floor-height"] in DATA_ANOMALY_MATCHES) or (self.prepared_epc["number-heated-rooms"] in DATA_ANOMALY_MATCHES) ): + # TODO - this probably shouldn't live here - but we only need to use this for specific properties + # when we meet this condition property_dimensions = read_dataframe_from_s3_parquet( bucket_name=DATA_BUCKET, file_key=f"property_dimensions/{self.prepared_epc['local-authority']}.parquet", diff --git a/recommendations/tests/test_data/heating_recommendations_data.py b/recommendations/tests/test_data/heating_recommendations_data.py index a7f4121e..671220bc 100644 --- a/recommendations/tests/test_data/heating_recommendations_data.py +++ b/recommendations/tests/test_data/heating_recommendations_data.py @@ -823,7 +823,7 @@ testing_examples = [ 'mainheatc-energy-eff': 'Very Poor', 'mainheatc-env-eff': 'Very Poor', 'lighting-description': 'Low energy lighting in all fixed outlets', 'lighting-energy-eff': 'Very Good', 'lighting-env-eff': 'Very Good', 'main-fuel': 'smokeless coal', 'wind-turbine-count': 0, - 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': 2.4, 'photo-supply': None, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '1 Green Gates, Bridstow', 'local-authority-label': 'Herefordshire, County of', @@ -869,7 +869,7 @@ testing_examples = [ 'mainheatc-energy-eff': 'Average', 'mainheatc-env-eff': 'Average', 'lighting-description': 'Low energy lighting in 23% of fixed outlets', 'lighting-energy-eff': 'Poor', 'lighting-env-eff': 'Poor', 'main-fuel': 'bulk wood pellets', 'wind-turbine-count': 0, - 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': 2.4, 'photo-supply': None, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '143, Shortheath', 'local-authority-label': 'South Derbyshire', 'constituency-label': 'South Derbyshire', @@ -916,7 +916,7 @@ testing_examples = [ 'mainheatc-env-eff': 'Poor', 'lighting-description': 'Low energy lighting in 50% of fixed outlets', 'lighting-energy-eff': 'Good', 'lighting-env-eff': 'Good', 'main-fuel': 'dual fuel - mineral + wood', 'wind-turbine-count': 0, 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, - 'floor-height': None, 'photo-supply': None, 'solar-water-heating-flag': 'N', + 'floor-height': 2.5, 'photo-supply': None, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '3 Manor Farm Cottage, Halse', 'local-authority-label': 'South Northamptonshire', 'constituency-label': 'South Northamptonshire', 'posttown': 'BRACKLEY', 'construction-age-band': 'England and Wales: before 1900', @@ -960,7 +960,7 @@ testing_examples = [ 'mainheatc-env-eff': 'Average', 'lighting-description': 'Low energy lighting in 18% of fixed outlets', 'lighting-energy-eff': 'Poor', 'lighting-env-eff': 'Poor', 'main-fuel': 'electricity (not community)', 'wind-turbine-count': 0, 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, - 'floor-height': None, 'photo-supply': None, 'solar-water-heating-flag': 'N', + 'floor-height': 2.5, 'photo-supply': None, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '6, Nags Head Lane, Hargrave', 'local-authority-label': 'East Northamptonshire', 'constituency-label': 'Corby', 'posttown': 'WELLINGBOROUGH', 'construction-age-band': 'England and Wales: 1930-1949', @@ -1093,7 +1093,7 @@ testing_examples = [ 'mainheatc-energy-eff': 'Poor', 'mainheatc-env-eff': 'Poor', 'lighting-description': 'No low energy lighting', 'lighting-energy-eff': 'Very Poor', 'lighting-env-eff': 'Very Poor', 'main-fuel': 'anthracite', 'wind-turbine-count': 0, - 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': 2.5, 'photo-supply': None, 'solar-water-heating-flag': 'N', 'mechanical-ventilation': 'natural', 'address': '2 Crabs Castle, Pontrilas', 'local-authority-label': 'Herefordshire, County of', @@ -1228,7 +1228,7 @@ testing_examples = [ 'mainheatc-energy-eff': 'Average', 'mainheatc-env-eff': 'Average', 'lighting-description': 'No low energy lighting', 'lighting-energy-eff': 'Very Poor', 'lighting-env-eff': 'Very Poor', 'main-fuel': 'electricity (not community)', 'wind-turbine-count': 0, - 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': None, + 'heat-loss-corridor': 'NO DATA!', 'unheated-corridor-length': None, 'floor-height': 2.5, 'photo-supply': 50.0, 'solar-water-heating-flag': None, 'mechanical-ventilation': 'natural', 'address': '16, Woodside', 'local-authority-label': 'Wolverhampton', 'constituency-label': 'Wolverhampton North East', 'posttown': 'WOLVERHAMPTON',