Skip to content

Commit 4bc950a

Browse files
committed
Rename power_bounds -> power_status and update docs
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a0791df commit 4bc950a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

benchmarks/power_distribution/power_distributor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def send_requests(batteries: set[int], request_num: int) -> list[Result]:
5151
List of the results from the PowerDistributingActor.
5252
"""
5353
battery_pool = microgrid.battery_pool(batteries)
54-
results_rx = battery_pool.power_bounds.new_receiver()
54+
results_rx = battery_pool.power_status.new_receiver()
5555
result: list[Any] = []
5656
for _ in range(request_num):
5757
await battery_pool.set_power(Power(float(random.randrange(100000, 1000000))))

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,16 @@ def capacity(self) -> ReceiverFetcher[Sample[Energy]]:
383383
return self._battery_pool._active_methods[method_name]
384384

385385
@property
386-
def power_bounds(self) -> ReceiverFetcher[_power_managing.Report]:
387-
"""Get a receiver to receive new power bounds when they change.
386+
def power_status(self) -> ReceiverFetcher[_power_managing.Report]:
387+
"""Get a receiver to receive new power status reports when they change.
388388
389-
These bounds are the bounds specified the power manager for actors with the
390-
given priority.
389+
These include
390+
- the current inclusion/exclusion bounds available for the pool's priority,
391+
- the current target power for the pool's set of batteries,
392+
- the result of the last distribution request for the pool's set of batteries.
391393
392394
Returns:
393-
A receiver that will receive the power bounds for the given priority.
395+
A receiver that will stream power status reports for the pool's priority.
394396
"""
395397
sub = _power_managing.ReportRequest(
396398
source_id=self._source_id,

tests/timeseries/_battery_pool/test_battery_pool_control_methods.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async def test_case_1(
185185
#
186186
# It will be replaced by a reporting streaming from the PowerManager in a
187187
# subsequent commit.
188-
bounds_rx = battery_pool.power_bounds.new_receiver()
188+
bounds_rx = battery_pool.power_status.new_receiver()
189189

190190
self._assert_report(
191191
await bounds_rx.receive(), power=None, lower=-4000.0, upper=4000.0
@@ -279,9 +279,9 @@ async def test_case_2(self, mocks: Mocks, mocker: MockerFixture) -> None:
279279
await self._init_data_for_inverters(mocks)
280280

281281
battery_pool_1 = microgrid.battery_pool(set(mocks.microgrid.battery_ids[:2]))
282-
bounds_1_rx = battery_pool_1.power_bounds.new_receiver()
282+
bounds_1_rx = battery_pool_1.power_status.new_receiver()
283283
battery_pool_2 = microgrid.battery_pool(set(mocks.microgrid.battery_ids[2:]))
284-
bounds_2_rx = battery_pool_2.power_bounds.new_receiver()
284+
bounds_2_rx = battery_pool_2.power_status.new_receiver()
285285

286286
self._assert_report(
287287
await bounds_1_rx.receive(), power=None, lower=-2000.0, upper=2000.0
@@ -325,9 +325,9 @@ async def test_case_3(self, mocks: Mocks, mocker: MockerFixture) -> None:
325325
await self._init_data_for_inverters(mocks)
326326

327327
battery_pool_1 = microgrid.battery_pool(priority=2)
328-
bounds_1_rx = battery_pool_1.power_bounds.new_receiver()
328+
bounds_1_rx = battery_pool_1.power_status.new_receiver()
329329
battery_pool_2 = microgrid.battery_pool(priority=1)
330-
bounds_2_rx = battery_pool_2.power_bounds.new_receiver()
330+
bounds_2_rx = battery_pool_2.power_status.new_receiver()
331331

332332
self._assert_report(
333333
await bounds_1_rx.receive(), power=None, lower=-4000.0, upper=4000.0

0 commit comments

Comments
 (0)