diff --git a/backend/Property.py b/backend/Property.py index bb545248..41696c37 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -14,7 +14,7 @@ from epc_api.client import EpcClient from BaseUtility import Definitions from recommendations.rdsap_tables import england_wales_age_band_lookup, FLOOR_LEVEL_MAP from recommendations.recommendation_utils import ( - estimate_perimeter, get_wall_type, estimate_external_wall_area, esimtate_pitched_roof_area + estimate_perimeter, get_wall_type, estimate_external_wall_area, esimtate_pitched_roof_area, estimate_windows ) ENVIRONMENT = os.environ.get('ENVIRONMENT', 'dev') @@ -87,6 +87,7 @@ class Property(Definitions): self.insulation_floor_area = None self.number_lighting_outlets = None self.floor_level = None + self.number_of_windows = None self.current_adjusted_energy = None self.expected_adjusted_energy = None @@ -332,6 +333,7 @@ class Property(Definitions): self.set_wall_type() self.set_floor_type() self.set_floor_level() + self.set_windows_count() def set_age_band(self): """ @@ -850,3 +852,18 @@ class Property(Definitions): """ self.current_adjusted_energy = current_adjusted_energy self.expected_adjusted_energy = expected_adjusted_energy + + def set_windows_count(self): + """ + Using the estimate_windows function, this method will set the number of windows in the property + :return: + """ + + self.number_of_windows = estimate_windows( + property_type=self.data["property-type"], + built_form=self.data["built-form"], + construction_age_band=self.construction_age_band, + floor_area=self.floor_area, + number_habitable_rooms=self.number_of_rooms, + extension_count=float(self.data["extension-count"]), + )