Skip to content

Commit

Permalink
update mapping method
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodi Yang committed Jan 30, 2024
1 parent a55e801 commit 1b8d1ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions taxcalc/validation/taxsim35/prepare_taxcalc_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def translate(ivar):
assert np.all(np.logical_or(mars == 1, np.logical_or(mars == 2, mars == 4)))
invar["MARS"] = mars
num_eitc_qualified_kids = ivar["dep18"]
invar["f2441"] = invar["nu13"]
invar["EIC"] = np.minimum(num_eitc_qualified_kids, 3)
num_taxpayers = np.where(mars == 2, 2, 1)
invar["XTOT"] = num_taxpayers + num_deps
Expand Down
5 changes: 4 additions & 1 deletion taxcalc/validation/taxsim35/process_taxcalc_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def write_taxsim_formatted_output(filename, tcvar):
tcvar["non_refundable_child_odep_credit"] = (
tcvar["c07220"] + tcvar["odc"] + tcvar["ctc_new"]
) # non-refundable child+odep credit
tcvar["refundable_CDCC"] = tcvar["CDCC_refund"] # refundable CDCC
tcvar["amt_liability"] = tcvar["c09600"] # federal AMT liability
# var28 from TAXSIM-35 is federal income tax before credits; the Tax-Calculator
# tcvar['c05800'] is this concept but includes AMT liability
Expand Down Expand Up @@ -111,14 +112,16 @@ def write_taxsim_formatted_output(filename, tcvar):
"non_refundable_child_odep_credit",
"c11070",
"c07180",
"refundable_CDCC",
"eitc",
"c62100",
"amt_liability",
"iitax_before_credits_ex_AMT",
"recovery_rebate_credit"
]
]
# better mapping of to how TAXSIM-35 handles refundalbe credits in 2021
# better mapping of to how TAXSIM-35 handles refundable credits in 2021
tcvar.loc[tcvar["FLPDYR"] == 2021, "c11070"] = tcvar.loc[tcvar["FLPDYR"] == 2021, "non_refundable_child_odep_credit"]
tcvar.loc[tcvar["FLPDYR"] == 2021, "c07180"] = tcvar.loc[tcvar["FLPDYR"] == 2021, "refundable_CDCC"]
tcvar.round(decimals=2)
tcvar.to_csv(filename)

0 comments on commit 1b8d1ed

Please sign in to comment.