Skip to content

Commit d3d6b31

Browse files
committed
Add formula power/current sign convention details to docstrings
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent ec3b974 commit d3d6b31

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def battery_ids(self) -> Set[int]:
106106
def power(self) -> FormulaEngine:
107107
"""Fetch the total power of the batteries in the pool.
108108
109+
This formula produces values that are in the Passive Sign Convention (PSC).
110+
109111
If a formula engine to calculate this metric is not already running, it will be
110112
started.
111113
@@ -131,6 +133,8 @@ def power(self) -> FormulaEngine:
131133
def production_power(self) -> FormulaEngine:
132134
"""Fetch the total production power of the batteries in the pool.
133135
136+
This formula produces positive values when producing power and 0 otherwise.
137+
134138
If a formula engine to calculate this metric is not already running, it will be
135139
started.
136140
@@ -156,6 +160,8 @@ def production_power(self) -> FormulaEngine:
156160
def consumption_power(self) -> FormulaEngine:
157161
"""Fetch the total consumption power of the batteries in the pool.
158162
163+
This formula produces positive values when consuming power and 0 otherwise.
164+
159165
If a formula engine to calculate this metric is not already running, it will be
160166
started.
161167

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def component_ids(self) -> abc.Set[int]:
109109
def current(self) -> FormulaEngine3Phase:
110110
"""Fetch the total current for the EV Chargers in the pool.
111111
112+
This formula produces values that are in the Passive Sign Convention (PSC).
113+
112114
If a formula engine to calculate EV Charger current is not already running, it
113115
will be started.
114116
@@ -131,6 +133,8 @@ def current(self) -> FormulaEngine3Phase:
131133
def power(self) -> FormulaEngine:
132134
"""Fetch the total power for the EV Chargers in the pool.
133135
136+
This formula produces values that are in the Passive Sign Convention (PSC).
137+
134138
If a formula engine to calculate EV Charger power is not already running, it
135139
will be started.
136140
@@ -156,6 +160,8 @@ def power(self) -> FormulaEngine:
156160
def production_power(self) -> FormulaEngine:
157161
"""Fetch the total power produced by the EV Chargers in the pool.
158162
163+
This formula produces positive values when producing power and 0 otherwise.
164+
159165
If a formula engine to calculate EV Charger power is not already running, it
160166
will be started.
161167
@@ -181,6 +187,8 @@ def production_power(self) -> FormulaEngine:
181187
def consumption_power(self) -> FormulaEngine:
182188
"""Fetch the total power consumed by the EV Chargers in the pool.
183189
190+
This formula produces positive values when consuming power and 0 otherwise.
191+
184192
If a formula engine to calculate EV Charger power is not already running, it
185193
will be started.
186194

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def start_formula(
139139
def grid_power(self) -> FormulaEngine:
140140
"""Fetch the grid power for the microgrid.
141141
142+
This formula produces values that are in the Passive Sign Convention (PSC).
143+
142144
If a formula engine to calculate grid power is not already running, it will be
143145
started.
144146
@@ -159,6 +161,8 @@ def grid_power(self) -> FormulaEngine:
159161
def grid_consumption_power(self) -> FormulaEngine:
160162
"""Fetch the grid consumption power for the microgrid.
161163
164+
This formula produces positive values when consuming power and 0 otherwise.
165+
162166
If a formula engine to calculate grid consumption power is not already running,
163167
it will be started.
164168
@@ -180,6 +184,8 @@ def grid_consumption_power(self) -> FormulaEngine:
180184
def grid_production_power(self) -> FormulaEngine:
181185
"""Fetch the grid production power for the microgrid.
182186
187+
This formula produces positive values when producing power and 0 otherwise.
188+
183189
If a formula engine to calculate grid production power is not already running,
184190
it will be started.
185191
@@ -201,6 +207,8 @@ def grid_production_power(self) -> FormulaEngine:
201207
def grid_current(self) -> FormulaEngine3Phase:
202208
"""Fetch the grid power for the microgrid.
203209
210+
This formula produces values that are in the Passive Sign Convention (PSC).
211+
204212
If a formula engine to calculate grid current is not already running, it will be
205213
started.
206214
@@ -224,6 +232,8 @@ def consumer_power(self) -> FormulaEngine:
224232
Under normal circumstances this is expected to correspond to the gross
225233
consumption of the site excluding active parts and battery.
226234
235+
This formula produces values that are in the Passive Sign Convention (PSC).
236+
227237
If a formula engine to calculate consumer power is not already running, it will
228238
be started.
229239
@@ -244,6 +254,8 @@ def consumer_power(self) -> FormulaEngine:
244254
def pv_power(self) -> FormulaEngine:
245255
"""Fetch the PV power in the microgrid.
246256
257+
This formula produces values that are in the Passive Sign Convention (PSC).
258+
247259
If a formula engine to calculate PV power is not already running, it will be
248260
started.
249261
@@ -265,6 +277,8 @@ def pv_power(self) -> FormulaEngine:
265277
def pv_production_power(self) -> FormulaEngine:
266278
"""Fetch the PV power production in the microgrid.
267279
280+
This formula produces positive values when producing power and 0 otherwise.
281+
268282
If a formula engine to calculate PV power production is not already running, it
269283
will be started.
270284
@@ -286,6 +300,8 @@ def pv_production_power(self) -> FormulaEngine:
286300
def pv_consumption_power(self) -> FormulaEngine:
287301
"""Fetch the PV power consumption in the microgrid.
288302
303+
This formula produces positive values when consuming power and 0 otherwise.
304+
289305
If a formula engine to calculate PV power consumption is not already running, it
290306
will be started.
291307
@@ -307,6 +323,8 @@ def pv_consumption_power(self) -> FormulaEngine:
307323
def chp_power(self) -> FormulaEngine:
308324
"""Fetch the CHP power production in the microgrid.
309325
326+
This formula produces values that are in the Passive Sign Convention (PSC).
327+
310328
If a formula engine to calculate CHP power production is not already running, it
311329
will be started.
312330
@@ -328,6 +346,8 @@ def chp_power(self) -> FormulaEngine:
328346
def chp_production_power(self) -> FormulaEngine:
329347
"""Fetch the CHP power production in the microgrid.
330348
349+
This formula produces positive values when producing power and 0 otherwise.
350+
331351
If a formula engine to calculate CHP power production is not already running, it
332352
will be started.
333353
@@ -351,6 +371,8 @@ def chp_production_power(self) -> FormulaEngine:
351371
def chp_consumption_power(self) -> FormulaEngine:
352372
"""Fetch the CHP power consumption in the microgrid.
353373
374+
This formula produces positive values when consuming power and 0 otherwise.
375+
354376
If a formula engine to calculate CHP power consumption is not already running,
355377
it will be started.
356378

0 commit comments

Comments
 (0)