Skip to content

Commit 8a3a38a

Browse files
committed
Rename reference-store variable names to be more accurate
Earlier they were called just `*pools`, which could be confusing. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent df875ee commit 8a3a38a

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ def __init__(
103103
self._consumer: Consumer | None = None
104104
self._producer: Producer | None = None
105105
self._grid: Grid | None = None
106-
self._ev_charger_pools: dict[frozenset[int], EVChargerPoolReferenceStore] = {}
107-
self._battery_pools: dict[frozenset[int], BatteryPoolReferenceStore] = {}
106+
self._ev_charger_pool_reference_stores: dict[
107+
frozenset[int], EVChargerPoolReferenceStore
108+
] = {}
109+
self._battery_pool_reference_stores: dict[
110+
frozenset[int], BatteryPoolReferenceStore
111+
] = {}
108112
self._frequency_instance: GridFrequency | None = None
109113
self._voltage_instance: VoltageStreamer | None = None
110114

@@ -195,8 +199,8 @@ def ev_charger_pool(
195199
if ev_charger_ids is not None:
196200
key = frozenset(ev_charger_ids)
197201

198-
if key not in self._ev_charger_pools:
199-
self._ev_charger_pools[key] = EVChargerPoolReferenceStore(
202+
if key not in self._ev_charger_pool_reference_stores:
203+
self._ev_charger_pool_reference_stores[key] = EVChargerPoolReferenceStore(
200204
channel_registry=self._channel_registry,
201205
resampler_subscription_sender=self._resampling_request_sender(),
202206
status_receiver=self._ev_power_wrapper.status_channel.new_receiver(
@@ -210,7 +214,9 @@ def ev_charger_pool(
210214
),
211215
component_ids=ev_charger_ids,
212216
)
213-
return EVChargerPool(self._ev_charger_pools[key], name, priority)
217+
return EVChargerPool(
218+
self._ev_charger_pool_reference_stores[key], name, priority
219+
)
214220

215221
def grid(self) -> Grid:
216222
"""Return the grid measuring point."""
@@ -257,12 +263,12 @@ def battery_pool(
257263
if battery_ids is not None:
258264
key = frozenset(battery_ids)
259265

260-
if key not in self._battery_pools:
261-
self._battery_pools[key] = BatteryPoolReferenceStore(
266+
if key not in self._battery_pool_reference_stores:
267+
self._battery_pool_reference_stores[key] = BatteryPoolReferenceStore(
262268
channel_registry=self._channel_registry,
263269
resampler_subscription_sender=self._resampling_request_sender(),
264-
batteries_status_receiver=self._battery_power_wrapper.status_channel.new_receiver(
265-
limit=1
270+
batteries_status_receiver=(
271+
self._battery_power_wrapper.status_channel.new_receiver(limit=1)
266272
),
267273
power_manager_requests_sender=(
268274
self._battery_power_wrapper.proposal_channel.new_sender()
@@ -274,7 +280,7 @@ def battery_pool(
274280
batteries_id=battery_ids,
275281
)
276282

277-
return BatteryPool(self._battery_pools[key], name, priority)
283+
return BatteryPool(self._battery_pool_reference_stores[key], name, priority)
278284

279285
def _data_sourcing_request_sender(self) -> Sender[ComponentMetricRequest]:
280286
"""Return a Sender for sending requests to the data sourcing actor.
@@ -331,7 +337,7 @@ async def _stop(self) -> None:
331337
if self._resampling_actor:
332338
await self._resampling_actor.actor.stop()
333339
await self._battery_power_wrapper.stop()
334-
for pool in self._battery_pools.values():
340+
for pool in self._battery_pool_reference_stores.values():
335341
await pool.stop()
336342

337343

0 commit comments

Comments
 (0)