Skip to content

Commit

Permalink
Remove base attribute from ParameterScaleBracket
Browse files Browse the repository at this point in the history
  • Loading branch information
benjello committed Nov 23, 2022
1 parent cf52b71 commit 2b1650e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions openfisca_core/parameters/parameter_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,17 @@ def _get_at_instant(self, instant):
scale = LinearAverageRateTaxScale()

for bracket in brackets:
if 'base' in bracket._children:
base = bracket.base
else:
base = 1.
if 'average_rate' in bracket._children and 'threshold' in bracket._children:
average_rate = bracket.average_rate
threshold = bracket.threshold
scale.add_bracket(threshold, average_rate * base)
scale.add_bracket(threshold, average_rate)
return scale
else:
scale = MarginalRateTaxScale()

for bracket in brackets:
if 'base' in bracket._children:
base = bracket.base
else:
base = 1.
if 'rate' in bracket._children and 'threshold' in bracket._children:
rate = bracket.rate
threshold = bracket.threshold
scale.add_bracket(threshold, rate * base)
scale.add_bracket(threshold, rate)
return scale
2 changes: 1 addition & 1 deletion openfisca_core/parameters/parameter_scale_bracket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class ParameterScaleBracket(ParameterNode):
A parameter scale bracket.
"""

_allowed_keys = set(['amount', 'threshold', 'rate', 'average_rate', 'base'])
_allowed_keys = set(['amount', 'threshold', 'rate', 'average_rate'])

0 comments on commit 2b1650e

Please sign in to comment.