Repository navigation
Fix Überschuss-Verrechnung über mehrere Zählerebenen - #4167
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The additional-current test cannot initialize its required counter hierarchy, and the integration test contains a duplicate test definition.
2 open issues
What changed in this PR
Fixes surplus-current accounting across nested load-management counter levels by using each load’s previously allocated target_current as the counter-difference baseline.
Changes:
- Updates surplus and additional-current allocation calculations.
- Aligns raw counter-data bookkeeping with
target_current. - Adds regression coverage for nested counters and multi-phase allocations.
| File | Summary |
|---|---|
packages/control/algorithm/surplus_controlled.py |
Uses the previous target_current when updating surplus counter differences. |
packages/control/algorithm/integration_test/multi_level_loadmanagement_test.py |
Adds multi-level surplus allocation regression coverage. |
packages/control/algorithm/common.py |
Recalculates raw counter data relative to target_current. |
packages/control/algorithm/additional_current.py |
Uses the previous target allocation for additional-current accounting. |
packages/control/algorithm/additional_current_test.py |
Adds additional-current regression coverage across counter levels and phases. |
Review effort: Lite
| @pytest.mark.parametrize("phases", [1, 2, 3]) | ||
| def test_additional_current_preserves_target_across_counter_levels(phases): | ||
| """The previous stage's allocation may differ from the configured minimum.""" | ||
| cp = data.data.cp_data["cp4"] |
|
|
||
| @pytest.mark.parametrize("phases", [1, 2, 3]) | ||
| @pytest.mark.parametrize("consider_less_charging", [False, True]) | ||
| def test_surplus_preserves_previous_allocation_across_counter_levels(phases, consider_less_charging, monkeypatch): |
LKuemmel
force-pushed
the
loadmangement
branch
from
October 22, 2026 09:43
29c3966 to
079338d
Compare
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.


Ticket #66008194