diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index c2f1de4c..7a50ac98 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -219,6 +219,22 @@ async def trigger_plan(body: PlanTriggerRequest): recommendations=recommendations ) + print("GET RID OF ME!") + rec_df = [] + for rec_group in recommendations_with_impact: + for rec in rec_group: + rec_df.append( + { + "type": rec["type"], + "description": rec["description"], + "sap": rec["sap_points"], + "total": rec["total"], + "co2_equivalent_savings": rec["co2_equivalent_savings"], + "heat_demand": rec["heat_demand"] + } + ) + rec_df = pd.DataFrame(rec_df) + input_measures = prepare_input_measures(recommendations_with_impact, body.goal) if body.budget: diff --git a/backend/app/plan/utils.py b/backend/app/plan/utils.py index 5bb8e42a..b60bc20f 100644 --- a/backend/app/plan/utils.py +++ b/backend/app/plan/utils.py @@ -171,8 +171,13 @@ def create_recommendation_scoring_data( if recommendation["type"] == "sealing_open_fireplace": scoring_dict["NUMBER_OPEN_FIREPLACES_ENDING"] = 0 + if recommendation["type"] == "low_energy_lighting": + scoring_dict["LOW_ENERGY_LIGHTING_ENDING"] = 100 + scoring_dict["LIGHTING_ENERGY_EFF_STARTING"] = "Very Good" + if recommendation["type"] not in [ "wall_insulation", "floor_insulation", "roof_insulation", "mechanical_ventilation", "sealing_open_fireplace", + "low_energy_lighting" ]: raise NotImplementedError("Implement me") diff --git a/recommendations/Costs.py b/recommendations/Costs.py index 32ab32aa..5c2b28f2 100644 --- a/recommendations/Costs.py +++ b/recommendations/Costs.py @@ -41,7 +41,7 @@ class Costs: CONTINGENCY = 0.1 # Where there is more uncertainty, a higher contingency rate is used - HIGH_RISK_CONTINGENCY = 0.15 + HIGH_RISK_CONTINGENCY = 0.2 # When there is less uncertainty, a lower contingency rate is used LOW_RISK_CONTINGENCY = 0.05 @@ -54,8 +54,8 @@ class Costs: # have a preliminaries of 12-14% so we use 12% as the median for the preliminaries rate. # For External wall insulation (EWI), we use 15% as the preliminaries rate if we think the property might # need scaffolding, otherwise we use 12%. This is to account for any site preparation that might be required - EWI_NO_SCAFFOLDING_PRELIMINARIES = 0.12 - EWI_SCAFFOLDING_PRELIMINARIES = 0.15 + EWI_NO_SCAFFOLDING_PRELIMINARIES = 0.15 + EWI_SCAFFOLDING_PRELIMINARIES = 0.20 VAT_RATE = 0.2 PROFIT_MARGIN = 0.2 diff --git a/recommendations/LightingRecommendations.py b/recommendations/LightingRecommendations.py index 85b440b5..f898eaf5 100644 --- a/recommendations/LightingRecommendations.py +++ b/recommendations/LightingRecommendations.py @@ -53,11 +53,16 @@ class LightingRecommendations: material=self.material ) + if number_non_lel_outlets == 1: + description = "Install low energy lighting in %s 1 remaining outlet" + else: + description = "Install low energy lighting in %s outlets" % str(number_non_lel_outlets) + self.recommendation = [ { "parts": [], - "type": "sealing_open_fireplace", - "description": "Install low energy lighting in %s outlets" % str(number_non_lel_outlets), + "type": "low_energy_lighting", + "description": description, "starting_u_value": None, "new_u_value": None, "sap_points": None, diff --git a/recommendations/WallRecommendations.py b/recommendations/WallRecommendations.py index acc74ead..17fa4ad4 100644 --- a/recommendations/WallRecommendations.py +++ b/recommendations/WallRecommendations.py @@ -263,12 +263,14 @@ class WallRecommendations(Definitions): material=material.to_dict(), non_insulation_materials=non_insulation_materials ) + description = "Install " + self._make_description(material) + " on internal walls" elif material["type"] == "external_wall_insulation": cost_result = self.costs.external_wall_insulation( wall_area=self.property.insulation_wall_area, material=material.to_dict(), non_insulation_materials=non_insulation_materials ) + description = "Install " + self._make_description(material) + " on external walls" else: raise ValueError("Invalid material type") @@ -283,7 +285,7 @@ class WallRecommendations(Definitions): ) ], "type": "wall_insulation", - "description": "Install " + self._make_description(material), + "description": description, "starting_u_value": u_value, "new_u_value": new_u_value, "sap_points": None, @@ -321,7 +323,8 @@ class WallRecommendations(Definitions): self.recommendations += ewi_recommendations + iwi_recommendations - self.prune_diminishing_recommendations() + # We remove this temporarily + # self.prune_diminishing_recommendations() @staticmethod def _make_description(material):