Skip to content

Commit 54d076f

Browse files
committed
Fix typing for composing constants with formula builders
Earlier the constant typing was incorrectly made for 3-phase formulas, this is being fixed in this commit. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 46cb78e commit 54d076f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/frequenz/sdk/timeseries/formula_engine/_formula_engine.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -842,12 +842,12 @@ def _push(
842842

843843
@overload
844844
def __add__(
845-
self, other: _CompositionType1Phase
845+
self, other: _CompositionType1Phase | QuantityT
846846
) -> HigherOrderFormulaBuilder[QuantityT]: ...
847847

848848
@overload
849849
def __add__(
850-
self, other: _CompositionType3Phase | QuantityT
850+
self, other: _CompositionType3Phase
851851
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
852852

853853
def __add__(
@@ -870,12 +870,12 @@ def __add__(
870870

871871
@overload
872872
def __sub__(
873-
self, other: _CompositionType1Phase
873+
self, other: _CompositionType1Phase | QuantityT
874874
) -> HigherOrderFormulaBuilder[QuantityT]: ...
875875

876876
@overload
877877
def __sub__(
878-
self, other: _CompositionType3Phase | QuantityT
878+
self, other: _CompositionType3Phase
879879
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
880880

881881
def __sub__(
@@ -899,12 +899,12 @@ def __sub__(
899899

900900
@overload
901901
def __mul__(
902-
self, other: _CompositionType1Phase
902+
self, other: _CompositionType1Phase | float
903903
) -> HigherOrderFormulaBuilder[QuantityT]: ...
904904

905905
@overload
906906
def __mul__(
907-
self, other: _CompositionType3Phase | float
907+
self, other: _CompositionType3Phase
908908
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
909909

910910
def __mul__(
@@ -928,12 +928,12 @@ def __mul__(
928928

929929
@overload
930930
def __truediv__(
931-
self, other: _CompositionType1Phase
931+
self, other: _CompositionType1Phase | float
932932
) -> HigherOrderFormulaBuilder[QuantityT]: ...
933933

934934
@overload
935935
def __truediv__(
936-
self, other: _CompositionType3Phase | float
936+
self, other: _CompositionType3Phase
937937
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
938938

939939
def __truediv__(
@@ -957,12 +957,12 @@ def __truediv__(
957957

958958
@overload
959959
def max(
960-
self, other: _CompositionType1Phase
960+
self, other: _CompositionType1Phase | QuantityT
961961
) -> HigherOrderFormulaBuilder[QuantityT]: ...
962962

963963
@overload
964964
def max(
965-
self, other: _CompositionType3Phase | QuantityT
965+
self, other: _CompositionType3Phase
966966
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
967967

968968
def max(
@@ -985,12 +985,12 @@ def max(
985985

986986
@overload
987987
def min(
988-
self, other: _CompositionType1Phase
988+
self, other: _CompositionType1Phase | QuantityT
989989
) -> HigherOrderFormulaBuilder[QuantityT]: ...
990990

991991
@overload
992992
def min(
993-
self, other: _CompositionType3Phase | QuantityT
993+
self, other: _CompositionType3Phase
994994
) -> HigherOrderFormulaBuilder3Phase[QuantityT]: ...
995995

996996
def min(

0 commit comments

Comments
 (0)