Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@

## Upgrading

- The `BatteryPool.power_status` method now streams objects of type `BatteryPoolReport`. They're identical to the previous `Report` objects, except for the name of the class.
- The `BatteryPool.power_status` method now streams objects of type `BatteryPoolReport`, replacing the previous `Report` objects.

- In `BatteryPoolReport.distribution_result`,
* the following fields have been renamed:
+ `Result.succeeded_batteries` → `Result.succeeded_components`
+ `Result.failed_batteries` → `Result.failed_components`
+ `Request.batteries` → `Request.component_ids`
* and the following fields are now type-hinted as `collections.abc.Set`, to clearly indicate that they are read-only:
+ `Result.succeeded_components`
+ `Result.failed_components`


## New Features

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/power_distribution/power_distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def run_test( # pylint: disable=too-many-locals
async with PowerDistributingActor(
requests_receiver=power_request_channel.new_receiver(),
results_sender=power_result_channel.new_sender(),
battery_status_sender=battery_status_channel.new_sender(),
component_pool_status_sender=battery_status_channel.new_sender(),
):
tasks: list[Coroutine[Any, Any, list[Result]]] = []
tasks.append(send_requests(batteries, num_requests))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async def _send_updated_target_power(
await self._power_distributing_requests_sender.send(
power_distributing.Request(
power=target_power,
batteries=component_ids,
component_ids=component_ids,
request_timeout=request_timeout,
adjust_power=True,
)
Expand Down Expand Up @@ -229,10 +229,12 @@ async def _run(self) -> None:
)

result = selected.value
self._distribution_results[frozenset(result.request.batteries)] = result
self._distribution_results[
frozenset(result.request.component_ids)
] = result
match result:
case power_distributing.PartialFailure(request):
await self._send_updated_target_power(
frozenset(request.batteries), None, must_send=True
frozenset(request.component_ids), None, must_send=True
)
await self._send_reports(frozenset(result.request.batteries))
await self._send_reports(frozenset(result.request.component_ids))
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH

"""Interfaces for the power distributing actor with different component types."""

from ._battery_manager import BatteryManager
from ._component_manager import ComponentManager

__all__ = [
"BatteryManager",
"ComponentManager",
]
Loading