From b867297c8dbeb073e7984d9f275d30d6c9425925 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 22 Jun 2023 10:49:01 +0100 Subject: [PATCH] completed recommendation logic --- .../recommendations/WallRecommendations.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/model_data/recommendations/WallRecommendations.py b/model_data/recommendations/WallRecommendations.py index 7fcebd7b..e604cac0 100644 --- a/model_data/recommendations/WallRecommendations.py +++ b/model_data/recommendations/WallRecommendations.py @@ -261,8 +261,11 @@ class WallRecommendations: if is_solid_brick and insulation_thickness == "none": - # This is an estimated figure based on industry standards - u_value = self.DEFAULT_U_VALUES["solid_brick"] + if insulation_thickness == "none": + # This is an estimated figure based on industry standards + u_value = self.DEFAULT_U_VALUES["solid_brick"] + else: + u_value = self._get_walls_uvalue_estimate() ewi_parts = [ part for part in wall_parts if part["type"] == "external_wall_insulation" @@ -291,6 +294,7 @@ class WallRecommendations: ) # We also can recommend both internal and external wall insulation together + # By looping through ewi first, if there is nothing there, that ensures not combinations are tested for ewi_part in ewi_parts: for iwi_part in iwi_parts: for ewi_depth, iwi_depth in itertools.product(ewi_part["depths"], iwi_part["depths"]): @@ -318,14 +322,6 @@ class WallRecommendations: ] self.recommendations.append(recommendation) - if is_solid_brick and insulation_thickness == "average" and wall_energy_efficiency in ["Good", "Average"]: - - # Get uvalue estimate - uvalue_estimate = self._get_walls_uvalue_estimate() - - if self.property.in_conservation_area == ConservationAreaClient.IN_CONSERVATION_AREA: - blah - raise NotImplementedError("Not implemented yet") def _get_walls_uvalue_estimate(self):