summaryrefslogtreecommitdiff
path: root/type/rate.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-02-10 14:52:14 -0800
committerScott Gasch <[email protected]>2022-02-10 14:52:14 -0800
commit2e8dd08f5f4f9624facf4d38ea6b276cc8131f56 (patch)
tree5d9982185ddb95c76669c594d20c2802e49ce89e /type/rate.py
parente76081ebdfa078aa8508ba1682dacea80341157e (diff)
More cleanup.
Diffstat (limited to 'type/rate.py')
-rw-r--r--type/rate.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/type/rate.py b/type/rate.py
index 64a4726..c365848 100644
--- a/type/rate.py
+++ b/type/rate.py
@@ -1,9 +1,13 @@
#!/usr/bin/env python3
+"""A class to represent a rate of change."""
+
from typing import Optional
class Rate(object):
+ """A class to represent a rate of change."""
+
def __init__(
self,
multiplier: Optional[float] = None,
@@ -28,9 +32,7 @@ class Rate(object):
self.multiplier = 1.0 + percent_change / 100
count += 1
if count != 1:
- raise Exception(
- 'Exactly one of percentage, percent_change or multiplier is required.'
- )
+ raise Exception('Exactly one of percentage, percent_change or multiplier is required.')
def apply_to(self, other):
return self.__mul__(other)