projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update docs.
[python_utils.git]
/
type
/
rate.py
diff --git
a/type/rate.py
b/type/rate.py
index 64a472650242f863e24a02cd03cb44344db10a76..58489061570ab3a1a6f96728c04361ad760e21d1 100644
(file)
--- a/
type/rate.py
+++ b/
type/rate.py
@@
-1,9
+1,15
@@
#!/usr/bin/env python3
#!/usr/bin/env python3
+# © Copyright 2021-2022, Scott Gasch
+
+"""A class to represent a rate of change."""
+
from typing import Optional
class Rate(object):
from typing import Optional
class Rate(object):
+ """A class to represent a rate of change."""
+
def __init__(
self,
multiplier: Optional[float] = None,
def __init__(
self,
multiplier: Optional[float] = None,
@@
-28,9
+34,7
@@
class Rate(object):
self.multiplier = 1.0 + percent_change / 100
count += 1
if count != 1:
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)
def apply_to(self, other):
return self.__mul__(other)