From b37f2b8a6d33b5076435dd60b071b1d3d2e8848a Mon Sep 17 00:00:00 2001 From: Natalie Fearnley Date: Mon, 20 May 2024 00:35:53 -0400 Subject: [PATCH] fixed broken addPerSec and mulPerSec --- sizebot/lib/diff.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sizebot/lib/diff.py b/sizebot/lib/diff.py index a2c53b6f..3e5083ed 100644 --- a/sizebot/lib/diff.py +++ b/sizebot/lib/diff.py @@ -173,15 +173,15 @@ def __init__(self, diff: Diff, time: TV): self.time = time @property - def addPerSec(self) -> SV | None: + def addPerSec(self) -> SV: if self.diff.changetype != "add": - return None + return 0 return SV(self.diff.amount / self.time) @property - def mulPerSec(self) -> Decimal | None: + def mulPerSec(self) -> Decimal: if self.diff.changetype != "mul": - return None + return 1 return Decimal(self.diff.amount ** (1 / self.time)) @property @@ -260,11 +260,11 @@ def __init__(self, rate: Rate, stop: SV | TV): self.stop = stop @property - def addPerSec(self) -> SV | None: + def addPerSec(self) -> SV: return self.rate.addPerSec @property - def mulPerSec(self) -> Decimal | None: + def mulPerSec(self) -> Decimal: return self.rate.mulPerSec @property