From de360ab8660761861b736742854b1ac8b677ece4 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 24 Feb 2026 19:34:51 +0000 Subject: [PATCH] fixed issue when phase is 0 --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- recommendations/Recommendations.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.idea/Model.iml b/.idea/Model.iml index c6561970..e1ca1b70 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 50cad4ca..b1ee5ffa 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 5525b7a0..80cc06b4 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -582,6 +582,7 @@ class Recommendations: if rec_phase == starting_phase: return { "sap": float(property_instance.data["current-energy-efficiency"]), + "sap_prediction": float(property_instance.data["current-energy-efficiency"]), "carbon": float(property_instance.data["co2-emissions-current"]), "heat_demand": float(property_instance.data["energy-consumption-current"]), } @@ -599,12 +600,13 @@ class Recommendations: if not previous_phase_reps: return { "sap": float(property_instance.data["current-energy-efficiency"]), + "sap_prediction": float(property_instance.data["current-energy-efficiency"]), "carbon": float(property_instance.data["co2-emissions-current"]), "heat_demand": float(property_instance.data["energy-consumption-current"]), } # Median fallback (including zero-length case) - keys = ("sap", "carbon", "heat_demand") + keys = ("sap", "sap_prediction", "carbon", "heat_demand") return { key: np.median([item[key] for item in previous_phase_reps]) for key in keys