Skip to content

Commit 4ea8e88

Browse files
committed
Reexport PowerDistributor result types from battery_pool
Now that the PowerDistributor is in a private module, the result types need to be reexported from somewhere. Later when there is a base component pool class, the result types can go there. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent e7d48f6 commit 4ea8e88

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""Manage a pool of batteries."""
55

66
from ._battery_pool import BatteryPool
7-
from ._result_types import BatteryPoolReport
7+
from .messages import BatteryPoolReport
88

99
__all__ = [
1010
"BatteryPool",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
SoCCalculator,
3131
TemperatureCalculator,
3232
)
33-
from ._result_types import BatteryPoolReport
33+
from .messages import BatteryPoolReport
3434

3535
# pylint: disable=protected-access
3636

src/frequenz/sdk/timeseries/battery_pool/_result_types.py renamed to src/frequenz/sdk/timeseries/battery_pool/messages.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
import abc
77
import typing
88

9+
from ...microgrid._power_distributing import (
10+
Error,
11+
OutOfBounds,
12+
PartialFailure,
13+
Result,
14+
Success,
15+
)
916
from .._base_types import Bounds
1017
from .._quantities import Power
1118

@@ -27,7 +34,7 @@ def bounds(self) -> Bounds[Power] | None:
2734
priorities.
2835
2936
There might be exclusion zones within these bounds. If necessary, the
30-
[`adjust_to_bounds`][frequenz.sdk.timeseries.battery_pool.BatteryPoolReport.adjust_to_bounds]
37+
[`adjust_to_bounds`][frequenz.sdk.timeseries.battery_pool.messages.BatteryPoolReport.adjust_to_bounds]
3138
method may be used to check if a desired power value fits the bounds, or to get
3239
the closest possible power values that do fit the bounds.
3340
"""
@@ -84,3 +91,13 @@ def adjust_to_bounds(self, power: Power) -> tuple[Power | None, Power | None]:
8491
A tuple of the closest power values to the desired power that fall within
8592
the available bounds for the actor.
8693
"""
94+
95+
96+
__all__ = [
97+
"BatteryPoolReport",
98+
"Error",
99+
"OutOfBounds",
100+
"PartialFailure",
101+
"Result",
102+
"Success",
103+
]

tests/timeseries/_battery_pool/test_battery_pool_control_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
ComponentPoolStatusTracker,
2323
)
2424
from frequenz.sdk.timeseries import Power
25-
from frequenz.sdk.timeseries.battery_pool import BatteryPoolReport
25+
from frequenz.sdk.timeseries.battery_pool.messages import BatteryPoolReport
2626

2727
from ...utils.component_data_streamer import MockComponentDataStreamer
2828
from ...utils.component_data_wrapper import BatteryDataWrapper, InverterDataWrapper

0 commit comments

Comments
 (0)