Skip to content

Commit a5287ec

Browse files
committed
Revert "Rename parameter in_shifting_groupset_operating_point (#970)"
This reverts commit 6a54a0b, reversing changes made to 4c71140. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 0ba3a3c commit a5287ec

File tree

9 files changed

+110
-114
lines changed

9 files changed

+110
-114
lines changed

src/frequenz/sdk/microgrid/__init__.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -186,39 +186,40 @@
186186
[`propose_power`][frequenz.sdk.timeseries.battery_pool.BatteryPool.propose_power]
187187
methods.
188188
189-
### Shifting the target power by an Operating Point power
189+
### Shifting the target power by an offset
190190
191-
There are cases where the target power needs to be shifted by an operating point. This
192-
can be done by designating some actors to be able to set only the operating point power.
191+
There are cases where the target power needs to be shifted by a certain amount, for
192+
example, to make adjustments to the operating point. This can be done by designating
193+
some actors to be part of the `shifting_group`.
193194
194195
When creating a `*Pool` instance using the above-mentioned constructors, an optional
195-
`set_operating_point` parameter can be passed to specify that this actor is special, and
196-
the target power of the regular actors will be shifted by the target power of all actors
197-
with `set_operating_point` together.
196+
`in_shifting_group` parameter can be passed to specify that this actor is special, and
197+
the target power of the regular actors will be shifted by the target power of all
198+
shifting actors together.
198199
199-
In a location with 2 regular actors and 1 `set_operating_point` actor, here's how things
200+
In a location with 2 regular actors and 1 shifting actor, here's how things
200201
would play out:
201202
202-
1. When only regular actors have made proposals, the power bounds available from the
203-
batteries are available to them exactly.
203+
1. When only non-shifting actors have made proposals, the power bounds available
204+
from the batteries are available to them exactly.
204205
205-
| actor priority | in op group? | proposed power/bounds | available bounds |
206-
|----------------|--------------|-----------------------|------------------|
207-
| 3 | No | 1000, -4000..2500 | -3000..3000 |
208-
| 2 | No | 2500 | -3000..2500 |
209-
| 1 | Yes | None | -3000..3000 |
206+
| actor priority | in shifting group? | proposed power/bounds | available bounds |
207+
|----------------|--------------------|-----------------------|------------------|
208+
| 3 | No | 1000, -4000..2500 | -3000..3000 |
209+
| 2 | No | 2500 | -3000..2500 |
210+
| 1 | Yes | None | -3000..3000 |
210211
211212
Power actually distributed to the batteries: 2500W
212213
213-
2. When the `set_operating_point` actor has made proposals, the bounds available to the
214-
regular actors gets shifted, and the final power that actually gets distributed to
215-
the batteries is also shifted.
214+
2. When the shifting actor has made proposals, the bounds available to the
215+
regular actors gets shifted, and the final power that actually gets
216+
distributed to the batteries is also shifted.
216217
217-
| actor priority | in op group? | proposed power/bounds | available bounds |
218-
|----------------|--------------|-----------------------|------------------|
219-
| 3 | No | 1000, -4000..2500 | -2000..4000 |
220-
| 2 | No | 2500 | -2000..2500 |
221-
| 1 | Yes | -1000 | -3000..3000 |
218+
| actor priority | in shifting group? | proposed power/bounds | available bounds |
219+
|----------------|--------------------|-----------------------|------------------|
220+
| 3 | No | 1000, -4000..2500 | -2000..4000 |
221+
| 2 | No | 2500 | -2000..2500 |
222+
| 1 | Yes | -1000 | -3000..3000 |
222223
223224
Power actually distributed to the batteries: 1500W
224225
""" # noqa: D205, D400

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def new_ev_charger_pool(
210210
priority: int,
211211
component_ids: abc.Set[int] | None = None,
212212
name: str | None = None,
213-
set_operating_point: bool = False,
213+
in_shifting_group: bool = False,
214214
) -> EVChargerPool:
215215
"""Return the corresponding EVChargerPool instance for the given ids.
216216
@@ -223,8 +223,8 @@ def new_ev_charger_pool(
223223
EVChargerPool.
224224
name: An optional name used to identify this instance of the pool or a
225225
corresponding actor in the logs.
226-
set_operating_point: Whether this instance sets the operating point power or
227-
the normal power for the components.
226+
in_shifting_group: Whether the power requests get sent to the shifting group
227+
in the PowerManager or not.
228228
229229
Returns:
230230
An EVChargerPool instance.
@@ -281,7 +281,7 @@ def new_ev_charger_pool(
281281
pool_ref_store=self._ev_charger_pool_reference_stores[ref_store_key],
282282
name=name,
283283
priority=priority,
284-
set_operating_point=set_operating_point,
284+
in_shifting_group=in_shifting_group,
285285
)
286286

287287
def new_pv_pool(
@@ -290,7 +290,7 @@ def new_pv_pool(
290290
priority: int,
291291
component_ids: abc.Set[int] | None = None,
292292
name: str | None = None,
293-
set_operating_point: bool = False,
293+
in_shifting_group: bool = False,
294294
) -> PVPool:
295295
"""Return a new `PVPool` instance for the given ids.
296296
@@ -303,8 +303,8 @@ def new_pv_pool(
303303
`PVPool`.
304304
name: An optional name used to identify this instance of the pool or a
305305
corresponding actor in the logs.
306-
set_operating_point: Whether this instance sets the operating point power or
307-
the normal power for the components.
306+
in_shifting_group: Whether the power requests get sent to the shifting group
307+
in the PowerManager or not.
308308
309309
Returns:
310310
A `PVPool` instance.
@@ -358,7 +358,7 @@ def new_pv_pool(
358358
pool_ref_store=self._pv_pool_reference_stores[ref_store_key],
359359
name=name,
360360
priority=priority,
361-
set_operating_point=set_operating_point,
361+
in_shifting_group=in_shifting_group,
362362
)
363363

364364
def new_battery_pool(
@@ -367,7 +367,7 @@ def new_battery_pool(
367367
priority: int,
368368
component_ids: abc.Set[int] | None = None,
369369
name: str | None = None,
370-
set_operating_point: bool = False,
370+
in_shifting_group: bool = False,
371371
) -> BatteryPool:
372372
"""Return a new `BatteryPool` instance for the given ids.
373373
@@ -380,8 +380,8 @@ def new_battery_pool(
380380
`BatteryPool`.
381381
name: An optional name used to identify this instance of the pool or a
382382
corresponding actor in the logs.
383-
set_operating_point: Whether this instance sets the operating point power or
384-
the normal power for the components.
383+
in_shifting_group: Whether the power requests get sent to the shifting group
384+
in the PowerManager or not.
385385
386386
Returns:
387387
A `BatteryPool` instance.
@@ -440,7 +440,7 @@ def new_battery_pool(
440440
pool_ref_store=self._battery_pool_reference_stores[ref_store_key],
441441
name=name,
442442
priority=priority,
443-
set_operating_point=set_operating_point,
443+
in_shifting_group=in_shifting_group,
444444
)
445445

446446
def _data_sourcing_request_sender(self) -> Sender[ComponentMetricRequest]:
@@ -557,7 +557,7 @@ def new_ev_charger_pool(
557557
priority: int,
558558
component_ids: abc.Set[int] | None = None,
559559
name: str | None = None,
560-
set_operating_point: bool = False,
560+
in_shifting_group: bool = False,
561561
) -> EVChargerPool:
562562
"""Return a new `EVChargerPool` instance for the given parameters.
563563
@@ -583,8 +583,8 @@ def new_ev_charger_pool(
583583
component graph are used.
584584
name: An optional name used to identify this instance of the pool or a
585585
corresponding actor in the logs.
586-
set_operating_point: Whether this instance sets the operating point power or the
587-
normal power for the components.
586+
in_shifting_group: Whether the power requests get sent to the shifting group
587+
in the PowerManager or not.
588588
589589
Returns:
590590
An `EVChargerPool` instance.
@@ -593,7 +593,7 @@ def new_ev_charger_pool(
593593
priority=priority,
594594
component_ids=component_ids,
595595
name=name,
596-
set_operating_point=set_operating_point,
596+
in_shifting_group=in_shifting_group,
597597
)
598598

599599

@@ -602,7 +602,7 @@ def new_battery_pool(
602602
priority: int,
603603
component_ids: abc.Set[int] | None = None,
604604
name: str | None = None,
605-
set_operating_point: bool = False,
605+
in_shifting_group: bool = False,
606606
) -> BatteryPool:
607607
"""Return a new `BatteryPool` instance for the given parameters.
608608
@@ -628,8 +628,8 @@ def new_battery_pool(
628628
graph are used.
629629
name: An optional name used to identify this instance of the pool or a
630630
corresponding actor in the logs.
631-
set_operating_point: Whether this instance sets the operating point power or the
632-
normal power for the components.
631+
in_shifting_group: Whether the power requests get sent to the shifting group
632+
in the PowerManager or not.
633633
634634
Returns:
635635
A `BatteryPool` instance.
@@ -638,7 +638,7 @@ def new_battery_pool(
638638
priority=priority,
639639
component_ids=component_ids,
640640
name=name,
641-
set_operating_point=set_operating_point,
641+
in_shifting_group=in_shifting_group,
642642
)
643643

644644

@@ -647,7 +647,7 @@ def new_pv_pool(
647647
priority: int,
648648
component_ids: abc.Set[int] | None = None,
649649
name: str | None = None,
650-
set_operating_point: bool = False,
650+
in_shifting_group: bool = False,
651651
) -> PVPool:
652652
"""Return a new `PVPool` instance for the given parameters.
653653
@@ -673,8 +673,8 @@ def new_pv_pool(
673673
graph are used.
674674
name: An optional name used to identify this instance of the pool or a
675675
corresponding actor in the logs.
676-
set_operating_point: Whether this instance sets the operating point power or the
677-
normal power for the components.
676+
in_shifting_group: Whether the power requests get sent to the shifting group
677+
in the PowerManager or not.
678678
679679
Returns:
680680
A `PVPool` instance.
@@ -683,7 +683,7 @@ def new_pv_pool(
683683
priority=priority,
684684
component_ids=component_ids,
685685
name=name,
686-
set_operating_point=set_operating_point,
686+
in_shifting_group=in_shifting_group,
687687
)
688688

689689

src/frequenz/sdk/microgrid/_power_managing/_base_classes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class ReportRequest:
3232
priority: int
3333
"""The priority of the actor ."""
3434

35-
set_operating_point: bool
36-
"""Whether this proposal sets the operating point power or the normal power."""
35+
in_shifting_group: bool
36+
"""Whether the proposal gets sent to the shifting group of the power manager."""
3737

3838
def get_channel_name(self) -> str:
3939
"""Get the channel name for the report request.
@@ -157,8 +157,8 @@ class Proposal:
157157
This is used by the power manager to determine the age of the proposal.
158158
"""
159159

160-
set_operating_point: bool
161-
"""Whether this proposal sets the operating point power or the normal power."""
160+
in_shifting_group: bool
161+
"""Whether the proposal gets sent to the shifting group of the power manager."""
162162

163163
def __lt__(self, other: Proposal) -> bool:
164164
"""Compare two proposals by their priority.

0 commit comments

Comments
 (0)