Skip to content

Commit 61765a8

Browse files
committed
Apply suggestions from code review comments
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 042e76b commit 61765a8

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/frequenz/sdk/actor/power_distributing/_component_pool_status_tracker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def join(self) -> None:
8181
await self._task
8282

8383
async def stop(self) -> None:
84-
"""Stop tracking batteries status."""
84+
"""Stop the ComponentPoolStatusTracker instance."""
8585
await cancel_and_await(self._task)
8686
await asyncio.gather(
8787
*[tracker.stop() for tracker in self._component_status_trackers],
@@ -134,21 +134,21 @@ async def _update_status(self) -> None:
134134
await self._component_status_sender.send(self._current_status)
135135

136136
async def update_status(
137-
self, succeed_components: set[int], failed_components: set[int]
137+
self, succeeded_components: set[int], failed_components: set[int]
138138
) -> None:
139-
"""Notify which components succeed and failed in the request.
139+
"""Notify which components succeeded or failed in the request.
140140
141141
Components that failed will be considered as broken and will be temporarily
142-
blocked for some time.
142+
blocked.
143143
144-
Components that succeed will be unblocked.
144+
Components that succeeded will be unblocked.
145145
146146
Args:
147-
succeed_components: Components that succeed request
148-
failed_components: Components that failed request
147+
succeeded_components: Component IDs for which the power request succeeded.
148+
failed_components: Component IDs for which the power request failed.
149149
"""
150150
await self._set_power_result_sender.send(
151-
SetPowerResult(succeeded=succeed_components, failed=failed_components)
151+
SetPowerResult(succeeded=succeeded_components, failed=failed_components)
152152
)
153153

154154
def get_working_components(self, components: abc.Set[int]) -> abc.Set[int]:

src/frequenz/sdk/actor/power_distributing/_component_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__( # pylint: disable=too-many-arguments
9292
"""Create class instance.
9393
9494
Args:
95-
component_id: Id of this battery
95+
component_id: Id of this component
9696
max_data_age_sec: If component stopped sending data, then
9797
this is the maximum time when its last message should be considered as
9898
valid. After that time, component won't be used until it starts sending
@@ -106,4 +106,4 @@ def __init__( # pylint: disable=too-many-arguments
106106

107107
@abstractmethod
108108
async def stop(self) -> None:
109-
"""Stop tracking battery status."""
109+
"""Stop the ComponentStatusTracker instance."""

tests/actor/test_battery_pool_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ async def test_batteries_status(self, mocker: MockerFixture) -> None:
9494
assert msg == batteries_status._current_status
9595

9696
await batteries_status.update_status(
97-
succeed_components={9}, failed_components={19, 29}
97+
succeeded_components={9}, failed_components={19, 29}
9898
)
9999
await asyncio.sleep(0.1)
100100
assert batteries_status.get_working_components(batteries) == {9}
101101

102102
await batteries_status.update_status(
103-
succeed_components={9, 19}, failed_components=set()
103+
succeeded_components={9, 19}, failed_components=set()
104104
)
105105
await asyncio.sleep(0.1)
106106
assert batteries_status.get_working_components(batteries) == {9, 19}

0 commit comments

Comments
 (0)