-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/multi asset StorageScheduler #1313
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…a scheduling job Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…ntext Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: Victor Garcia Reolid <[email protected]>
…ing-asset' into feature/api/endpoint-for-scheduling-asset
This reverts commit ff22fea.
This reverts commit 4621ef6.
…ext" This reverts commit 8374a9c.
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…alse Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review, incl. 1 suggestion for @Tammevesky to take up.
@@ -211,3 +219,91 @@ def _get_variable_quantity_unit( | |||
f"Unexpected type '{type(variable_quantity)}' for '{field}': {variable_quantity}." | |||
) | |||
return unit | |||
|
|||
|
|||
class SequentialFlexModelSchema(Schema): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently being used for both simultaneous and sequential multi-asset scheduling, but not meant to be used for the simultaneous case. Misusing it for that is likely causing the double nesting of the sensor-flex-model
field.
return {"sensor-flex-model": extra, **rest} | ||
|
||
|
||
class AssetTriggerSchema(Schema): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cherry-picked, but currently not used in this PR. May belong in #1065 instead.
) -> list[Job]: | ||
jobs = [] | ||
|
||
# scheduler_kwargs["resolution"] = sensor.event_resolution # todo: needed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a test involving two flexible devices with different resolutions should clear this up.
force_new_job_creation: bool = False, | ||
scheduler_specs: dict | None = None, | ||
depends_on: list[Job] | None = None, | ||
**scheduler_kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduler_kwargs
is in desperate need of a docstring example, especially for its flex_model
after we'll (partially?) deserialize it by passing it through a to-be-created SimultaneousFlexModelSchema
.
force_new_job_creation: bool = False, | ||
scheduler_specs: dict | None = None, | ||
depends_on: list[Job] | None = None, | ||
**scheduler_kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scheduler_kwargs
is in desperate need of a docstring example, especially for its flex_model
, which is partially deserialized after passing through SequentialFlexModelSchema
.
assert all(ev_power.loc[start_charging:end_charging] == -0.01) # 10 kW | ||
assert all(battery_power.loc[start_charging:end_charging] == 0.01) # 10 kW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@svenay We should adjust this test so our expectations here differ from that of the sequential case.
|
||
if soc_targets and not isinstance(soc_targets, Sensor): | ||
max_target_datetime = max([soc_target["end"] for soc_target in soc_targets]) | ||
if max_target_datetime > self.end: | ||
max_server_horizon = get_max_planning_horizon(self.resolution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first thought is that this function still does what it is supposed to do, namely extending the planning horizon if needed, therein taking into account the resolution of each device's power sensor. But it deserves a closer look, especially regarding how the horizon is derived using the resolution.
…straints for device d rather than device 0. Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…multi-asset-StorageScheduler
Signed-off-by: F.N. Claessen <[email protected]>
…multi-asset-StorageScheduler
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…a future version, please use 'h' instead. Signed-off-by: F.N. Claessen <[email protected]>
…fields is deprecated. Use 'dump_default' instead. Signed-off-by: F.N. Claessen <[email protected]>
…ated with new scheduler data source "<Data source 12 (None's SuccessfulScheduler model vNone)>".` Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
This reverts commit bad7cba.
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Description
create_sequential_scheduling_job
create_simultaneous_scheduling_job
Look & Feel
This section can contain example pictures for UI, Input/Output for CLI, Request / Response for API endpoint, etc.
How to test
test_ceate_sequential_scheduling_job
test_ceate_simultaneous_scheduling_job
flexmeasures-client
is not yet compatible, because the API is not yet compatible. This PR is only for (plugin) developers.Further Improvements
In scope:
documentation/changelog.rst
under 'Infrastructure / Support' section, targeting (plugin) developers in this particular PR.Follow-up issue:
Related Items
Mention if this PR closes an Issue or Project.