Exclude 'BOOST' from low rate condition checks#3706
Exclude 'BOOST' from low rate condition checks#3706springfall2008 merged 1 commit intospringfall2008:mainfrom
Conversation
Add alternative bump-charge source value Issue springfall2008#3702
There was a problem hiding this comment.
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 theoctopus_slot_low_rate“force to min rate” logic inload_octopus_slots. - Exclude dispatch source
"BOOST"from IO slot rate masking inrate_add_io_slots(same handling as"bump-charge").
| 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) |
There was a problem hiding this comment.
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.
| @@ -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 | |||
There was a problem hiding this comment.
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.
| # 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 |
| if octopus_slot_low_rate and source != "bump-charge" and source != "BOOST": | ||
| new_slot["average"] = self.rate_min # Assume price in min |
There was a problem hiding this comment.
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.
Add alternative bump-charge source value
Issue #3702