Skip to content

Stream exclusion bounds from the battery pool #537

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

Merged
merged 9 commits into from
Aug 8, 2023

Conversation

shsms
Copy link
Contributor

@shsms shsms commented Jul 26, 2023

Based on #416, to be merged after upgrading the Microgrid API dependency to v0.15.1.

Also closes #524

@shsms shsms requested a review from a team as a code owner July 26, 2023 13:23
@shsms shsms requested a review from Marenz July 26, 2023 13:23
@github-actions github-actions bot added part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:data-pipeline Affects the data pipeline part:power-management Affects the management of battery power and distribution part:actor Affects an actor ot the actors utilities (decorator, etc.) part:microgrid Affects the interactions with the microgrid labels Jul 26, 2023
@shsms shsms marked this pull request as draft July 26, 2023 13:24
@shsms shsms force-pushed the battery-pool-excl-bounds branch 5 times, most recently from 782ec3f to 4a49683 Compare August 1, 2023 13:38
@llucax llucax added this to the v0.24.0 milestone Aug 2, 2023
@llucax llucax linked an issue Aug 2, 2023 that may be closed by this pull request
@shsms shsms force-pushed the battery-pool-excl-bounds branch 2 times, most recently from e7e3066 to eb6e988 Compare August 3, 2023 12:12
@github-actions github-actions bot added the part:docs Affects the documentation label Aug 3, 2023
@shsms shsms force-pushed the battery-pool-excl-bounds branch from eb6e988 to edf865d Compare August 4, 2023 15:40
@shsms shsms marked this pull request as ready for review August 4, 2023 15:42
shsms added 7 commits August 4, 2023 18:45
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
It is a class that contains lower and upper bounds, so plural is
better.  There are other breaking changes related to inclusion and
exclusion bounds, thar are coming up in subsequent commits, so now is
a nice opportunity to make this change.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
`inclusion/exclusion` bounds are a better representation of the
passive sign convention, than `supply/consume` bounds.

But `supply/consume` bounds are not gone for ever,  they will be
re-implemented as unsigned `charge/discharge` bounds in a separate
PR.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
They were represented with `float`s before.

Closes frequenz-floss#524

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
This is because once we add exclusion bounds, the function will become
too big.  And instead, we can add it as a separate method in a
subsequent commit.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@shsms shsms force-pushed the battery-pool-excl-bounds branch from edf865d to 5bb5bb3 Compare August 4, 2023 16:45
@github-actions github-actions bot removed part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:power-management Affects the management of battery power and distribution labels Aug 4, 2023
@shsms
Copy link
Contributor Author

shsms commented Aug 4, 2023

Rebased on latest

llucax
llucax previously approved these changes Aug 8, 2023
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few very minor comments that can be addressed in a separate PR.

When exclusion bounds are present, they will exclude a subset of the inclusion
bounds.

More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could now point to the generated docs: https://frequenz-floss.github.io/frequenz-api-common/next/python-reference/frequenz/api/common/metrics_pb2/#frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds

We could even just use python symbols for cross referencing if we add these object indexes:

diff --git a/mkdocs.yml b/mkdocs.yml
index e8ddb46..13fe0f1 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -105,7 +105,9 @@ plugins:
           import:
             # See https://mkdocstrings.github.io/python/usage/#import for details
             - https://docs.python.org/3/objects.inv
+            - https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv
             - https://frequenz-floss.github.io/frequenz-channels-python/v0.14/objects.inv
+            - https://frequenz-floss.github.io/frequenz-api-microgrid/v0.15/objects.inv
             - https://grpc.github.io/grpc/python/objects.inv
             - https://networkx.org/documentation/stable/objects.inv
             - https://numpy.org/doc/stable/objects.inv
Suggested change
More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
See [`frequenz.api.common.metrics_pb2.Metric.system_exclusion_bounds`][] for more details.

But for this to work we need to initialize the microgrid API generated docs and we need to tag v0.3.1 in the common API so we can have a stable link to the docs (for now only the next version is provided), so we can update this in a followup PR.

(as a nice side-effect we can remove the # pylint: disable=line-too-long too, probably :D)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the range within which power requests are NOT allowed by the battery pool.
If present, they will be a subset of the inclusion bounds.

More details [here](https://github.com/frequenz-floss/frequenz-api-common/blob/v0.3.0/proto/frequenz/api/common/metrics.proto#L37-L91).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Signed-off-by: Leandro Lucarella <luca@llucax.com>
Copy link
Contributor

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luca's suggestions about documentation sound good to me.
I can only add that the release notes should include a reference or link to the documentation of inclusion/exclusion bounds, otherwise the user needs to go through the code to get the info/links. But that can be also done in a separate PR

@llucax
Copy link
Contributor

llucax commented Aug 8, 2023

I can only add that the release notes should include a reference or link to the documentation of inclusion/exclusion bounds, otherwise the user needs to go through the code to get the info/links. But that can be also done is a separate PR

Lets do that in a separate commit, when also improving the links in the code.

@llucax llucax added this pull request to the merge queue Aug 8, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit d7c524d Aug 8, 2023
@shsms shsms deleted the battery-pool-excl-bounds branch August 8, 2023 10:28
github-merge-queue bot pushed a commit that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:actor Affects an actor ot the actors utilities (decorator, etc.) part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid part:tests Affects the unit, integration and performance (benchmarks) tests
Projects
Development

Successfully merging this pull request may close these issues.

Define power bound attributes as Power type
3 participants