-
Notifications
You must be signed in to change notification settings - Fork 36
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/save soc values as a sensor #1018
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ahmad Wahid <[email protected]>
Signed-off-by: Ahmad Wahid <[email protected]>
Signed-off-by: Ahmad Wahid <[email protected]>
…-soc-values-as-a-sensor # Conflicts: # flexmeasures/data/models/planning/tests/test_solver.py
Signed-off-by: Ahmad Wahid <[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.
Thanks. It's even a bit more already than what was needed. Let's limit the scope just a little for clarity and a step-wise robust approach, and other than that I think we only need to pass some more info to the integration function.
…-soc-values-as-a-sensor
Signed-off-by: Ahmad Wahid <[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]>
…planning/save-soc-values-as-a-sensor Signed-off-by: F.N. Claessen <[email protected]> # Conflicts: # flexmeasures/data/models/planning/storage.py # flexmeasures/data/schemas/scheduling/storage.py # flexmeasures/data/schemas/sensors.py
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]>
…flict 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.
I resolved some merge conflicts and updated the PR description (incl. follow-up suggestions). I hope that clarifies the scope of this PR. Can you create the follow-up tickets?
As for this PR, I suggest to leave in the commented out code that already works towards reading the starting SoC from the SoC sensor. The one code change I'd still like to see is the CLI and API initialize the scheduler with multiple=True
in case the "soc"
flex-model field is used. Finally, some documentation is within this PR's scope. Specifically, a changelog entry and an entry in the list of flex-model fields in features/scheduling.rst
.
"soc", | ||
type=VariableQuantityField("MWh"), | ||
required=False, | ||
help="State of charge (e.g sensor:<id>, or 0.328) at the start of the schedule.", |
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.
help="State of charge (e.g sensor:<id>, or 0.328) at the start of the schedule.", | |
# help='State of charge (e.g sensor:<id>, or "328 kWh") at the start of the schedule. If a sensor is passed, the computed schedule will also be saved to it.', | |
help='If a sensor (e.g sensor:<id>) recording the state of charge is passed, the computed schedule will also be saved to it.', |
Description
This PR introducescreate_soc_schedule
, a function to generate a state of charge (SOC) schedule from provided data. It also handles the creation or retrieval of the corresponding SOC sensor.multiple=True
and the flex-model passed to it includes a"soc": {"sensor": <sensor_id>}
, its compute function returns adict
that includes the SoC schedule next to the power schedule.Look & Feel
UI output looks like this:
How to test
Try to run the Toy examples(1 and 2), first add the beliefs from here and then add the schedule from here. You will see a sensor with name
soc schedule
and id4
. Similarly, you can see the data intimed_beliefs
table.Further Improvements
Follow-ups:
"soc"
. This should be used as the starting value, and we should throw aValidationError
if both"soc"
and"soc-at-start"
are passed in the flex-model)."soc"
. We should make some sort of inference if the specs do not contain a value for the exact start time of the schedule, or fail with a clear error message.Related Items
Mention if this PR closes an Issue or Project.