File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/frequenz/sdk/timeseries/formula_engine Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,24 @@ def min(
198198 """
199199 return self ._higher_order_builder (self , self ._create_method ).min (other ) # type: ignore
200200
201+ def consumption (self ) -> _GenericHigherOrderBuilder :
202+ """
203+ Return a formula builder that applies the consumption operator on `self`.
204+
205+ The consumption operator returns either the identity if the power value is
206+ positive or 0.
207+ """
208+ return self ._higher_order_builder (self , self ._create_method ).consumption () # type: ignore
209+
210+ def production (self ) -> _GenericHigherOrderBuilder :
211+ """
212+ Return a formula builder that applies the production operator on `self`.
213+
214+ The production operator returns either the absolute value if the power value is
215+ negative or 0.
216+ """
217+ return self ._higher_order_builder (self , self ._create_method ).production () # type: ignore
218+
201219
202220class FormulaEngine (
203221 Generic [QuantityT ],
You can’t perform that action at this time.
0 commit comments