diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 070036af..609fd245 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -155,6 +155,10 @@ class Recommendations: property_recommendations.append(self.windows_recommender.recommendation) phase += 1 + if "mixed_glazing" in measures: + # This is a recommendation that comes exclusively from an energy assessment + property_recommendations.append(self.windows_recommender.recommend_mixed_glazing()) + if "fireplace" in measures: self.fireplace_recommender.recommend(phase=phase) if self.fireplace_recommender.recommendation: diff --git a/recommendations/VentilationRecommendations.py b/recommendations/VentilationRecommendations.py index 31119168..e3b66226 100644 --- a/recommendations/VentilationRecommendations.py +++ b/recommendations/VentilationRecommendations.py @@ -98,8 +98,7 @@ class VentilationRecommendations(Definitions): else trickle_vents_recommendation_config["description"] ) - # We recommend installing two mechanical ventilation systems - self.recommendation = [ + return [ { "phase": None, "parts": [], diff --git a/recommendations/WindowsRecommendations.py b/recommendations/WindowsRecommendations.py index 3826a470..c74c2fac 100644 --- a/recommendations/WindowsRecommendations.py +++ b/recommendations/WindowsRecommendations.py @@ -3,8 +3,9 @@ from typing import List import numpy as np from backend.Property import Property +from etl.epc_clean.epc_attributes.WindowAttributes import WindowAttributes from recommendations.Costs import Costs -from recommendations.recommendation_utils import override_costs +from recommendations.recommendation_utils import override_costs, check_simulation_difference class WindowsRecommendations: @@ -128,3 +129,61 @@ class WindowsRecommendations: } } ] + + def recommend_mixed_glazing(self): + """ + This function will recommend mixed glazing to the property. This is a more specific recommendation than + the general windows recommendation, but is almost certain to arise from a survey + :return: + """ + + mixed_glazing_recommendation_config = [ + r for r in self.property.non_invasive_recommendations if r["type"] == "mixed_glazing" + ][0] + + description = ( + "Install a combination of secondary and double glazing to single glazed windows" if + not mixed_glazing_recommendation_config.get("description") + else mixed_glazing_recommendation_config["description"] + ) + + windows_ending_config = WindowAttributes("Multiple glazing throughout").process() + + windows_simulation_config = check_simulation_difference( + new_config=windows_ending_config, old_config=self.property.windows, prefix="windows_" + ) + + windows_simulation_config = { + **windows_simulation_config, + "windows_energy_eff": "Average", + "glazed_type_ending": "secondary glazing" + } + + return [ + { + "phase": None, + "parts": [], + "type": "mixed_glazing", + "description": description, + "starting_u_value": None, + "new_u_value": None, + "already_installed": False, + "sap_points": mixed_glazing_recommendation_config["sap_points"], + "heat_demand": None, # We will predict this + "kwh_savings": None, # We will predict this + "co2_equivalent_savings": None, # We will predict this + "energy_cost_savings": None, # We will predict this + "total": mixed_glazing_recommendation_config["cost"], + # We use a very simple and rough estimate of 4 hours per unit + "labour_hours": mixed_glazing_recommendation_config.get("labour_hours", 8), + "labour_days": mixed_glazing_recommendation_config.get("labour_days", 1), # Assume 8 hour day + "survey": mixed_glazing_recommendation_config["survey"], + "simulation_config": windows_simulation_config, + "description_simulation": { + "multi-glaze-proportion": 100, + "windows-energy-eff": "Average", + "windows-description": "Multiple glazing throughout", + "glazed-type": "secondary glazing", + }, + } + ]