Skip to content

Commit

Permalink
Refactor: fix "billing_period" renaming issue.
Browse files Browse the repository at this point in the history
Co-authored-by: Ethan-Strominger <[email protected]>
  • Loading branch information
stemgene and ethanstrominger committed Dec 6, 2024
1 parent c5eba9b commit c9ed49a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/src/rules_engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,32 +673,32 @@ def calculate(
return home_instance

def initialize_ua(
self, processed_energy_bill: IntermediateProcessedEnergyBill
self, intermediate_processed_energy_bill: IntermediateProcessedEnergyBill
) -> None:
"""
Average heating usage, partial UA, initial UA. requires that
self.home have non heating usage calculated.
"""
processed_energy_bill.avg_heating_usage = (
processed_energy_bill.usage / processed_energy_bill.days
intermediate_processed_energy_bill.avg_heating_usage = (
intermediate_processed_energy_bill.usage / intermediate_processed_energy_bill.days
) - self.avg_non_heating_usage
processed_energy_bill.partial_ua = self.calculate_partial_ua(
processed_energy_bill
intermediate_processed_energy_bill.partial_ua = self.calculate_partial_ua(
intermediate_processed_energy_bill
)
processed_energy_bill.ua = (
processed_energy_bill.partial_ua
/ processed_energy_bill.total_hdd
intermediate_processed_energy_bill.ua = (
intermediate_processed_energy_bill.partial_ua
/ intermediate_processed_energy_bill.total_hdd
)

def calculate_partial_ua(
self, processed_energy_bill_input: IntermediateProcessedEnergyBill
self, intermediate_processed_energy_bill: IntermediateProcessedEnergyBill
) -> float:
"""
The portion of UA that is not dependent on the balance point
"""
return (
processed_energy_bill_input.days
* processed_energy_bill_input.avg_heating_usage # gallons or therms
intermediate_processed_energy_bill.days
* intermediate_processed_energy_bill.avg_heating_usage # gallons or therms
* self.fuel_type.value # therm or gallon to BTU
* self.heat_sys_efficiency # unitless
/ 24
Expand Down

0 comments on commit c9ed49a

Please sign in to comment.