From 9576768ff5b048d2100685a214cb2d7007893d22 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 24 Jul 2024 15:00:06 +0100 Subject: [PATCH] updating boiler recommendations to add in description simulation --- recommendations/HeatingControlRecommender.py | 31 +++++++++++++------- recommendations/HeatingRecommender.py | 26 ++++++++++++++-- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/recommendations/HeatingControlRecommender.py b/recommendations/HeatingControlRecommender.py index de935d7a..fe3e577d 100644 --- a/recommendations/HeatingControlRecommender.py +++ b/recommendations/HeatingControlRecommender.py @@ -159,7 +159,9 @@ class HeatingControlRecommender: if not can_recommend: return - ending_config = MainheatControlAttributes("Programmer, room thermostat and TRVS").process() + new_controls_description = "Programmer, room thermostat and TRVS" + + ending_config = MainheatControlAttributes(new_controls_description).process() # We use this to determine how we should be updating the config simulation_config = check_simulation_difference( new_config=ending_config, old_config=self.property.main_heating_controls @@ -168,6 +170,13 @@ class HeatingControlRecommender: # If the current system is below good, we make it good if self.property.data["mainheatc-energy-eff"] in ["Poor", "Very Poor", "Average"]: simulation_config["mainheatc_energy_eff_ending"] = "Good" + else: + simulation_config["mainheatc_energy_eff_ending"] = self.property.data["mainheatc-energy-eff"] + + description_simulation = { + "mainheatcont-description": new_controls_description, + "mainheatc-energy-eff": simulation_config["mainheatc_energy_eff_ending"] + } has_programmer = not needs_programmer has_room_thermostat = not needs_room_thermostat @@ -198,10 +207,7 @@ class HeatingControlRecommender: "sap_points": None, "already_installed": already_installed, "simulation_config": simulation_config, - "description_simulation": { - "mainheatcont-description": "Programmer, room thermostat and TRVS", - "mainheatc-energy-eff": "Good" - } + "description_simulation": description_simulation } ) @@ -228,7 +234,9 @@ class HeatingControlRecommender: # No recommendation needed return - ending_config = MainheatControlAttributes("Time and temperature zone control").process() + new_controls_description = "Time and temperature zone control" + + ending_config = MainheatControlAttributes(new_controls_description).process() # We use this to determine how we should be updating the config simulation_config = check_simulation_difference( @@ -238,7 +246,13 @@ class HeatingControlRecommender: # If the current system is below very good, we make it very good if self.property.data["mainheatc-energy-eff"] in ["Poor", "Very Poor", "Average", "Good"]: simulation_config["mainheatc_energy_eff_ending"] = "Very Good" + else: + simulation_config["mainheatc_energy_eff_ending"] = self.property.data["mainheatc-energy-eff"] + description_simulation = { + "mainheatcont-description": new_controls_description, + "mainheatc-energy-eff": simulation_config["mainheatc_energy_eff_ending"] + } cost_result = self.costs.time_and_temperature_zone_control( number_heated_rooms=int(self.property.data["number-heated-rooms"]) ) @@ -262,9 +276,6 @@ class HeatingControlRecommender: "sap_points": None, "already_installed": already_installed, "simulation_config": simulation_config, - "description_simulation": { - "mainheatcont-description": "Time and temperature zone control", - "mainheatc-energy-eff": "Very Good" - } + "description_simulation": description_simulation } ) diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index 8aed4108..92350738 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -604,6 +604,7 @@ class HeatingRecommender: simulation_config = {} boiler_costs = {} boiler_recommendation = {} + description_simulation = {} has_inefficient_space_heating = self.property.data["mainheat-energy-eff"] in ["Very Poor", "Poor", "Average"] @@ -627,12 +628,22 @@ class HeatingRecommender: "mainheat_energy_eff_ending": "Good", "hot_water_energy_eff_ending": "Good" } + + description_simulation = { + "mainheat-energy-eff": simulation_config["mainheat_energy_eff_ending"], + "hot-water-energy-eff": simulation_config["hot_water_energy_eff_ending"], + } + if system_change: # Installation of a boiler improves the hot water system so we need to reflect this in # the outcome of the recommendation - heating_ending_config = MainHeatAttributes("Boiler and radiators, mains gas").process() - hotwater_ending_config = HotWaterAttributes("From main system").process() - fuel_ending_config = MainFuelAttributes("mains gas (not community)").process() + new_heating_description = "Boiler and radiators, mains gas" + new_hotwater_description = "From main system" + new_fuel_description = "mains gas (not community)" + + heating_ending_config = MainHeatAttributes(new_heating_description).process() + hotwater_ending_config = HotWaterAttributes(new_hotwater_description).process() + fuel_ending_config = MainFuelAttributes(new_fuel_description).process() heating_simulation_config = check_simulation_difference( new_config=heating_ending_config, old_config=self.property.main_heating @@ -651,6 +662,13 @@ class HeatingRecommender: **fuel_simulation_config, } + description_simulation = { + **description_simulation, + "mainheat-description": new_heating_description, + "hotwater-description": new_hotwater_description, + "main-fuel": new_fuel_description + } + boiler_costs = self.costs.boiler( size=f"{boiler_size}kw", exising_room_heaters=exising_room_heaters, @@ -676,6 +694,7 @@ class HeatingRecommender: "sap_points": None, "already_installed": already_installed, "simulation_config": simulation_config, + "description_simulation": description_simulation, **boiler_costs } @@ -699,6 +718,7 @@ class HeatingRecommender: combined_recommendation = self.combine_heating_and_controls( controls_recommendations=[controls_recommendation], heating_simulation_config=simulation_config, + heating_description_simulation=description_simulation, costs=boiler_costs, description=boiler_recommendation["description"], phase=recommendation_phase,