added phase to non-invasive recs

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-05 16:42:01 +01:00
parent 7c902c6c82
commit 388b6673c7
4 changed files with 9 additions and 7 deletions

View file

@ -365,7 +365,7 @@ class Property:
for rec in property_recommendations_by_phase:
# We simulate the impact of the recommendation at this current phase, and all of the prior phases
if rec["type"] == "mechanical_ventilation":
if rec["type"] in ["mechanical_ventilation", "trickle_vents", "draught_proofing"]:
continue
scoring_dict = self.create_recommendation_scoring_data(

View file

@ -8,7 +8,7 @@ class DraughtProofingRecommendations:
self.recommendation = []
def recommend(self):
def recommend(self, phase):
"""
In some cases, we can identify the need for draught proofing from the EPC recommendations, however the initial
implementation of this class will just assume that we are picking up a non-invasive recommendation from the
@ -28,7 +28,7 @@ class DraughtProofingRecommendations:
# We recommend installing two mechanical ventilation systems
self.recommendation = [
{
"phase": None,
"phase": phase,
"parts": [],
"type": "draught_proofing",
"description": description,

View file

@ -137,8 +137,9 @@ class Recommendations:
if "draught_proofing" in measures:
# This is a recommendation that in some instances we can recommend, by deducing it from the SAP
# recommendations, however we will implement this later
self.draught_proofing_recommender.recommend()
self.draught_proofing_recommender.recommend(phase=phase)
property_recommendations.append(self.draught_proofing_recommender.recommendation)
phase += 1
if "floor_insulation" in measures:
self.floor_recommender.recommend(phase=phase, measures=measures)
@ -154,7 +155,8 @@ class Recommendations:
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())
property_recommendations.append(self.windows_recommender.recommend_mixed_glazing(phase=phase))
phase += 1
if "fireplace" in measures:
self.fireplace_recommender.recommend(phase=phase)

View file

@ -130,7 +130,7 @@ class WindowsRecommendations:
}
]
def recommend_mixed_glazing(self):
def recommend_mixed_glazing(self, phase):
"""
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
@ -161,7 +161,7 @@ class WindowsRecommendations:
return [
{
"phase": None,
"phase": phase,
"parts": [],
"type": "mixed_glazing",
"description": description,