From 30c28754b7def39ce495638e68c7b7e6fc7b5ce0 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 12 Aug 2024 10:38:00 +0100 Subject: [PATCH] fixed bug with adjusted predictions --- recommendations/Recommendations.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index 21c4f551..0b9e4c7a 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -650,7 +650,7 @@ class Recommendations: for k in ["heating", "hotwater"]: kwh_impact_table[f"{k}_cost"] = kwh_impact_table.apply( lambda x: AnnualBillSavings.calculate_recommendation_fuel_cost( - x[f"adjusted_{k}"], x[f"{k}_fuel_type"], x[f"{k}_cop"] + x[f"predictions_{k}"], x[f"{k}_fuel_type"], x[f"{k}_cop"] ), axis=1 ) @@ -672,14 +672,14 @@ class Recommendations: continue heating_kwh_savings = ( - previous_phase_impact["adjusted_heating"].mean() - rec_impact["adjusted_heating"].values[0] + previous_phase_impact["predictions_heating"].mean() - rec_impact["predictions_heating"].values[0] ) heating_cost_savings = ( previous_phase_impact["heating_cost"].mean() - rec_impact["heating_cost"].values[0] ) hotwater_kwh_savings = ( - previous_phase_impact["adjusted_hotwater"].mean() - rec_impact["adjusted_hotwater"].values[0] + previous_phase_impact["predictions_hotwater"].mean() - rec_impact["predictions_hotwater"].values[0] ) hotwater_host = ( previous_phase_impact["hotwater_cost"].mean() - rec_impact["hotwater_cost"].values[0] @@ -707,11 +707,12 @@ class Recommendations: electricity_standing_charge = AnnualBillSavings.DAILY_STANDARD_CHARGE_ELECTRICITY * 365 current_energy_bill = ( - starting_figures["heating_cost"].values[0] + - starting_figures["hotwater_cost"].values[0] + + starting_figures["heating_cost"] + + starting_figures["hotwater_cost"] + property_instance.energy_cost_estimates["unadjusted"]["lighting"] + property_instance.energy_cost_estimates["unadjusted"]["appliances"] + - gas_standing_charge + electricity_standing_charge + gas_standing_charge + + electricity_standing_charge ) return current_energy_bill