diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index 6eb5d5ad..6f1d9935 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -724,7 +724,7 @@ async def trigger_plan(body: PlanTriggerRequest): # We now insert kwh estimates and costs into the recommendations # TODO: We should join the methodology which maps the heating and hot water descriptions to the fuel types in # Recommendations, but also the Property class - for property_id in recommendations.keys(): + for property_id in tqdm(recommendations.keys()): property_recommendations = recommendations[property_id] property_instance = [p for p in input_properties if p.id == property_id][0] diff --git a/backend/ml_models/AnnualBillSavings.py b/backend/ml_models/AnnualBillSavings.py index bc3a5d32..d018dedb 100644 --- a/backend/ml_models/AnnualBillSavings.py +++ b/backend/ml_models/AnnualBillSavings.py @@ -272,7 +272,6 @@ class AnnualBillSavings: cost_per_kwh = cls.cost_per_kwh( price_data["Price (p)"], price_data["Energy Content, Net Calorific value (kWh/unit)"] ) - return (kwh / cop) * cost_per_kwh if fuel == "Wood Logs": @@ -280,11 +279,17 @@ class AnnualBillSavings: cost_per_kwh = cls.cost_per_kwh( price_data["Price (p)"], price_data["Energy Content, Net Calorific value (kWh/unit)"] ) - 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 + if fuel == "Oil": + price_data = cls.FUEL_DATA[cls.FUEL_DATA["Fuel"] == "Kerosene"].squeeze() + cost_per_kwh = cls.cost_per_kwh( + price_data["Price (p)"], price_data["Energy Content, Net Calorific value (kWh/unit)"] + ) + return (kwh / cop) * cost_per_kwh + raise Exception("Fuel not recognised") diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index d689b412..d8d0ec08 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -38,6 +38,7 @@ DESCRIPTIONS_TO_FUEL_TYPES = { "Boiler and underfloor heating, mains gas": {"fuel": "Natural Gas", "cop": 0.9}, "No system present: electric heaters assumed": {"fuel": "Electricity", "cop": 1}, "Electric instantaneous at point of use": {"fuel": "Electricity", "cop": 1}, + "Boiler and radiators, oil": {"fuel": "Oil", "cop": 0.9}, } STARTING_DUMMY_ID_VALUE = -9999