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 b6733be commit c5eba9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/src/rules_engine/refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ avg_non_heating_usage = _get_avg_non_heating_usage (
to
```
for processed_energy_bill_input in processed_energy_bill_inputs
{ bills_summer, bills_winter, bills_shoulder }
{ summer_processed_energy_bills, winter_processed_energy_bills, shoulder_processed_energy_bills }
=_categorize_bills_by_season (processed_energy_bill_inputs)
```
==================
Expand Down Expand Up @@ -158,7 +158,7 @@ self._calculate_balance_point_and_ua(
stdev_pct_max,
max_stdev_pct_diff,
next_balance_point_sensitivity,
bills_winter)
winter_processed_energy_bills)
```
==================
Expand Down
10 changes: 5 additions & 5 deletions python/tests/test_rules_engine/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_bp_ua_estimates(sample_summary_inputs, sample_processed_energy_bill_inp
initial_balance_point=58,
)

ua_1, ua_2, ua_3 = [bill.ua for bill in home.bills_winter]
ua_1, ua_2, ua_3 = [bill.ua for bill in home.winter_processed_energy_bills]

assert home.balance_point == 60.5
assert ua_1 == approx(1455.03, abs=0.01)
Expand All @@ -344,8 +344,8 @@ def test_bp_ua_with_outlier(
initial_balance_point=58,
)

# expect that ua_1 is considered an outlier and not used in bills_winter
ua_2, ua_3, ua_4 = [bill.ua for bill in home.bills_winter]
# expect that ua_1 is considered an outlier and not used in winter_processed_energy_bills
ua_2, ua_3, ua_4 = [bill.ua for bill in home.winter_processed_energy_bills]

assert home.balance_point == 60.5
assert ua_2 == approx(1455.03, abs=0.01)
Expand All @@ -355,10 +355,10 @@ def test_bp_ua_with_outlier(
assert home.stdev_pct == approx(0.0463, abs=0.01)


def test_convert_to_intermediate_processed_energy_bill_inputs(
def test_convert_to_intermediate_processed_energy_bills(
sample_temp_inputs, sample_normalized_processed_energy_bill_inputs
):
results = engine.convert_to_intermediate_processed_energy_bill_inputs(
results = engine.convert_to_intermediate_processed_energy_bills(
sample_temp_inputs,
sample_normalized_processed_energy_bill_inputs,
FuelType.GAS,
Expand Down

0 comments on commit c5eba9b

Please sign in to comment.