Rangekeeper 0.8.23__py3-none-any.whl → 0.8.25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,10 +8,12 @@ from abc import abstractmethod
8
8
 
9
9
 
10
10
  class Type(enum.Enum):
11
- STRAIGHT_LINE = 'Straight Line' # A constant-change (linearly growing (or decaying)) projection form, originating from an initial value.
12
- COMPOUNDING = 'Compounding' # An exponentially growing (compounding) or decaying projection at a specified rate per period.
13
- RECURRING = 'Recurring' # A projection form that repeats a specified sequence of values.
14
- DYNAMIC = 'Dynamic' # A projection form generated by a stochastic process.
11
+ STRAIGHT_LINE = "StraightLine" # A constant-change (linearly growing (or decaying)) projection form, originating from an initial value.
12
+ COMPOUNDING = "Compounding" # An exponentially growing (compounding) or decaying projection at a specified rate per period.
13
+ RECURRING = (
14
+ "Recurring" # A projection form that repeats a specified sequence of values.
15
+ )
16
+ DYNAMIC = "Dynamic" # A projection form generated by a stochastic process.
15
17
 
16
18
 
17
19
  class Form:
@@ -21,9 +23,7 @@ class Form:
21
23
  """
22
24
 
23
25
  @abstractmethod
24
- def terms(
25
- self,
26
- sequence: pd.RangeIndex) -> [float]:
26
+ def terms(self, sequence: pd.RangeIndex) -> [float]:
27
27
  """
28
28
  Returns the set of terms that define the projection's form at each value in the sequence.
29
29
  """
@@ -37,15 +37,11 @@ class StraightLine(Form):
37
37
  To calculate the factor, the projection is modelled as a linear function of (slope * period) + 1
38
38
  """
39
39
 
40
- def __init__(
41
- self,
42
- slope: float):
40
+ def __init__(self, slope: float):
43
41
  self.type = Type.STRAIGHT_LINE
44
42
  self.slope = slope
45
43
 
46
- def terms(
47
- self,
48
- sequence: pd.RangeIndex) -> [float]:
44
+ def terms(self, sequence: pd.RangeIndex) -> [float]:
49
45
  """
50
46
  Returns the additive terms to the projection at each value in the sequence.
51
47
  """
@@ -65,15 +61,11 @@ class Compounding(Form):
65
61
  To calculate the factor, the projection is modelled as an exponential function of (1 + rate) ** period
66
62
  """
67
63
 
68
- def __init__(
69
- self,
70
- rate: float):
64
+ def __init__(self, rate: float):
71
65
  self.type = Type.COMPOUNDING
72
66
  self.rate = rate
73
67
 
74
- def terms(
75
- self,
76
- sequence: pd.RangeIndex) -> [float]:
68
+ def terms(self, sequence: pd.RangeIndex) -> [float]:
77
69
  """
78
70
  Returns the multiplicative factors of the projection's form at each value in the sequence.
79
71
  """
@@ -83,15 +75,11 @@ class Compounding(Form):
83
75
  class Dynamic(Form):
84
76
  series: pd.Series
85
77
 
86
- def __init__(
87
- self,
88
- series: pd.Series):
78
+ def __init__(self, series: pd.Series):
89
79
  self.type = Type.DYNAMIC
90
80
  self.series = series
91
81
 
92
- def terms(
93
- self,
94
- sequence: pd.RangeIndex) -> [float]:
82
+ def terms(self, sequence: pd.RangeIndex) -> [float]:
95
83
  """
96
84
  Returns the multiplicative factors of the projection's form at each value in the sequence.
97
85
  """
rangekeeper/measure.py CHANGED
@@ -102,7 +102,7 @@ def register_currency(
102
102
  return Measure(
103
103
  name=currency.name,
104
104
  definition="Currency of {0}".format(currency.countries),
105
- units=registry[currency.code].units,
105
+ units=registry.parse_units(currency.code),
106
106
  )
107
107
 
108
108
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rangekeeper
3
- Version: 0.8.23
3
+ Version: 0.8.25
4
4
  Summary: A Python library assisting financial modelling in real estate asset & development planning, decision-making, cashflow forecasting, and scenario analysis.
5
5
  Author-email: Daniel Fink <danfink@mit.edu>
6
6
  License-Expression: MPL-2.0
@@ -2,11 +2,11 @@ rangekeeper/__init__.py,sha256=3ed6dqjrwb0_Z1le9oItyOFHFrAtP0XJIVhZG07iqZ0,1731
2
2
  rangekeeper/api.py,sha256=3nuG7C2IQjpumcn79MvYDTa7ADWPAos7VfVM-3pL4n4,4798
3
3
  rangekeeper/distribution.py,sha256=2C3jhi1rLJUs0seBztdQb196hNhc00sKJEGMkFiDpYs,8961
4
4
  rangekeeper/duration.py,sha256=9GU6dcZTL_OAOgEHLGkCVxjG16_Po1IMEU29K5g4iRM,20433
5
- rangekeeper/extrapolation.py,sha256=KZrRyu9-R6mo2p6C3NhS73aKCVvAaoIfV514yKKhoEE,2974
5
+ rangekeeper/extrapolation.py,sha256=Zfsz2KwkImxEMMCNZaF8RpiQxlIgemS1dQkSnjliYU4,2814
6
6
  rangekeeper/flux.py,sha256=X1m4bkGQqRG5DswYWh46nwcbgIfKqj2sk6xLhaFYzYE,31227
7
7
  rangekeeper/format.py,sha256=DOfF4-LCXqWyCtE1OomwE80sJLe6LjL4gqEOAP454LQ,10796
8
8
  rangekeeper/graph.py,sha256=6oWRv-qzGsM5Z19UyJ1v3hwtWaQp_F4qQKxizvkQ_gg,28043
9
- rangekeeper/measure.py,sha256=gVhmq4JLZFzvwmPAlAwZ8M5GfTDNDzuwm0zD1t2e1r8,4119
9
+ rangekeeper/measure.py,sha256=eCdoTAocq1loNZBnOp3nPiPV7yIi0QTwpVHvjba1hkY,4125
10
10
  rangekeeper/policy.py,sha256=8p-sl7SpcE_FTwpwR6wR8COotNISzD4bcqZqPHoJCQI,567
11
11
  rangekeeper/projection.py,sha256=r5fHDeobCMvQkFqohCIR4SfH1fmkV4aQUlzxmF429mU,6231
12
12
  rangekeeper/segmentation.py,sha256=-qZkXQ7JbSKp_psORog3TIP8yag6ooe9hGD9uuylcSk,6862
@@ -20,7 +20,7 @@ rangekeeper/dynamics/trend.py,sha256=-WqrRvmmTj2mE24Pz-Dl5lXEpLXnDUMngafU__em_ac
20
20
  rangekeeper/dynamics/volatility.py,sha256=MGDLzrI1uP_C6HL-pigJwWikHg1KNbfB_0m0Akh-L2A,5162
21
21
  rangekeeper/formula/__init__.py,sha256=4OXzdJAYDBxQeOMzLR5MZvIjxxIfFOTE9aNu9zFryAE,36
22
22
  rangekeeper/formula/financial.py,sha256=oNFdhygbtdEUFjpxYFuuDnpC_P8nOO538b21FzaMtTU,14045
23
- rangekeeper-0.8.23.dist-info/METADATA,sha256=2C-bDgpGpYXHV3rMprUzHyLr_GtJoys4R6OUZFlZv8o,2212
24
- rangekeeper-0.8.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- rangekeeper-0.8.23.dist-info/top_level.txt,sha256=7ov6d70lppmzKc088MAmRWnCtCRGA2cd43G28QBSv-c,12
26
- rangekeeper-0.8.23.dist-info/RECORD,,
23
+ rangekeeper-0.8.25.dist-info/METADATA,sha256=_bLPq7sZOAVAi0aKKviTEp-lpee04lB30okteq9VsOs,2212
24
+ rangekeeper-0.8.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ rangekeeper-0.8.25.dist-info/top_level.txt,sha256=7ov6d70lppmzKc088MAmRWnCtCRGA2cd43G28QBSv-c,12
26
+ rangekeeper-0.8.25.dist-info/RECORD,,