Skip to content

Commit eff0cf3

Browse files
committed
Update propose_power docs to refer to microgrid docs
With this we only have to write the details on how the power manager works only once. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a4abcec commit eff0cf3

File tree

3 files changed

+29
-96
lines changed

3 files changed

+29
-96
lines changed

src/frequenz/sdk/timeseries/battery_pool/_battery_pool.py

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,17 @@ async def propose_power(
8989
Power values need to follow the Passive Sign Convention (PSC). That is, positive
9090
values indicate charge power and negative values indicate discharge power.
9191
92-
If the same batteries are shared by multiple actors, the power manager will
93-
consider the priority of the actors, the bounds they set, and their preferred
94-
power, when calculating the target power for the batteries.
95-
96-
The preferred power of lower priority actors will take precedence as long as
97-
they respect the bounds set by higher priority actors. If lower priority actors
98-
request power values outside of the bounds set by higher priority actors, the
99-
target power will be the closest value to the preferred power that is within the
100-
bounds.
101-
102-
When there are no other actors trying to use the same batteries, the actor's
103-
preferred power would be set as the target power, as long as it falls within the
104-
system power bounds for the batteries.
105-
106-
The result of the request can be accessed using the receiver returned from the
107-
[`power_status`][frequenz.sdk.timeseries.battery_pool.BatteryPool.power_status]
108-
method, which also streams the bounds that an actor should comply with, based on
109-
its priority.
92+
Details on how the power manager handles proposals can be found in the
93+
[Microgrid][frequenz.sdk.microgrid--setting-power] documentation.
11094
11195
Args:
11296
power: The power to propose for the batteries in the pool. If `None`, this
11397
proposal will not have any effect on the target power, unless bounds are
114-
specified. If both are `None`, it is equivalent to not having a
115-
proposal or withdrawing a previous one.
116-
bounds: The power bounds for the proposal. These bounds will apply to
117-
actors with a lower priority, and can be overridden by bounds from
118-
actors with a higher priority. If None, the power bounds will be set
119-
to the maximum power of the batteries in the pool. This is currently
120-
and experimental feature.
98+
specified. When specified without bounds, bounds for lower priority
99+
actors will be shifted by this power. If both are `None`, it is
100+
equivalent to not having a proposal or withdrawing a previous one.
101+
bounds: The power bounds for the proposal. When specified, this will limit
102+
the bounds for lower priority actors.
121103
"""
122104
await self._pool_ref_store._power_manager_requests_sender.send(
123105
_power_managing.Proposal(
@@ -140,13 +122,9 @@ async def propose_charge(self, power: Power | None) -> None:
140122
method might be more convenient.
141123
142124
If the same batteries are shared by multiple actors, the behaviour is the same
143-
as that of the `propose_power` method. The bounds for lower priority actors
144-
can't be specified with this method. If that's required, use the
145-
`propose_power` method instead.
146-
147-
The result of the request can be accessed using the receiver returned from the
148-
[`power_status`][frequenz.sdk.timeseries.battery_pool.BatteryPool.power_status]
149-
method.
125+
as that of the `propose_power` method, when calling it with `None` bounds. The
126+
bounds for lower priority actors can't be specified with this method. If that's
127+
required, use the `propose_power` method instead.
150128
151129
Args:
152130
power: The unsigned charge power to propose for the batteries in the pool.
@@ -179,13 +157,9 @@ async def propose_discharge(self, power: Power | None) -> None:
179157
method might be more convenient.
180158
181159
If the same batteries are shared by multiple actors, the behaviour is the same
182-
as that of the `propose_power` method. The bounds for lower priority actors
183-
can't be specified with this method. If that's required, use the
184-
`propose_power` method instead.
185-
186-
The result of the request can be accessed using the receiver returned from the
187-
[`power_status`][frequenz.sdk.timeseries.battery_pool.BatteryPool.power_status]
188-
method.
160+
as that of the `propose_power` method, when calling it with `None` bounds. The
161+
bounds for lower priority actors can't be specified with this method. If that's
162+
required, use the `propose_power` method instead.
189163
190164
Args:
191165
power: The unsigned discharge power to propose for the batteries in the

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,39 +77,17 @@ async def propose_power(
7777
the pool. The actual consumption might be lower based on the number of phases
7878
an EV is drawing power from, and its current state of charge.
7979
80-
Power values need to follow the Passive Sign Convention (PSC). That is, positive
81-
values indicate charge power and negative values indicate discharge power.
82-
Discharging from EV chargers is currently not supported.
83-
84-
If the same EV chargers are shared by multiple actors, the power manager will
85-
consider the priority of the actors, the bounds they set, and their preferred
86-
power, when calculating the target power for the EV chargers
87-
88-
The preferred power of lower priority actors will take precedence as long as
89-
they respect the bounds set by higher priority actors. If lower priority actors
90-
request power values outside of the bounds set by higher priority actors, the
91-
target power will be the closest value to the preferred power that is within the
92-
bounds.
93-
94-
When there are no other actors trying to use the same EV chargers, the actor's
95-
preferred power would be set as the target power, as long as it falls within the
96-
system power bounds for the EV chargers.
97-
98-
The result of the request can be accessed using the receiver returned from the
99-
[`power_status`][frequenz.sdk.timeseries.ev_charger_pool.EVChargerPool.power_status]
100-
method, which also streams the bounds that an actor should comply with, based on
101-
its priority.
80+
Details on how the power manager handles proposals can be found in the
81+
[Microgrid][frequenz.sdk.microgrid--setting-power] documentation.
10282
10383
Args:
10484
power: The power to propose for the EV chargers in the pool. If `None`,
10585
this proposal will not have any effect on the target power, unless
106-
bounds are specified. If both are `None`, it is equivalent to not
107-
having a proposal or withdrawing a previous one.
108-
bounds: The power bounds for the proposal. These bounds will apply to
109-
actors with a lower priority, and can be overridden by bounds from
110-
actors with a higher priority. If None, the power bounds will be set to
111-
the maximum power of the batteries in the pool. This is currently and
112-
experimental feature.
86+
bounds are specified. When specified without bounds, bounds for lower
87+
priority actors will be shifted by this power. If both are `None`, it
88+
is equivalent to not having a proposal or withdrawing a previous one.
89+
bounds: The power bounds for the proposal. When specified, these bounds will
90+
limit the bounds for lower priority actors.
11391
11492
Raises:
11593
EVChargerPoolError: If a discharge power for EV chargers is requested.

src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def __init__( # pylint: disable=too-many-arguments
5858
async def propose_power(
5959
self,
6060
power: Power | None,
61-
*,
6261
bounds: Bounds[Power | None] = Bounds(None, None),
6362
) -> None:
6463
"""Send a proposal to the power manager for the pool's set of PV inverters.
@@ -67,38 +66,20 @@ async def propose_power(
6766
the pool. The actual production might be lower.
6867
6968
Power values need to follow the Passive Sign Convention (PSC). That is, positive
70-
values indicate charge power and negative values indicate discharge power.
71-
Only discharge powers are allowed for PV inverters.
72-
73-
If the same PV inverters are shared by multiple actors, the power manager will
74-
consider the priority of the actors, the bounds they set, and their preferred
75-
power, when calculating the target power for the PV inverters.
76-
77-
The preferred power of lower priority actors will take precedence as long as
78-
they respect the bounds set by higher priority actors. If lower priority actors
79-
request power values outside of the bounds set by higher priority actors, the
80-
target power will be the closest value to the preferred power that is within the
81-
bounds.
82-
83-
When there are no other actors trying to use the same PV inverters, the actor's
84-
preferred power would be set as the target power, as long as it falls within the
85-
system power bounds for the PV inverters.
69+
values indicate charge power and negative values indicate discharge power. Only
70+
discharge powers are allowed for PV inverters.
8671
87-
The result of the request can be accessed using the receiver returned from the
88-
[`power_status`][frequenz.sdk.timeseries.pv_pool.PVPool.power_status]
89-
method, which also streams the bounds that an actor should comply with, based on
90-
its priority.
72+
Details on how the power manager handles proposals can be found in the
73+
[Microgrid][frequenz.sdk.microgrid--setting-power] documentation.
9174
9275
Args:
9376
power: The power to propose for the PV inverters in the pool. If `None`,
9477
this proposal will not have any effect on the target power, unless
95-
bounds are specified. If both are `None`, it is equivalent to not
96-
having a proposal or withdrawing a previous one.
97-
bounds: The power bounds for the proposal. These bounds will apply to
98-
actors with a lower priority, and can be overridden by bounds from
99-
actors with a higher priority. If None, the power bounds will be set to
100-
the maximum power of the batteries in the pool. This is currently and
101-
experimental feature.
78+
bounds are specified. When speficied without bounds, bounds for lower
79+
priority actors will be shifted by this power. If both are `None`, it
80+
is equivalent to not having a proposal or withdrawing a previous one.
81+
bounds: The power bounds for the proposal. When specified, this will limit
82+
the bounds for lower priority actors.
10283
10384
Raises:
10485
PVPoolError: If a charge power for PV inverters is requested.

0 commit comments

Comments
 (0)