Feat/retire fallback scheduler#2252
Conversation
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
|
Manual test done through Swagger UI:
with a flex model that creates a failing storage scheduling job.
with: {
"message": "No known schedule for this time period. Scheduling job failed with ValueError: Power capacity on asset 8 is not defined in the flex-model. StorageScheduler was used.",
"result": "Rejected",
"status": "UNKNOWN_SCHEDULE"
} |
There was a problem hiding this comment.
Pull request overview
This PR retires the built-in storage fallback scheduler so infeasible storage scheduling problems surface as explicit scheduling failures, and it enables SoC constraint relaxation by default for storage scheduling requests. It updates schema defaults, OpenAPI/docs, and tests to reflect the new behavior while keeping generic fallback redirect/job machinery for custom schedulers.
Changes:
- Default
relax-soc-constraintstoTruefor API scheduling flex-context, with corresponding OpenAPI metadata updates - Remove
StorageFallbackSchedulerand its utility fallback policy so infeasible storage schedules fail instead of silently producing fallback schedules - Update tests and documentation to validate/report the new default relaxation and failure behavior
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| flexmeasures/ui/static/openapi-specs.json | Updates OpenAPI defaults/descriptions for SoC relaxation and related flex-model fields |
| flexmeasures/data/tests/test_scheduling_sequential.py | Adjusts sequential scheduling tests to assert failure propagation without storage fallback jobs |
| flexmeasures/data/schemas/tests/test_sensor.py | Refactors quantity assertions to be unit/magnitude-based with tolerance |
| flexmeasures/data/schemas/tests/test_scheduling.py | Adds regression tests for default SoC relaxation behavior in schema loading |
| flexmeasures/data/schemas/scheduling/metadata.py | Updates schema metadata text to reflect default SoC relaxation and soft-constraint semantics |
| flexmeasures/data/schemas/scheduling/init.py | Defaults relax_soc_constraints to true (API) and refines breach-price defaulting behavior; keeps DB default false via override |
| flexmeasures/data/models/planning/utils.py | Removes fallback charging-policy helpers previously used by storage fallback scheduler |
| flexmeasures/data/models/planning/tests/test_storage.py | Updates storage relaxation test expectations to match new default SoC breach pricing behavior |
| flexmeasures/data/models/planning/tests/test_solver.py | Ensures infeasible storage problems raise directly and no fallback scheduler is configured |
| flexmeasures/data/models/planning/storage.py | Removes StorageFallbackScheduler and unsets storage scheduler fallback class |
| flexmeasures/api/v3_0/tests/test_sensors_api_freshdb.py | Makes numeric comparisons tolerant to floating-point rounding via pytest.approx |
| flexmeasures/api/v3_0/tests/test_sensor_schedules.py | Updates API scheduling tests to assert no fallback job creation and direct failure reporting (with/without redirect config) |
| documentation/features/scheduling.rst | Documents infeasible storage behavior and clarifies which constraints remain hard vs soft by default |
| documentation/configuration.rst | Clarifies FLEXMEASURES_FALLBACK_REDIRECT as a custom-scheduler fallback mechanism (not built-in storage) |
| documentation/changelog.rst | Adds user-facing changelog entry for default SoC relaxation and fallback scheduler retirement |
| documentation/api/introduction.rst | Updates 303 redirect documentation to focus on custom scheduler fallbacks and new storage behavior |
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Description
Look & Feel
N/A
How to test
Also ran the targeted solver fallback-retirement test.
Related Items
Closes #2201
Sign-off