Skip to content

Add curtailable-device-sensors scheduling logic to StorageScheduler#2000

Draft
Copilot wants to merge 2 commits intofeat/curtailable-devicesfrom
copilot/takeover-pr-1937
Draft

Add curtailable-device-sensors scheduling logic to StorageScheduler#2000
Copilot wants to merge 2 commits intofeat/curtailable-devicesfrom
copilot/takeover-pr-1937

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

PR #1937 added the curtailable-device-sensors flex-context field and schema definition but left the StorageScheduler logic and tests unimplemented.

Changes

  • Scheduling logic (storage.py): In MetaStorageScheduler._prepare(), curtailable devices are appended after inflexible devices in the device constraint list (indices D+I to D+I+C-1). Instead of a fixed derivative equals constraint, they get bounded constraints derived from their forecast:

    device_constraints[idx]["derivative min"] = forecast_values.clip(upper=0)  # max production
    device_constraints[idx]["derivative max"] = forecast_values.clip(lower=0)  # max consumption

    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_priority already received a curtailable solar sensor in the flex-context from the original PR. Updated expect_sensor_num from 12 in all parametrize cases to account for the additional get_power_values call for the curtailable sensor.

  • Changelog: Added entry to documentation/changelog.rst.

Original prompt

Pull request: #1937

Take over work on this PR.

Custom agent used: review-lead
Orchestrates team of specialist agents for comprehensive code reviews and synthesizes their findings into unified recommendations


💡 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.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants