Skip to content

Commit 0918a8a

Browse files
Amend data pipeline methods documentation
Amend data pipeline methods documentation to be more concise on what it is helpful for the user. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 1f32ffd commit 0918a8a

File tree

1 file changed

+10
-60
lines changed

1 file changed

+10
-60
lines changed

src/frequenz/sdk/microgrid/_data_pipeline.py

Lines changed: 10 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ def __init__(
129129
self._voltage_instance: VoltageStreamer | None = None
130130

131131
def frequency(self) -> GridFrequency:
132-
"""Fetch the grid frequency for the microgrid.
133-
134-
Returns:
135-
The GridFrequency instance.
136-
"""
132+
"""Return the grid frequency measuring point."""
137133
if self._frequency_instance is None:
138134
self._frequency_instance = GridFrequency(
139135
self._data_sourcing_request_sender(),
@@ -143,11 +139,7 @@ def frequency(self) -> GridFrequency:
143139
return self._frequency_instance
144140

145141
def voltage(self) -> VoltageStreamer:
146-
"""Fetch the 3-phase voltage for the microgrid.
147-
148-
Returns:
149-
The VoltageStreamer instance.
150-
"""
142+
"""Return the 3-phase voltage measuring point."""
151143
if not self._voltage_instance:
152144
self._voltage_instance = VoltageStreamer(
153145
self._resampling_request_sender(),
@@ -157,13 +149,7 @@ def voltage(self) -> VoltageStreamer:
157149
return self._voltage_instance
158150

159151
def logical_meter(self) -> LogicalMeter:
160-
"""Return the logical meter instance.
161-
162-
If a LogicalMeter instance doesn't exist, a new one is created and returned.
163-
164-
Returns:
165-
A logical meter instance.
166-
"""
152+
"""Return the logical meter of the microgrid."""
167153
from ..timeseries.logical_meter import LogicalMeter
168154

169155
if self._logical_meter is None:
@@ -174,13 +160,7 @@ def logical_meter(self) -> LogicalMeter:
174160
return self._logical_meter
175161

176162
def consumer(self) -> Consumer:
177-
"""Return the consumer instance.
178-
179-
If a Consumer instance doesn't exist, a new one is created and returned.
180-
181-
Returns:
182-
A Consumer instance.
183-
"""
163+
"""Return the consumption measuring point of the microgrid."""
184164
from ..timeseries.consumer import Consumer
185165

186166
if self._consumer is None:
@@ -191,13 +171,7 @@ def consumer(self) -> Consumer:
191171
return self._consumer
192172

193173
def producer(self) -> Producer:
194-
"""Return the producer instance.
195-
196-
If a Producer instance doesn't exist, a new one is created and returned.
197-
198-
Returns:
199-
A Producer instance.
200-
"""
174+
"""Return the production measuring point of the microgrid."""
201175
from ..timeseries.producer import Producer
202176

203177
if self._producer is None:
@@ -239,13 +213,7 @@ def ev_charger_pool(
239213
return self._ev_charger_pools[key]
240214

241215
def grid(self) -> Grid:
242-
"""Return the grid instance.
243-
244-
If a Grid instance doesn't exist, a new one is created and returned.
245-
246-
Returns:
247-
A Grid instance.
248-
"""
216+
"""Return the grid measuring point."""
249217
if self._grid is None:
250218
initialize_grid(
251219
channel_registry=self._channel_registry,
@@ -457,31 +425,17 @@ async def initialize(resampler_config: ResamplerConfig) -> None:
457425

458426

459427
def frequency() -> GridFrequency:
460-
"""Return the grid frequency.
461-
462-
Returns:
463-
The grid frequency.
464-
"""
428+
"""Return the grid frequency measuring point."""
465429
return _get().frequency()
466430

467431

468432
def voltage() -> VoltageStreamer:
469-
"""Return the 3-phase voltage for the microgrid.
470-
471-
Returns:
472-
The 3-phase voltage.
473-
"""
433+
"""Return the 3-phase voltage measuring point."""
474434
return _get().voltage()
475435

476436

477437
def logical_meter() -> LogicalMeter:
478-
"""Return the logical meter instance.
479-
480-
If a LogicalMeter instance doesn't exist, a new one is created and returned.
481-
482-
Returns:
483-
A logical meter instance.
484-
"""
438+
"""Return the logical meter of the microgrid."""
485439
return _get().logical_meter()
486440

487441

@@ -540,11 +494,7 @@ def battery_pool(
540494

541495

542496
def grid() -> Grid:
543-
"""Return the grid instance.
544-
545-
Returns:
546-
The Grid instance.
547-
"""
497+
"""Return the grid measuring point."""
548498
return _get().grid()
549499

550500

0 commit comments

Comments
 (0)