Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect use of GrowFactors() in Policy and Parameters classes #2852

Merged
merged 12 commits into from
Dec 16, 2024
Prev Previous commit
Next Next commit
Fix reform_documentation logic
  • Loading branch information
martinholmer committed Dec 15, 2024
commit 051727dd6a9b00ab1de2908e080b8662d9834b59
10 changes: 7 additions & 3 deletions taxcalc/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ def read_json_param_objects(reform, assump):
return param_dict

@staticmethod
def reform_documentation(params, policy_dicts=None):
def reform_documentation(params, growfactors, policy_dicts=None):
"""
Generate reform documentation versus current-law policy.

Expand All @@ -1120,6 +1120,9 @@ def reform_documentation(params, policy_dicts=None):
dictionary is structured like dict returned from
the static Calculator.read_json_param_objects() method

growfactors: GrowFactors
GrowFactors object used to construct Calculator Policy object

policy_dicts : list of dict or None
each dictionary in list is a params['policy'] dictionary
representing second and subsequent elements of a compound
Expand Down Expand Up @@ -1255,13 +1258,14 @@ def lines(text, num_indent_spaces, max_line_length=77):
# create Policy object with current-law-policy values
gdiff_base = GrowDiff()
gdiff_base.update_growdiff(params['growdiff_baseline'])
gfactors_clp = GrowFactors()
assert isinstance(growfactors, GrowFactors)
gfactors_clp = copy.deepcopy(growfactors)
gdiff_base.apply_to(gfactors_clp)
clp = Policy(gfactors=gfactors_clp)
# create Policy object with post-reform values
gdiff_resp = GrowDiff()
gdiff_resp.update_growdiff(params['growdiff_response'])
gfactors_ref = GrowFactors()
gfactors_ref = copy.deepcopy(growfactors)
gdiff_base.apply_to(gfactors_ref)
gdiff_resp.apply_to(gfactors_ref)
ref = Policy(gfactors=gfactors_ref)
Expand Down