Skip to content

Commit b83c480

Browse files
committed
Rename get_target_power to calculate_target_power
Also fix a typo and remove an outdated code comment. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 79ecc0d commit b83c480

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Proposal:
9191
9292
These bounds will apply to actors with a lower priority, and can be overridden by
9393
bounds from actors with a higher priority. If None, the power bounds will be set to
94-
the maximum power of the batteries in the pool. This is currently and experimental
94+
the maximum power of the batteries in the pool. This is currently an experimental
9595
feature.
9696
"""
9797

@@ -144,7 +144,7 @@ class BaseAlgorithm(abc.ABC):
144144
"""The base class for algorithms."""
145145

146146
@abc.abstractmethod
147-
def get_target_power(
147+
def calculate_target_power(
148148
self,
149149
battery_ids: frozenset[int],
150150
proposal: Proposal | None,

src/frequenz/sdk/actor/_power_managing/_matryoshka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _validate_battery_ids(
123123
return True
124124

125125
@override
126-
def get_target_power(
126+
def calculate_target_power(
127127
self,
128128
battery_ids: frozenset[int],
129129
proposal: Proposal | None,

src/frequenz/sdk/actor/_power_managing/_power_managing_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async def _send_updated_target_power(
148148
) -> None:
149149
from .. import power_distributing # pylint: disable=import-outside-toplevel
150150

151-
target_power = self._algorithm.get_target_power(
151+
target_power = self._algorithm.calculate_target_power(
152152
battery_ids,
153153
proposal,
154154
self._system_bounds[battery_ids],

tests/actor/_power_managing/test_matryoshka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_tgt_power(
3535
) -> None:
3636
nonlocal call_count
3737
call_count += 1
38-
tgt_power = algorithm.get_target_power(
38+
tgt_power = algorithm.calculate_target_power(
3939
batteries,
4040
Proposal(
4141
battery_ids=batteries,

tests/timeseries/_battery_pool/test_battery_pool_control_methods.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ async def test_case_1(
180180

181181
battery_pool = microgrid.battery_pool()
182182

183-
# This is used just to wait for the processing to be complete. The results are
184-
# not used.
185-
#
186-
# It will be replaced by a reporting streaming from the PowerManager in a
187-
# subsequent commit.
188183
bounds_rx = battery_pool.power_status.new_receiver()
189184

190185
self._assert_report(

0 commit comments

Comments
 (0)