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
Use new reform_documentation arguments in TaxCalcIO logic
  • Loading branch information
martinholmer committed Dec 15, 2024
commit 67f63236322cdf266dc6f722039668cb09a06051
11 changes: 8 additions & 3 deletions taxcalc/taxcalcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self, input_data, tax_year, baseline, reform, assump,
outdir=None):
# pylint: disable=too-many-arguments,too-many-locals
# pylint: disable=too-many-branches,too-many-statements
self.gf_reform = None
self.errmsg = ''
# check name and existence of INPUT file
inp = 'x'
Expand Down Expand Up @@ -288,6 +289,7 @@ def init(self, input_data, tax_year, baseline, reform, assump,
gfactors_ref = GrowFactors()
gdiff_baseline.apply_to(gfactors_ref)
gdiff_response.apply_to(gfactors_ref)
self.gf_reform = copy.deepcopy(gfactors_ref)
# create Policy objects:
# ... the baseline Policy object
base = Policy(gfactors=gfactors_base)
Expand Down Expand Up @@ -571,10 +573,13 @@ def write_doc_file(self):
Write reform documentation to text file.
"""
if len(self.policy_dicts) <= 1:
doc = Calculator.reform_documentation(self.param_dict)
doc = Calculator.reform_documentation(
self.param_dict, self.gf_reform
)
else:
doc = Calculator.reform_documentation(self.param_dict,
self.policy_dicts[1:])
doc = Calculator.reform_documentation(
self.param_dict, self.gf_reform, self.policy_dicts[1:]
)
doc_fname = self._output_filename.replace('.csv', '-doc.text')
with open(doc_fname, 'w', encoding='utf-8') as dfile:
dfile.write(doc)
Expand Down