diff --git a/recommendations/FloorRecommendations.py b/recommendations/FloorRecommendations.py index c63d45c2..0e6c46ad 100644 --- a/recommendations/FloorRecommendations.py +++ b/recommendations/FloorRecommendations.py @@ -5,6 +5,7 @@ import pandas as pd from BaseUtility import Definitions from datatypes.enums import QuantityUnits +from backend.app.plan.schemas import MEASURE_MAP from backend.Property import Property from recommendations.recommendation_utils import ( r_value_per_mm_to_u_value, calculate_u_value_uplift, is_diminishing_returns, update_lowest_selected_u_value, @@ -70,7 +71,13 @@ class FloorRecommendations(Definitions): # TODO: To be completed self.exposed_floor_non_insulation_materials = [] - def recommend(self, phase=0): + def recommend(self, phase=0, measures=None): + + measures = MEASURE_MAP["floor_insulation"] if measures is None else measures + + if not measures: + return + u_value = self.property.floor["thermal_transmittance"] property_type = self.property.data["property-type"] floor_area = self.property.insulation_floor_area @@ -124,7 +131,7 @@ class FloorRecommendations(Definitions): self.property.floor["is_suspended"] or self.property.floor["is_to_unheated_space"] or self.property.floor["is_to_external_air"] - ): + ) and "suspended_floor_insulation" in measures: # Given the U-value, we recommend underfloor insulation self.recommend_floor_insulation( phase=phase, @@ -134,7 +141,7 @@ class FloorRecommendations(Definitions): ) return - if self.property.floor["is_solid"]: + if self.property.floor["is_solid"] and "solid_floor_insulation" in measures: # Given the U-value, we recommend solid floor insulation options which are usually solid foam self.recommend_floor_insulation( u_value=u_value, diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 34586e01..e81e7998 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -127,7 +127,7 @@ class Recommendations: property_recommendations.append(self.ventilation_recomender.recommendation) if "floor_insulation" in measures: - self.floor_recommender.recommend(phase=phase) + self.floor_recommender.recommend(phase=phase, measures=measures) if self.floor_recommender.recommendations: property_recommendations.append(self.floor_recommender.recommendations) phase += 1