Skip to content

Commit e567d19

Browse files
committed
Improve documentation for *pool creation methods
This clarifies that `*pool` instances should be reused within actors and should have distinct priorities when created from different actors. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent cec3a97 commit e567d19

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ def ev_charger_pool(
445445
When specifying priority, bigger values indicate higher priority. The default
446446
priority is the lowest possible value.
447447
448+
It is recommended to reuse the same instance of the `EVChargerPool` within the
449+
same actor, unless they are managing different sets of EV chargers.
450+
451+
In deployments with multiple actors managing the same set of EV chargers, it is
452+
recommended to use different priorities to distinguish between them. If not,
453+
a random prioritization will be imposed on them to resolve conflicts, which may
454+
lead to unexpected behavior.
455+
448456
Args:
449457
ev_charger_ids: Optional set of IDs of EV Chargers to be managed by the
450458
EVChargerPool. If not specified, all EV Chargers available in the
@@ -473,6 +481,14 @@ def battery_pool(
473481
When specifying priority, bigger values indicate higher priority. The default
474482
priority is the lowest possible value.
475483
484+
It is recommended to reuse the same instance of the `BatteryPool` within the
485+
same actor, unless they are managing different sets of batteries.
486+
487+
In deployments with multiple actors managing the same set of batteries, it is
488+
recommended to use different priorities to distinguish between them. If not,
489+
a random prioritization will be imposed on them to resolve conflicts, which may
490+
lead to unexpected behavior.
491+
476492
Args:
477493
battery_ids: Optional set of IDs of batteries to be managed by the `BatteryPool`.
478494
If not specified, all batteries available in the component graph are used.

0 commit comments

Comments
 (0)