-
Couldn't load subscription status.
- Fork 20
Generalize PowerDistributingActor #786
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
Generalize PowerDistributingActor #786
Conversation
This is never expected to happen, because the task only reads from channels and writes to channels, and unless there's a bug in the SDK that closes the channels, the task won't die. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
This just moves the code out, so that it becomes easier to generalize and cleanup. Signed-off-by: Sahas Subramanian <[email protected]>
Also rename the file _distribution_algorithm.py → _battery_distribution_algorithm.py. Signed-off-by: Sahas Subramanian <[email protected]>
|
There might be some reusable code in the |
src/frequenz/sdk/actor/power_distributing/_component_managers/__init__.py
Outdated
Show resolved
Hide resolved
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 only have a couple of minor suggestions to check for.
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.
Also only comments about release notes.
| succeeded_batteries: set[int] | ||
| """The subset of batteries for which power was set successfully.""" | ||
| succeeded_components: abc.Set[int] | ||
| """The subset of components for which power was set successfully.""" |
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.
These changes should also go to the upgrading notes, as these types are now read-only.
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.
done here: b9c8573a
Signed-off-by: Sahas Subramanian <[email protected]>
253e5f7 to
b9c8573
Compare
Co-authored-by: daniel-zullo-frequenz <[email protected]> Signed-off-by: Sahas Subramanian <[email protected]>
All the battery-specific logic has been moved into a
BatteryManager(which implementsComponentManager). This includesThis allows us to add
ComponentManagerimplementations for additional component categories, that can be used with the PowerDistributingActor.