Skip to content
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

Warn when several calls to microgrid.battery_pool(), ev_charger_pool(), pv_pool() are made #902

Closed
shsms opened this issue Mar 26, 2024 · 0 comments · Fixed by #904
Closed
Assignees
Labels
part:data-pipeline Affects the data pipeline type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@shsms
Copy link
Contributor

shsms commented Mar 26, 2024

What's needed?

Every call to microgrid.*pool() returns a new instance, with a unique source_id. Actors are supposed to hold a reference to their pools and reuse them, instead of creating a new one each time they want to send a command.

Ideally an actor should make only a single call to a *pool() method, so that the bounds it streams correspond with the requests, etc.

But if someone does it the WRONG way microgrid.battery_pool().set_power(), they are currently not informed about it by any of the checks.

Proposed solution

There needs to be a runtime check that starts printing warning logs when more than 1 call has been made to the microgrid.battery_pool() method, with the same priority and with the same set of batteries.

The log message could say that if they are made by different actors, they should explicitly set different priority values, and if they are made by the same actor, they should stop that and instead reuse the same instance.

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

@shsms shsms added type:enhancement New feature or enhancement visitble to users part:data-pipeline Affects the data pipeline labels Mar 26, 2024
@shsms shsms added this to the v1.0.0-rc6 milestone Mar 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
This is because such usage could make the power manager take longer to
converge on the desired power.

This PR also improves the docs for the `microgrid.*pool()` functions.

Closes #902
@shsms shsms closed this as completed in #904 Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:data-pipeline Affects the data pipeline type:enhancement New feature or enhancement visitble to users
Projects
Development

Successfully merging a pull request may close this issue.

1 participant