From 709d4aa958cc0652b65b8874f455e527c886007a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 12 Aug 2024 20:56:56 +0100 Subject: [PATCH] added costing method for solar thermal --- backend/ml_models/AnnualBillSavings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/ml_models/AnnualBillSavings.py b/backend/ml_models/AnnualBillSavings.py index e41dd01c..3ee4b747 100644 --- a/backend/ml_models/AnnualBillSavings.py +++ b/backend/ml_models/AnnualBillSavings.py @@ -1,5 +1,6 @@ import numpy as np import pandas as pd +from backend.apis.GoogleSolarApi import GoogleSolarApi QUARTERLY_ENERGY_PRICES = [ # 2024 Q1 @@ -282,4 +283,8 @@ class AnnualBillSavings: return (kwh / cop) * cost_per_kwh + if fuel == "Natural Gas + Solar Thermal": + # The solar thermal covers a % of the heating kwh, so we need to adjust the cost + return (kwh / cop) * GoogleSolarApi.SOLAR_CONSUMPTION_PROPORTION * cls.GAS_PRICE_CAP + raise Exception("Fuel not recognised")