Skip to content

Exclude 'BOOST' from low rate condition checks#3706

Merged
springfall2008 merged 1 commit intospringfall2008:mainfrom
lowesjam:lowesjam-patch-bump-charge-BOOST
Mar 31, 2026
Merged

Exclude 'BOOST' from low rate condition checks#3706
springfall2008 merged 1 commit intospringfall2008:mainfrom
lowesjam:lowesjam-patch-bump-charge-BOOST

Conversation

@lowesjam
Copy link
Copy Markdown
Contributor

Add alternative bump-charge source value
Issue #3702

Add alternative bump-charge source value
Issue springfall2008#3702
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts Octopus Intelligent slot processing so Octopus bump-charging dispatches with source "BOOST" are not treated as “low rate”, addressing Issue #3702 where bump-charge windows were incorrectly shown as off-peak/cheap.

Changes:

  • Exclude dispatch source "BOOST" from the octopus_slot_low_rate “force to min rate” logic in load_octopus_slots.
  • Exclude dispatch source "BOOST" from IO slot rate masking in rate_add_io_slots (same handling as "bump-charge").

Comment on lines 2377 to 2380
new_slot["average"] = self.rate_import.get(start_minutes, self.rate_min)
if octopus_slot_low_rate and source != "bump-charge":
if octopus_slot_low_rate and source != "bump-charge" and source != "BOOST":
new_slot["average"] = self.rate_min # Assume price in min
new_slot["cost"] = dp2(new_slot["average"] * kwh)
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string literal checks for special IO dispatch sources are duplicated across multiple branches (e.g., comparing against "bump-charge" and "BOOST" inline). Consider centralizing this into a single helper/constant (e.g., a set of “non-low-rate” sources) to avoid future drift where one call site gets updated but others don’t.

Copilot uses AI. Check for mistakes.
@@ -2429,7 +2429,7 @@ def rate_add_io_slots(self, car_n, rates, octopus_slots):
start_minutes, end_minutes, kwh, source, location = self.decode_octopus_slot(car_n, slot, raw=True)

# Ignore bump-charge slots as their cost won't change
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment says “Ignore bump-charge slots as their cost won't change” but this condition now also ignores "BOOST". Update the comment to reflect the actual behavior so it stays accurate for future readers.

Suggested change
# Ignore bump-charge slots as their cost won't change
# Ignore bump-charge and BOOST slots as their cost/handling is fixed and won't change

Copilot uses AI. Check for mistakes.
Comment on lines +2378 to 2379
if octopus_slot_low_rate and source != "bump-charge" and source != "BOOST":
new_slot["average"] = self.rate_min # Assume price in min
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a new special-case dispatch source ("BOOST") affecting both slot pricing display (load_octopus_slots) and rate masking (rate_add_io_slots), but there’s no unit test coverage ensuring BOOST is treated the same way as bump-charge. Please add/update tests (e.g., in apps/predbat/tests/test_octopus_slots.py and/or test_rate_add_io_slots.py) to assert BOOST slots don’t get forced to rate_min and don’t mark minutes as off-peak.

Copilot generated this review using guidance from repository custom instructions.
@springfall2008 springfall2008 merged commit 506d788 into springfall2008:main Mar 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants