Conversation
- fixed constants
… price data Two bugs in _filter_oscillations caused isolated single-slot charge/discharge with quarter-hour price data while hourly data worked correctly: 1. ref_step_h used step_durations_hours[0] (the partial first step) instead of the full interval step. When the optimizer runs 1-2 min before a price boundary, this inflated lookahead_steps from 8 to ~120, covering the entire 36-h horizon instead of the intended 2-h window. 2. The filter broke on the *nearest* discharge found in the window. An intermediate discharge with a low spread caused the preceding charge to be removed, even when a profitable discharge existed slightly further in the same window. Fix 1: use step_durations_hours[1] as ref_step_h (the representative full interval), keeping lookahead_steps at 8 steps for 15-min data. Fix 2: scan all discharges (charges) within the window; only suppress a charge (discharge) step if no profitable pairing exists anywhere in the window. True rapid oscillations with no profitable match are still correctly removed. Adds three regression tests covering both scenarios. https://claude.ai/code/session_01FCR1z6MBtoa5AdEtEi352T
fix: oscillation filter incorrectly removes charge blocks with 15-min…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.