Skip to content

Commit f52aff9

Browse files
committed
Rename microgrid.pv_poolmicrogrid.new_pv_pool
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 8e910ed commit f52aff9

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _add_system_bounds_tracker(self, component_ids: frozenset[int]) -> None:
184184
self._component_category is ComponentCategory.INVERTER
185185
and self._component_type is InverterType.SOLAR
186186
):
187-
pv_pool = microgrid.pv_pool(
187+
pv_pool = microgrid.new_pv_pool(
188188
priority=-sys.maxsize - 1, component_ids=component_ids
189189
)
190190
bounds_receiver = pv_pool._system_power_bounds.new_receiver()

src/frequenz/sdk/microgrid/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
## PV Arrays
8686
8787
The total PV power production is available through
88-
[`pv_pool`][frequenz.sdk.microgrid.pv_pool]'s
88+
[`pv_pool`][frequenz.sdk.microgrid.new_pv_pool]'s
8989
[`power`][frequenz.sdk.timeseries.pv_pool.PVPool.power]. The PV pool by default uses
9090
all PV inverters available at a location, but PV pool instances can be created for
9191
subsets of PV inverters if necessary, by specifying the inverter ids.
@@ -143,9 +143,9 @@
143143
The SDK provides a unified interface for interacting with sets of Batteries, EV
144144
chargers and PV arrays, through their corresponding `Pool`s.
145145
146-
* [PV pool][frequenz.sdk.microgrid.pv_pool]
147146
* [Battery pool][frequenz.sdk.microgrid.new_battery_pool]
148147
* [EV charger pool][frequenz.sdk.microgrid.new_ev_charger_pool]
148+
* [PV pool][frequenz.sdk.microgrid.new_pv_pool]
149149
150150
All of them provide support for streaming aggregated data and for setting the
151151
power values of the components.
@@ -232,8 +232,8 @@
232232
logical_meter,
233233
new_battery_pool,
234234
new_ev_charger_pool,
235+
new_pv_pool,
235236
producer,
236-
pv_pool,
237237
voltage,
238238
)
239239

@@ -261,7 +261,7 @@ async def initialize(server_url: str, resampler_config: ResamplerConfig) -> None
261261
"logical_meter",
262262
"new_battery_pool",
263263
"new_ev_charger_pool",
264+
"new_pv_pool",
264265
"producer",
265-
"pv_pool",
266266
"voltage",
267267
]

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def new_ev_charger_pool(
270270
set_operating_point=set_operating_point,
271271
)
272272

273-
def pv_pool(
273+
def new_pv_pool(
274274
self,
275275
*,
276276
priority: int,
@@ -616,7 +616,7 @@ def new_battery_pool(
616616
)
617617

618618

619-
def pv_pool(
619+
def new_pv_pool(
620620
*,
621621
priority: int,
622622
component_ids: abc.Set[int] | None = None,
@@ -653,7 +653,7 @@ def pv_pool(
653653
Returns:
654654
A `PVPool` instance.
655655
"""
656-
return _get().pv_pool(
656+
return _get().new_pv_pool(
657657
priority=priority,
658658
component_ids=component_ids,
659659
name=name,

src/frequenz/sdk/timeseries/logical_meter/_logical_meter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class LogicalMeter:
4141
)
4242
4343
logical_meter = microgrid.logical_meter()
44-
pv_pool = microgrid.pv_pool(priority=5)
44+
pv_pool = microgrid.new_pv_pool(priority=5)
4545
grid = microgrid.grid()
4646
4747
# Get a receiver for a builtin formula

src/frequenz/sdk/timeseries/pv_pool/_pv_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def __init__( # pylint: disable=too-many-arguments
4444
4545
!!! note
4646
`PVPool` instances are not meant to be created directly by users. Use the
47-
[`microgrid.pv_pool`][frequenz.sdk.microgrid.pv_pool] method for creating
48-
`PVPool` instances.
47+
[`microgrid.new_pv_pool`][frequenz.sdk.microgrid.new_pv_pool] method for
48+
creating `PVPool` instances.
4949
5050
Args:
5151
pool_ref_store: The reference store for the PV pool.

tests/timeseries/_formula_engine/test_formula_composition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def test_formula_composition( # pylint: disable=too-many-locals
3838
battery_pool = microgrid.new_battery_pool(priority=5)
3939
stack.push_async_callback(battery_pool.stop)
4040

41-
pv_pool = microgrid.pv_pool(priority=5)
41+
pv_pool = microgrid.new_pv_pool(priority=5)
4242
stack.push_async_callback(pv_pool.stop)
4343

4444
grid = microgrid.grid()
@@ -116,7 +116,7 @@ async def test_formula_composition_missing_pv(self, mocker: MockerFixture) -> No
116116
battery_pool = microgrid.new_battery_pool(priority=5)
117117
stack.push_async_callback(battery_pool.stop)
118118

119-
pv_pool = microgrid.pv_pool(priority=5)
119+
pv_pool = microgrid.new_pv_pool(priority=5)
120120
stack.push_async_callback(pv_pool.stop)
121121

122122
logical_meter = microgrid.logical_meter()
@@ -158,7 +158,7 @@ async def test_formula_composition_missing_bat(self, mocker: MockerFixture) -> N
158158
battery_pool = microgrid.new_battery_pool(priority=5)
159159
stack.push_async_callback(battery_pool.stop)
160160

161-
pv_pool = microgrid.pv_pool(priority=5)
161+
pv_pool = microgrid.new_pv_pool(priority=5)
162162
stack.push_async_callback(pv_pool.stop)
163163

164164
logical_meter = microgrid.logical_meter()

tests/timeseries/_pv_pool/test_pv_pool_control_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def test_setting_power( # pylint: disable=too-many-statements
131131
)
132132

133133
await self._init_pv_inverters(mocks)
134-
pv_pool = microgrid.pv_pool(priority=5)
134+
pv_pool = microgrid.new_pv_pool(priority=5)
135135
bounds_rx = pv_pool.power_status.new_receiver()
136136
await self._recv_reports_until(
137137
bounds_rx,

tests/timeseries/test_formula_formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def test_higher_order_formula(self, mocker: MockerFixture) -> None:
123123
logical_meter = microgrid.logical_meter()
124124
stack.push_async_callback(logical_meter.stop)
125125

126-
pv_pool = microgrid.pv_pool(priority=5)
126+
pv_pool = microgrid.new_pv_pool(priority=5)
127127
stack.push_async_callback(pv_pool.stop)
128128

129129
grid = microgrid.grid()

tests/timeseries/test_logical_meter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def test_pv_power(self, mocker: MockerFixture) -> None:
4444
mockgrid.add_solar_inverters(2)
4545

4646
async with mockgrid, AsyncExitStack() as stack:
47-
pv_pool = microgrid.pv_pool(priority=5)
47+
pv_pool = microgrid.new_pv_pool(priority=5)
4848
stack.push_async_callback(pv_pool.stop)
4949
pv_power_receiver = pv_pool.power.new_receiver()
5050

@@ -57,7 +57,7 @@ async def test_pv_power_no_meter(self, mocker: MockerFixture) -> None:
5757
mockgrid.add_solar_inverters(2, no_meter=True)
5858

5959
async with mockgrid, AsyncExitStack() as stack:
60-
pv_pool = microgrid.pv_pool(priority=5)
60+
pv_pool = microgrid.new_pv_pool(priority=5)
6161
stack.push_async_callback(pv_pool.stop)
6262
pv_power_receiver = pv_pool.power.new_receiver()
6363

@@ -70,7 +70,7 @@ async def test_pv_power_no_pv_components(self, mocker: MockerFixture) -> None:
7070
MockMicrogrid(grid_meter=True, mocker=mocker) as mockgrid,
7171
AsyncExitStack() as stack,
7272
):
73-
pv_pool = microgrid.pv_pool(priority=5)
73+
pv_pool = microgrid.new_pv_pool(priority=5)
7474
stack.push_async_callback(pv_pool.stop)
7575
pv_power_receiver = pv_pool.power.new_receiver()
7676

0 commit comments

Comments
 (0)