From f13ce39bed7fce84a7c013d9dce2cc5fc0e50db9 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 19 Aug 2024 19:06:45 +0100 Subject: [PATCH] estimate_new_consumption debugging --- backend/Property.py | 2 +- backend/app/plan/router.py | 8 -------- backend/ml_models/AnnualBillSavings.py | 8 ++++++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/Property.py b/backend/Property.py index 5bca434f..19e5cb2e 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -1287,7 +1287,7 @@ class Property: # If the property currently has an electric boiler, it will still benefit from the ASHP efficiency gain remap_fuel_sources = [ "Natural Gas", "LPG", "Wood Logs", "Oil", "Electricity", "Coal", "Smokeless Fuel", - "Natural Gas + Solar Thermal", "Anthracite", "Wood Pellets", + "Natural Gas + Solar Thermal", "Anthracite", "Wood Pellets", "LPG + Solar Thermal" ] heating_energy_source = self.heating_energy_source diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index f6e98918..0a29f67c 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -518,14 +518,6 @@ async def trigger_plan(body: PlanTriggerRequest): # TODO: For simple properties, we should do a comparison/check between the solar API's roof area and the # basic estimate of roof area - # TODO: Debug this - for p in input_properties: - if p.uprn in [10002634631, 100031601798, 10009574286, 10007366417]: - continue - p.estimate_electrical_consumption( - assumed_ashp_efficiency=assumptions.AVERAGE_ASHP_EFFICIENCY, exclusions=body.exclusions - ) - building_ids = [ { "building_id": p.building_id, diff --git a/backend/ml_models/AnnualBillSavings.py b/backend/ml_models/AnnualBillSavings.py index d72feed7..211e5ea6 100644 --- a/backend/ml_models/AnnualBillSavings.py +++ b/backend/ml_models/AnnualBillSavings.py @@ -289,6 +289,14 @@ class AnnualBillSavings: # The solar thermal covers a % of the heating kwh, so we need to adjust the cost return (kwh / cop) * assumptions.SOLAR_CONSUMPTION_PROPORTION * cls.ELECTRICITY_PRICE_CAP + if fuel == "LPG + Solar Thermal": + # The solar thermal covers a % of the heating kwh, so we need to adjust the cost + price_data = cls.FUEL_DATA[cls.FUEL_DATA["Fuel"] == "LPG"].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 * assumptions.SOLAR_CONSUMPTION_PROPORTION + if fuel == "Oil": price_data = cls.FUEL_DATA[cls.FUEL_DATA["Fuel"] == "Kerosene"].squeeze() cost_per_kwh = cls.cost_per_kwh(