Skip to content

Commit 77b3541

Browse files
committed
Improve formula syntax docs for from_string method
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a076b68 commit 77b3541

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,17 @@ def start_formula(
9494
) -> Formula[Quantity]:
9595
"""Start execution of the given formula.
9696
97-
TODO: link to formula syntax.
97+
Formulas can have Component IDs that are preceeded by a pound symbol("#"),
98+
constant values and these operators: +, -, *, /, (, ).
9899
99-
Formulas can have Component IDs that are preceeded by a pound symbol("#"), and
100-
these operators: +, -, *, /, (, ).
100+
These functions are also supported: `COALESCE`, `MAX`, `MIN`.
101101
102102
For example, the input string: "#20 + #5" is a formula for adding metrics from
103103
two components with ids 20 and 5.
104104
105+
A more detailed description of the formula syntax with examples can be found
106+
[here](https://github.com/frequenz-floss/frequenz-microgrid-formula-engine-rs?tab=readme-ov-file#formula-syntax-overview).
107+
105108
Args:
106109
formula: formula to execute.
107110
metric: The metric to use when fetching receivers from the resampling actor.

0 commit comments

Comments
 (0)