Add curtailable-device-sensors scheduling logic to StorageScheduler#2000
Draft
Copilot wants to merge 2 commits intofeat/curtailable-devicesfrom
Draft
Add curtailable-device-sensors scheduling logic to StorageScheduler#2000Copilot wants to merge 2 commits intofeat/curtailable-devicesfrom
Copilot wants to merge 2 commits intofeat/curtailable-devicesfrom
Conversation
…e tests Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Take over work on pull request 1937
Add curtailable-device-sensors scheduling logic to StorageScheduler
Mar 4, 2026
Copilot stopped work on behalf of
Flix6x due to an error
March 4, 2026 23:33
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.
PR #1937 added the
curtailable-device-sensorsflex-context field and schema definition but left the StorageScheduler logic and tests unimplemented.Changes
Scheduling logic (
storage.py): InMetaStorageScheduler._prepare(), curtailable devices are appended after inflexible devices in the device constraint list (indicesD+ItoD+I+C-1). Instead of a fixedderivative equalsconstraint, they get bounded constraints derived from their forecast:This lets the optimizer curtail a device to anywhere between 0 and its forecast — e.g. a solar panel producing -5 MW can be curtailed to any value in [-5, 0] MW.
Test (
test_sensor_schedules_fresh_db.py):test_inflexible_device_sensors_priorityalready received a curtailable solar sensor in the flex-context from the original PR. Updatedexpect_sensor_numfrom1→2in all parametrize cases to account for the additionalget_power_valuescall for the curtailable sensor.Changelog: Added entry to
documentation/changelog.rst.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.