Merged
Conversation
Context: - PR #2023 introduced a StockCommitment that assumes each preferred device has soc_max and soc_at_start. - Mixed-device schedules can include non-storage devices such as PV, which do not have state-of-charge values. Change: - Guard the full-SoC preference so it only applies when both soc_max and soc_at_start are defined. - Prevent mixed-device scheduling from crashing on NoneType subtraction. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Context: - The scheduler regression was exposed by HEMS-style mixed-device flex-models that combine storage with PV. Change: - Add a regression test covering a mixed battery plus PV schedule. - Verify scheduling computes without applying SoC-only preferences to the PV device. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Context: - PR #2108 fixes a mixed-device scheduling regression in StorageScheduler. Change: - Document the fix in the unreleased v0.32.0 bugfixes section. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Documentation build overview
|
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
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.
Description
StorageSchedulerwhere non-storage devices such as PV were incorrectly processed by the new SoC-based "prefer full storage sooner" logic.StockCommitmentfor devices that actually define bothsoc_maxandsoc_at_start.TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'.Context
This issue first surfaced through the HEMS example scheduling phase, where the worker failed with
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'. The issue comes from PR #2023 (Feat: full SoC preference), which moved the tie-breaking preference into a SoC-basedStockCommitmentand assumed each preferred device hadsoc_maxandsoc_at_start. That assumption is valid for storage devices, but not for non-storage devices such as PV that can still appear in mixed-device schedules.How to test
flexmeasures/data/models/planning/tests/test_solver.pyStorageScheduler._prepare(...)Sign-off