diff --git a/backend/apis/GoogleSolarApi.py b/backend/apis/GoogleSolarApi.py index 1354bbff..905d4975 100644 --- a/backend/apis/GoogleSolarApi.py +++ b/backend/apis/GoogleSolarApi.py @@ -17,10 +17,6 @@ logger = setup_logger() class GoogleSolarApi: NORTH_FACING_AZIMUTH_RANGE = (-30, 30) - # Conservative estimate of the proportion of electricity that will be consumed, whereas the rest will - # be exported - SOLAR_CONSUMPTION_PROPORTION = 0.5 - # These are variables, described in the documentation for cost analysis for non-us locations, seen here # https://developers.google.com/maps/documentation/solar/calculate-costs-non-us # We use the default figures that the API uses for US locations diff --git a/backend/app/assumptions.py b/backend/app/assumptions.py index d2b7b75a..ffc186df 100644 --- a/backend/app/assumptions.py +++ b/backend/app/assumptions.py @@ -2,3 +2,7 @@ # which is often quoted as a sensible efficiency range for air source heat pumps. PESSIMISTIC_ASHPY_EFFICIENCY = 200 AVERAGE_ASHP_EFFICIENCY = 300 + +# Conservative estimate of the proportion of electricity that will be consumed, whereas the rest will +# be exported +SOLAR_CONSUMPTION_PROPORTION = 0.5 diff --git a/backend/app/plan/router.py b/backend/app/plan/router.py index 6f1d9935..48a78e15 100644 --- a/backend/app/plan/router.py +++ b/backend/app/plan/router.py @@ -655,7 +655,7 @@ async def trigger_plan(body: PlanTriggerRequest): roof_area=solar_api_client.roof_area ) - logger.info("Getting components and epc recommendations") + logger.info("Identifying property recommendations") recommendations = {} recommendations_scoring_data = [] representative_recommendations = {} @@ -742,7 +742,7 @@ async def trigger_plan(body: PlanTriggerRequest): # cylinder jacket), we should add these to the recommendations as default for p in input_properties: - if not recommendations[p.id]: + if not recommendations.get(p.id): continue input_measures = prepare_input_measures(recommendations[p.id], body.goal) diff --git a/backend/ml_models/AnnualBillSavings.py b/backend/ml_models/AnnualBillSavings.py index d018dedb..f791599a 100644 --- a/backend/ml_models/AnnualBillSavings.py +++ b/backend/ml_models/AnnualBillSavings.py @@ -1,6 +1,6 @@ import numpy as np import pandas as pd -from backend.apis.GoogleSolarApi import GoogleSolarApi +import backend.app.assumptions as assumptions QUARTERLY_ENERGY_PRICES = [ # 2024 Q1 @@ -283,7 +283,7 @@ class AnnualBillSavings: 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 + return (kwh / cop) * assumptions.SOLAR_CONSUMPTION_PROPORTION * cls.GAS_PRICE_CAP if fuel == "Oil": price_data = cls.FUEL_DATA[cls.FUEL_DATA["Fuel"] == "Kerosene"].squeeze() diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index d8d0ec08..af55031f 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -39,6 +39,7 @@ DESCRIPTIONS_TO_FUEL_TYPES = { "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}, + "Electric storage heaters, Electric storage heaters": {"fuel": "Electricity", "cop": 1}, } STARTING_DUMMY_ID_VALUE = -9999