mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
modified energy estimate adjustment to use current epc rating rather than expected
This commit is contained in:
parent
db7eb69dd1
commit
bf6020026a
2 changed files with 22 additions and 3 deletions
|
|
@ -415,12 +415,10 @@ async def trigger_plan(body: PlanTriggerRequest):
|
|||
|
||||
# We sum up the SAP points of the default recommendations and calculate a new EPC category. This
|
||||
# category is then used to produce adjusted energy figures
|
||||
total_sap_points = sum([x["sap_points"] for x in representative_recs[property_id]])
|
||||
expected_epc = sap_to_epc(float(property_instance.data["current-energy-efficiency"]) + total_sap_points)
|
||||
|
||||
expected_adjusted_energy = AnnualBillSavings.adjust_energy_to_metered(
|
||||
epc_energy_consumption=expected_heat_demand,
|
||||
current_epc_rating=expected_epc,
|
||||
current_epc_rating=property_instance.data["current-energy-rating"],
|
||||
)
|
||||
|
||||
heat_demand_change = (
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ class AnnualBillSavings:
|
|||
# This is a weighted mean of the price caps, using the consumption figures above as weights
|
||||
PRICE_FACTOR = 0.11183098591549295
|
||||
|
||||
EPC_BANDS = ["G", "F", "E", "D", "C", "B", "A"]
|
||||
|
||||
@classmethod
|
||||
def estimate(cls, kwh: float):
|
||||
"""
|
||||
|
|
@ -70,3 +72,22 @@ class AnnualBillSavings:
|
|||
adjusted_consumption = (epc_energy_consumption + consumption_difference)
|
||||
|
||||
return adjusted_consumption
|
||||
|
||||
@classmethod
|
||||
def adjust_expected_band(cls, expected_epc_rating, current_epc_rating):
|
||||
"""
|
||||
Because of the differing intercepts and intercepts when adjusting, it's possible for
|
||||
expected_adjusted_energy to be bigger than current_adjusted_energy. In this case, we'll
|
||||
adjust, against at most 1 EPC band above the curent. This function performs the EPC adjustment
|
||||
:param expected_epc_rating: The expected EPC rating
|
||||
:param current_epc_rating: The current EPC rating
|
||||
"""
|
||||
|
||||
# Find index of expected EPC rating
|
||||
expected_index = cls.EPC_BANDS.index(expected_epc_rating)
|
||||
current_index = cls.EPC_BANDS.index(current_epc_rating)
|
||||
|
||||
if expected_index - 1 < current_index:
|
||||
return current_epc_rating
|
||||
|
||||
return cls.EPC_BANDS[expected_index - 1]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue