Skip to content

Commit 23deabe

Browse files
committed
Improve overloads for quantity scaling by Percentage
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 777cd1c commit 23deabe

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/frequenz/sdk/timeseries/_quantities.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ def __sub__(self, other: Self) -> Self:
262262
return difference
263263

264264
def __mul__(self, percent: Percentage) -> Self:
265-
"""Return the product of this quantity and a percentage.
265+
"""Scale this quantity by a percentage.
266266
267267
Args:
268-
percent: The percentage.
268+
percent: The percentage by which to scale this quantity.
269269
270270
Returns:
271-
The product of this quantity and a percentage.
271+
The scaled quantity.
272272
"""
273273
if not isinstance(percent, Percentage):
274274
return NotImplemented
@@ -522,10 +522,10 @@ def as_megawatts(self) -> float:
522522

523523
@overload # type: ignore
524524
def __mul__(self, other: Percentage) -> Self:
525-
"""Return a power from multiplying this power by the given percentage.
525+
"""Scale this power by a percentage.
526526
527527
Args:
528-
other: The percentage to multiply by.
528+
other: The percentage by which to scale this power.
529529
530530
Returns:
531531
The scaled power.
@@ -668,10 +668,10 @@ def as_milliamperes(self) -> float:
668668

669669
@overload # type: ignore
670670
def __mul__(self, other: Percentage) -> Self:
671-
"""Return a power from multiplying this power by the given percentage.
671+
"""Scale this current by a percentage.
672672
673673
Args:
674-
other: The percentage to multiply by.
674+
other: The percentage by which to scale this current.
675675
676676
Returns:
677677
The scaled current.
@@ -789,10 +789,10 @@ def as_kilovolts(self) -> float:
789789

790790
@overload # type: ignore
791791
def __mul__(self, other: Percentage) -> Self:
792-
"""Return a power from multiplying this power by the given percentage.
792+
"""Scale this voltage by a percentage.
793793
794794
Args:
795-
other: The percentage to multiply by.
795+
other: The percentage by which to scale this voltage.
796796
797797
Returns:
798798
The scaled voltage.

0 commit comments

Comments
 (0)