Fix index bounds and current-quarter handling#3588
Open
Sn0w3y wants to merge 1 commit intoOpenEMS:developfrom
Open
Fix index bounds and current-quarter handling#3588Sn0w3y wants to merge 1 commit intoOpenEMS:developfrom
Sn0w3y wants to merge 1 commit intoOpenEMS:developfrom
Conversation
Clamp endIndex to the lengths of production/consumption arrays to avoid out-of-bounds slices and change the subList check to require more than one quarter (>1) so only full future quarters are aggregated. Also add guards when reading index 0 values to handle empty arrays and null entries, defaulting to 0 for current production/consumption. Should fix: OpenEMS#3530
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3588 +/- ##
=============================================
+ Coverage 58.59% 58.60% +0.02%
Complexity 105 105
=============================================
Files 3091 3091
Lines 134005 134010 +5
Branches 9882 9882
=============================================
+ Hits 78508 78529 +21
+ Misses 52590 52583 -7
+ Partials 2907 2898 -9 🚀 New features to boost your workflow:
|
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.
Clamp endIndex to the lengths of production/consumption arrays to avoid out-of-bounds slices and change the subList check to require more than one quarter (>1) so only full future quarters are aggregated. Also add guards when reading index 0 values to handle empty arrays and null entries, defaulting to 0 for current production/consumption.
Should fix: #3530