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

Streamline dependent-credit logic and update documentation #1937

Merged
merged 2 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions taxcalc/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
DependentCare, ALD_InvInc_ec_base, CapGains,
SSBenefits, UBI, AGI, ItemDedCap, ItemDed,
StdDed, AdditionalMedicareTax, F2441, EITC,
SchR, ChildTaxCredit, AdditionalCTC, CTC_new,
PersonalTaxCredit,
ChildDepTaxCredit, AdditionalCTC, CTC_new,
PersonalTaxCredit, SchR,
AmOppCreditParts, EducationTaxCredit,
NonrefundableCredits, C1040, IITAX,
BenefitSurtax, BenefitLimitation,
Expand Down Expand Up @@ -1420,7 +1420,7 @@ def _calc_one_year(self, zero_out_calc_vars=False):
self._taxinc_to_amt()
F2441(self.__policy, self.__records)
EITC(self.__policy, self.__records)
ChildTaxCredit(self.__policy, self.__records)
ChildDepTaxCredit(self.__policy, self.__records)
PersonalTaxCredit(self.__policy, self.__records)
AmOppCreditParts(self.__policy, self.__records)
SchR(self.__policy, self.__records)
Expand Down
44 changes: 10 additions & 34 deletions taxcalc/current_law_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5118,37 +5118,13 @@
"compatible_data": {"puf": true, "cps": true}
},

"_DependentCredit_c": {
"long_name": "Nonrefundable credit for dependents",
"description": "This nonrefundable credit is applied to (child and non-child) dependents and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.",
"section_1": "Nonrefundable Credits",
"section_2": "Child Tax Credit",
"irs_ref": "",
"notes": "The Ryan-Brady tax proposal sets this at $500",
"row_var": "FLPDYR",
"row_label": ["2013"],
"start_year": 2013,
"cpi_inflatable": true,
"cpi_inflated": false,
"col_var": "",
"col_label": "",
"boolean_value": false,
"integer_value": false,
"value": [0.0],
"range": {"min": 0, "max": 9e99},
"out_of_range_minmsg": "",
"out_of_range_maxmsg": "",
"out_of_range_action": "stop",
"compatible_data": {"puf": true, "cps": true}
},

"_DependentCredit_Child_c": {
"long_name": "Nonrefundable credit for children, on top of the child tax credit",
"description": "This nonrefundable credit is applied to children and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.",
"long_name": "Nonrefundable credit for child dependents on top of the child tax credit",
"description": "This nonrefundable credit is applied to child dependents and begins phasing out after the CTC phaseout ends.",
"section_1": "Nonrefundable Credits",
"section_2": "Child Tax Credit",
"irs_ref": "",
"notes": "First introduced in TCJA bills",
"notes": "Become current-law policy with passage of TCJA",
"row_var": "FLPDYR",
"row_label": ["2013",
"2014",
Expand Down Expand Up @@ -5193,12 +5169,12 @@
},

"_DependentCredit_Nonchild_c": {
"long_name": "Nonrefundable credit for non-child dependents",
"description": "This nonrefundable credit is applied to non-child dependents and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.",
"long_name": "Nonrefundable credit for non-child dependents on top of the child tax credit",
"description": "This nonrefundable credit is applied to non-child dependents and begins phasing out after the CTC phaseout ends.",
"section_1": "Nonrefundable Credits",
"section_2": "Child Tax Credit",
"irs_ref": "",
"notes": "First introduced in TCJA bills",
"notes": "Become current-law policy with passage of TCJA",
"row_var": "FLPDYR",
"row_label": ["2013",
"2014",
Expand Down Expand Up @@ -5244,11 +5220,11 @@

"_DependentCredit_before_CTC": {
"long_name": "Stack the Dependent Credit before the Child Tax Credit",
"description": "Stack the draw down of the Dependent Credit against liabilities before the drawdown of the Child Tax Credit.",
"description": "Place the drawdown of the nonrefundable Dependent Credit against tax liability before the drawdown of the Child Tax Credit.",
"section_1": "Nonrefundable Credits",
"section_2": "Child Tax Credit",
"irs_ref": "",
"notes": "",
"notes": "Become part of current-law policy with passage of TCJA",
"row_var": "FLPDYR",
"row_label": ["2013",
"2014",
Expand Down Expand Up @@ -5277,8 +5253,8 @@
},

"_FilerCredit_c": {
"long_name": "Nonrefundable credit for filer and spouse",
"description": "This nonrefundable credit is applied to the filer and spouse and phases out with the Child Tax Credit. The filer credit's phaseout begins when the CTC's phaseout ends.",
"long_name": "Nonrefundable credit for each filing unit",
"description": "This nonrefundable credit is applied to the filing unit and begins phasing out after the CTC phaseout ends.",
"section_1": "Nonrefundable Credits",
"section_2": "Child Tax Credit",
"irs_ref": "",
Expand Down
45 changes: 23 additions & 22 deletions taxcalc/functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

"""
Tax-Calculator functions that calculate payroll and individual income taxes.

Expand Down Expand Up @@ -1210,34 +1211,34 @@ def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000,


@iterate_jit(nopython=True)
def ChildTaxCredit(n24, MARS, c00100, exact,
CTC_c, CTC_ps, CTC_prt, prectc, nu05,
CTC_c_under5_bonus, XTOT, num,
DependentCredit_Child_c, DependentCredit_Nonchild_c,
DependentCredit_c, FilerCredit_c, dep_credit):
"""
Computes prectc amount and dependent credit.
"""
# calculate prectc amount
prectc = CTC_c * n24 + CTC_c_under5_bonus * nu05
modAGI = c00100 # no deducted foreign earned income to add
if modAGI > CTC_ps[MARS - 1]:
def ChildDepTaxCredit(n24, MARS, c00100, exact,
CTC_c, CTC_ps, CTC_prt, prectc, nu05,
CTC_c_under5_bonus, XTOT, num,
DependentCredit_Child_c, DependentCredit_Nonchild_c,
FilerCredit_c, dep_credit):
"""
Computes pre-CTC amount (prectc) and nonrefundable dependent credit.
"""
modAGI = c00100 # no foreign earned income deduction to add to AGI
# calculate and phase-out pre-CTC amount
base_ctc = CTC_c * n24 + CTC_c_under5_bonus * nu05
prectc = base_ctc
if prectc > 0. and modAGI > CTC_ps[MARS - 1]:
excess = modAGI - CTC_ps[MARS - 1]
if exact == 1: # exact calculation as on tax forms
excess = 1000. * math.ceil(excess / 1000.)
prectc = max(0., prectc - CTC_prt * excess)
# calculate and phase-out dependent credit
dep_credit = (DependentCredit_c * max(0, XTOT - num) +
DependentCredit_Child_c * n24 +
# calculate and phase-out dependent credit after pre-CTC is phased out
dep_credit = (DependentCredit_Child_c * n24 +
DependentCredit_Nonchild_c * max(0, XTOT - n24 - num) +
FilerCredit_c[MARS - 1])
if CTC_prt > 0. and c00100 > CTC_ps[MARS - 1]:
thresh = CTC_ps[MARS - 1] + n24 * CTC_c / CTC_prt
excess = c00100 - thresh
if exact == 1: # exact calculation as on tax forms
excess = 1000. * math.ceil(excess / 1000.)
dep_phaseout = CTC_prt * (c00100 - excess)
dep_credit = max(0., dep_credit - dep_phaseout)
if dep_credit > 0. and CTC_prt > 0.:
thresh = CTC_ps[MARS - 1] + base_ctc / CTC_prt
if modAGI > thresh:
excess = modAGI - thresh
if exact == 1: # exact calculation as on tax forms
excess = 1000. * math.ceil(excess / 1000.)
dep_credit = max(0., dep_credit - CTC_prt * excess)
return (prectc, dep_credit)


Expand Down
2 changes: 1 addition & 1 deletion taxcalc/records_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@
},
"dep_credit": {
"type": "float",
"desc": "search taxcalc/functions.py for how calculated and used",
"desc": "Dependent Credit added on top of Child Tax Credit",
"form": {"2013-20??": "calculated variable"}
},
"personal_refundable_credit": {
Expand Down
5 changes: 2 additions & 3 deletions taxcalc/reforms/2017_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// - 1: _II_rt? and _PT_rt?
// - 2: four _PT_excl_* parameters
// - 3: _CTC_c and _CTC_ps and _ACTC_Income_thd
// - 4: four different _DependentCredit_* parameters
// - 4: three different _DependentCredit_* parameters
// - 5: three _ALD_* parameters
// - 6: seven different _ID_* parameters
// NOTE: this reform projects pre-TCJA 2017 parameter values forward using the
Expand Down Expand Up @@ -46,8 +46,7 @@
"_ACTC_Income_thd": {"2018": [3000.0]},
"_DependentCredit_Child_c": {"2018": [0.0]},
"_DependentCredit_Nonchild_c": {"2018": [0.0]},
"_DependentCredit_Nonchild_c": {"2018": [0.0]},
"_DependentCredit_before_CTC": {"2018": [0.0]},
"_DependentCredit_before_CTC": {"2018": [false]},
"_ALD_AlimonyPaid_hc": {"2019": [0.0]},
"_ALD_AlimonyReceived_hc": {"2019": [1.0]},
"_ALD_DomesticProduction_hc": {"2018": [0.0]},
Expand Down
6 changes: 4 additions & 2 deletions taxcalc/reforms/RyanBrady.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// - 5: _NIIT_rt
// - 6: _STD
// - 7: _II_em
// - 8: _DependentCredit_c
// - 8: _DependentCredit_Child_c, _DependentCredit_Nonchild_c
// - 9: _CTC_ps
// - 10: _ID*
{
Expand Down Expand Up @@ -73,7 +73,9 @@
{"2017": [[0, 0, 0, 0, 0]]},
"_II_em":
{"2017": [0]},
"_DependentCredit_c":
"_DependentCredit_Child_c":
{"2017": [500]},
"_DependentCredit_Nonchild_c":
{"2017": [500]},
"_CTC_ps":
{"2017": [[75000, 150000, 75000, 75000, 75000]]},
Expand Down
6 changes: 3 additions & 3 deletions taxcalc/reforms/TCJA_House.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
6 0 0 0 0 0 0 0 0
7 180000 0 56209 123791 14942 8942 27540 157288
8 0 0 0 0 0 0 0 0
9 240000 0 43718 196282 27758 23008 36720 198632
10 600000 0 37473 562527 136297 134397 66067 431850
sums 1080000 0 168627 911373 182449 165671 139507 843855
9 240000 0 43718 196282 27758 22308 36720 199332
10 600000 0 37473 562527 136297 132997 66067 433250
sums 1080000 0 168627 911373 182449 163571 139507 845955
6 changes: 3 additions & 3 deletions taxcalc/reforms/TCJA_House_Amended.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
6 0 0 0 0 0 0 0 0
7 180000 0 56209 123791 14942 8942 27540 157288
8 0 0 0 0 0 0 0 0
9 240000 0 43718 196282 27758 23008 36720 198632
10 600000 0 37473 562527 136297 134397 66067 431850
sums 1080000 0 168627 911373 182449 165671 139507 843855
9 240000 0 43718 196282 27758 22308 36720 199332
10 600000 0 37473 562527 136297 132997 66067 433250
sums 1080000 0 168627 911373 182449 163571 139507 845955
4 changes: 2 additions & 2 deletions taxcalc/tests/reforms.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
"name": "Set Dependend Credit for Children at $500",
"output_type": "iitax",
"compare_with": {},
"expected": "Tax-Calculator,-8.4,-8.1,-7.9,-7.6"
"expected": "Tax-Calculator,-12.4,-12.3,-12.2,-12.1"
},

"57": {
Expand All @@ -629,7 +629,7 @@
"name": "Set Dependend Credit for Children at $500 AND stack dependent credit before CTC",
"output_type": "iitax",
"compare_with": {},
"expected": "Tax-Calculator,-14.3,-14.0,-13.8,-13.3"
"expected": "Tax-Calculator,-18.3,-18.2,-18.1,-17.8"
},

"58": {
Expand Down