taxcalc 4.2.0__py3-none-any.whl → 4.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. taxcalc/__init__.py +1 -1
  2. taxcalc/calcfunctions.py +74 -53
  3. taxcalc/policy_current_law.json +112 -168
  4. taxcalc/records_variables.json +6 -1
  5. taxcalc/taxcalcio.py +4 -0
  6. {taxcalc-4.2.0.dist-info → taxcalc-4.2.1.dist-info}/METADATA +1 -1
  7. taxcalc-4.2.1.dist-info/RECORD +34 -0
  8. {taxcalc-4.2.0.dist-info → taxcalc-4.2.1.dist-info}/WHEEL +1 -1
  9. taxcalc/assumptions/ASSUMPTIONS.md +0 -53
  10. taxcalc/assumptions/README.md +0 -17
  11. taxcalc/assumptions/economic_assumptions_template.json +0 -77
  12. taxcalc/reforms/2017_law.json +0 -125
  13. taxcalc/reforms/2017_law.out.csv +0 -10
  14. taxcalc/reforms/ARPA.json +0 -78
  15. taxcalc/reforms/ARPA.out.csv +0 -10
  16. taxcalc/reforms/BrownKhanna.json +0 -23
  17. taxcalc/reforms/BrownKhanna.out.csv +0 -10
  18. taxcalc/reforms/CARES.json +0 -37
  19. taxcalc/reforms/CARES.out.csv +0 -10
  20. taxcalc/reforms/ConsolidatedAppropriationsAct2021.json +0 -15
  21. taxcalc/reforms/ConsolidatedAppropriationsAct2021.out.csv +0 -10
  22. taxcalc/reforms/Larson2019.json +0 -36
  23. taxcalc/reforms/Larson2019.out.csv +0 -10
  24. taxcalc/reforms/README.md +0 -22
  25. taxcalc/reforms/REFORMS.md +0 -92
  26. taxcalc/reforms/Renacci.json +0 -61
  27. taxcalc/reforms/Renacci.out.csv +0 -10
  28. taxcalc/reforms/SandersDeFazio.json +0 -15
  29. taxcalc/reforms/SandersDeFazio.out.csv +0 -10
  30. taxcalc/reforms/TCJA.json +0 -168
  31. taxcalc/reforms/TCJA.md +0 -48
  32. taxcalc/reforms/TCJA.out.csv +0 -10
  33. taxcalc/reforms/Trump2016.json +0 -71
  34. taxcalc/reforms/Trump2016.out.csv +0 -10
  35. taxcalc/reforms/Trump2017.json +0 -51
  36. taxcalc/reforms/Trump2017.out.csv +0 -10
  37. taxcalc/reforms/archive/Clinton2016.json +0 -56
  38. taxcalc/reforms/archive/RyanBrady.json +0 -104
  39. taxcalc/reforms/archive/TCJA_House.json +0 -144
  40. taxcalc/reforms/archive/TCJA_House_Amended.json +0 -152
  41. taxcalc/reforms/archive/TCJA_Reconciliation.json +0 -187
  42. taxcalc/reforms/archive/TCJA_Senate.json +0 -116
  43. taxcalc/reforms/archive/TCJA_Senate_111417.json +0 -169
  44. taxcalc/reforms/archive/TCJA_Senate_120117.json +0 -174
  45. taxcalc/reforms/cases.csv +0 -10
  46. taxcalc/reforms/clp.out.csv +0 -10
  47. taxcalc/reforms/ext.json +0 -59
  48. taxcalc/reforms/ptaxes0.json +0 -37
  49. taxcalc/reforms/ptaxes0.out.csv +0 -10
  50. taxcalc/reforms/ptaxes1.json +0 -21
  51. taxcalc/reforms/ptaxes1.out.csv +0 -10
  52. taxcalc/reforms/ptaxes2.json +0 -18
  53. taxcalc/reforms/ptaxes2.out.csv +0 -10
  54. taxcalc/reforms/ptaxes3.json +0 -28
  55. taxcalc/reforms/ptaxes3.out.csv +0 -10
  56. taxcalc/reforms/rounding2022.json +0 -143
  57. taxcalc/reforms/rounding2022.out.csv +0 -10
  58. taxcalc/tests/benefits_expect.csv +0 -169
  59. taxcalc/tests/cmpi_cps_expect.txt +0 -132
  60. taxcalc/tests/cmpi_puf_expect.txt +0 -132
  61. taxcalc/tests/conftest.py +0 -143
  62. taxcalc/tests/cpscsv_agg_expect.csv +0 -26
  63. taxcalc/tests/puf_var_correl_coeffs_2016.csv +0 -80
  64. taxcalc/tests/puf_var_wght_means_by_year.csv +0 -80
  65. taxcalc/tests/pufcsv_agg_expect.csv +0 -26
  66. taxcalc/tests/pufcsv_mtr_expect.txt +0 -63
  67. taxcalc/tests/reforms.json +0 -649
  68. taxcalc/tests/reforms_expect.csv +0 -65
  69. taxcalc/tests/test_4package.py +0 -67
  70. taxcalc/tests/test_benefits.py +0 -86
  71. taxcalc/tests/test_calcfunctions.py +0 -863
  72. taxcalc/tests/test_calculator.py +0 -1021
  73. taxcalc/tests/test_compare.py +0 -336
  74. taxcalc/tests/test_compatible_data.py +0 -338
  75. taxcalc/tests/test_consumption.py +0 -144
  76. taxcalc/tests/test_cpscsv.py +0 -163
  77. taxcalc/tests/test_data.py +0 -133
  78. taxcalc/tests/test_decorators.py +0 -332
  79. taxcalc/tests/test_growdiff.py +0 -102
  80. taxcalc/tests/test_growfactors.py +0 -94
  81. taxcalc/tests/test_parameters.py +0 -617
  82. taxcalc/tests/test_policy.py +0 -1575
  83. taxcalc/tests/test_puf_var_stats.py +0 -194
  84. taxcalc/tests/test_pufcsv.py +0 -385
  85. taxcalc/tests/test_records.py +0 -234
  86. taxcalc/tests/test_reforms.py +0 -385
  87. taxcalc/tests/test_responses.py +0 -41
  88. taxcalc/tests/test_taxcalcio.py +0 -755
  89. taxcalc/tests/test_tmdcsv.py +0 -38
  90. taxcalc/tests/test_utils.py +0 -792
  91. taxcalc/validation/CSV_INPUT_VARS.md +0 -29
  92. taxcalc/validation/CSV_OUTPUT_VARS.md +0 -63
  93. taxcalc/validation/README.md +0 -68
  94. taxcalc/validation/taxsim35/Differences_Explained.md +0 -54
  95. taxcalc/validation/taxsim35/README.md +0 -139
  96. taxcalc/validation/taxsim35/expected_differences/a17-taxdiffs-expect.csv +0 -25
  97. taxcalc/validation/taxsim35/expected_differences/a18-taxdiffs-expect.csv +0 -25
  98. taxcalc/validation/taxsim35/expected_differences/a19-taxdiffs-expect.csv +0 -25
  99. taxcalc/validation/taxsim35/expected_differences/a20-taxdiffs-expect.csv +0 -25
  100. taxcalc/validation/taxsim35/expected_differences/a21-taxdiffs-expect.csv +0 -25
  101. taxcalc/validation/taxsim35/expected_differences/b17-taxdiffs-expect.csv +0 -25
  102. taxcalc/validation/taxsim35/expected_differences/b18-taxdiffs-expect.csv +0 -25
  103. taxcalc/validation/taxsim35/expected_differences/b19-taxdiffs-expect.csv +0 -25
  104. taxcalc/validation/taxsim35/expected_differences/b20-taxdiffs-expect.csv +0 -25
  105. taxcalc/validation/taxsim35/expected_differences/b21-taxdiffs-expect.csv +0 -25
  106. taxcalc/validation/taxsim35/expected_differences/c17-taxdiffs-expect.csv +0 -25
  107. taxcalc/validation/taxsim35/expected_differences/c18-taxdiffs-expect.csv +0 -25
  108. taxcalc/validation/taxsim35/expected_differences/c19-taxdiffs-expect.csv +0 -25
  109. taxcalc/validation/taxsim35/input_setup.py +0 -67
  110. taxcalc/validation/taxsim35/main_comparison.py +0 -183
  111. taxcalc/validation/taxsim35/prepare_taxcalc_input.py +0 -161
  112. taxcalc/validation/taxsim35/process_taxcalc_output.py +0 -140
  113. taxcalc/validation/taxsim35/taxsim_emulation.json +0 -49
  114. taxcalc/validation/taxsim35/taxsim_input.py +0 -321
  115. taxcalc/validation/taxsim35/tc_sims.py +0 -98
  116. taxcalc/validation/taxsim35/tests_35.py +0 -80
  117. taxcalc/validation/tests_35.sh +0 -13
  118. taxcalc-4.2.0.dist-info/RECORD +0 -143
  119. {taxcalc-4.2.0.dist-info → taxcalc-4.2.1.dist-info}/LICENSE +0 -0
  120. {taxcalc-4.2.0.dist-info → taxcalc-4.2.1.dist-info}/entry_points.txt +0 -0
  121. {taxcalc-4.2.0.dist-info → taxcalc-4.2.1.dist-info}/top_level.txt +0 -0
taxcalc/__init__.py CHANGED
@@ -14,4 +14,4 @@ from taxcalc.taxcalcio import *
14
14
  from taxcalc.utils import *
15
15
  from taxcalc.cli import *
16
16
 
17
- __version__ = '4.2.0'
17
+ __version__ = '4.2.1'
taxcalc/calcfunctions.py CHANGED
@@ -781,7 +781,7 @@ def ItemDedCap(e17500, e18400, e18500, e19200, e19800, e20100, e20400, g20500,
781
781
  e19800: float
782
782
  Itemizable charitable giving: cash/check contributions
783
783
  e20100: float
784
- Itemizable charitalb giving: other than cash/check contributions
784
+ Itemizable charitable giving: other than cash/check contributions
785
785
  e20400: float
786
786
  Itemizable gross (before 10% AGI disregard) casualty or theft loss
787
787
  g20500: float
@@ -887,7 +887,7 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
887
887
  c17000, c18300, c19200, c19700, c20500, c20800,
888
888
  ID_ps, ID_Medical_frt, ID_Medical_frt_add4aged, ID_Medical_hc,
889
889
  ID_Casualty_frt, ID_Casualty_hc, ID_Miscellaneous_frt,
890
- ID_Miscellaneous_hc, ID_Charity_crt_all, ID_Charity_crt_noncash,
890
+ ID_Miscellaneous_hc, ID_Charity_crt_cash, ID_Charity_crt_noncash,
891
891
  ID_prt, ID_crt, ID_c, ID_StateLocalTax_hc, ID_Charity_frt,
892
892
  ID_Charity_hc, ID_InterestPaid_hc, ID_RealEstate_hc,
893
893
  ID_Medical_c, ID_StateLocalTax_c, ID_RealEstate_c,
@@ -957,8 +957,8 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
957
957
  Floor (as decimal fraction of AGI) for deductible miscellaneous expenses
958
958
  ID_Miscellaneous_hc: float
959
959
  Miscellaneous expense deduction haircut
960
- ID_Charity_crt_all: float
961
- Ceiling (as decimal fraction of AGI) for all charitable contribution deductions
960
+ ID_Charity_crt_cash: float
961
+ Ceiling (as decimal fraction of AGI) for cash charitable contribution deductions
962
962
  ID_Charity_crt_noncash: float
963
963
  Ceiling (as decimal fraction of AGI) for noncash charitable contribution deductions
964
964
  ID_prt: float
@@ -1047,8 +1047,9 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
1047
1047
  c19200 = e19200_capped * (1. - ID_InterestPaid_hc)
1048
1048
  c19200 = min(c19200, ID_InterestPaid_c[MARS - 1])
1049
1049
  # Charity
1050
- lim30 = min(ID_Charity_crt_noncash * posagi, e20100_capped)
1051
- c19700 = min(ID_Charity_crt_all * posagi, lim30 + e19800_capped)
1050
+ charity_ded_cash = min(ID_Charity_crt_cash * posagi, e19800_capped)
1051
+ charity_ded_noncash = min(ID_Charity_crt_noncash * posagi, e20100_capped)
1052
+ c19700 = charity_ded_cash + charity_ded_noncash
1052
1053
  # charity floor is zero in present law
1053
1054
  charity_floor = max(ID_Charity_frt * posagi, ID_Charity_f[MARS - 1])
1054
1055
  c19700 = max(0., c19700 - charity_floor) * (1. - ID_Charity_hc)
@@ -1133,9 +1134,9 @@ def AdditionalMedicareTax(e00200, MARS,
1133
1134
 
1134
1135
  @iterate_jit(nopython=True)
1135
1136
  def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
1136
- MARS, MIDR, blind_head, blind_spouse, standard, c19700,
1137
- STD_allow_charity_ded_nonitemizers,
1138
- STD_charity_ded_nonitemizers_max):
1137
+ MARS, MIDR, blind_head, blind_spouse, standard,
1138
+ STD_allow_charity_ded_nonitemizers, e19800, ID_Charity_crt_cash,
1139
+ c00100, STD_charity_ded_nonitemizers_max):
1139
1140
  """
1140
1141
  Calculates standard deduction, including standard deduction for
1141
1142
  dependents, aged and bind.
@@ -1166,12 +1167,16 @@ def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
1166
1167
  1 if spouse is blind, 0 otherwise
1167
1168
  standard: float
1168
1169
  Standard deduction (zero for itemizers)
1169
- c19700: float
1170
- Schedule A: charity contributions deducted
1171
1170
  STD_allow_charity_ded_nonitemizers: bool
1172
1171
  Allow standard deduction filers to take the charitable contributions deduction
1172
+ e19800: float
1173
+ Schedule A: cash charitable contributions
1174
+ ID_Charity_crt_cash: float
1175
+ Fraction of AGI cap on cash charitable deductions
1176
+ c00100: float
1177
+ Federal AGI
1173
1178
  STD_charity_ded_nonitemizers_max: float
1174
- Ceiling amount (in dollars) for charitable deductions for non-itemizers
1179
+ Ceiling amount (in dollars) for charitable deductions for nonitemizers
1175
1180
 
1176
1181
  Returns
1177
1182
  -------
@@ -1199,13 +1204,15 @@ def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
1199
1204
  standard = basic_stded + extra_stded
1200
1205
  if MARS == 3 and MIDR == 1:
1201
1206
  standard = 0.
1207
+ # calculate CARES cash charity deduction for nonitemizers
1202
1208
  if STD_allow_charity_ded_nonitemizers:
1203
- standard += min(c19700, STD_charity_ded_nonitemizers_max)
1209
+ capped_ded = min(e19800, ID_Charity_crt_cash * c00100)
1210
+ standard += min(capped_ded, STD_charity_ded_nonitemizers_max[MARS - 1])
1204
1211
  return standard
1205
1212
 
1206
1213
 
1207
1214
  @iterate_jit(nopython=True)
1208
- def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
1215
+ def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, c03260, e26270,
1209
1216
  e02100, e27200, e00650, c01000, PT_SSTB_income,
1210
1217
  PT_binc_w2_wages, PT_ubia_property, PT_qbid_rt,
1211
1218
  PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
@@ -1229,6 +1236,8 @@ def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
1229
1236
  Filing (marital) status. (1=single, 2=joint, 3=separate, 4=household-head, 5=widow(er))
1230
1237
  e00900: float
1231
1238
  Schedule C business net profit/loss for filing unit
1239
+ c03260: float
1240
+ Self-employment (SECA) tax above-the-line deduction
1232
1241
  e26270: float
1233
1242
  Schedule E: combined partnership and S-corporation net income/loss
1234
1243
  e02100: float
@@ -1280,7 +1289,7 @@ def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
1280
1289
  pre_qbid_taxinc = max(0., c00100 - max(c04470, standard) - c04600)
1281
1290
  # calculate qualified business income deduction
1282
1291
  qbided = 0.
1283
- qbinc = max(0., e00900 + e26270 + e02100 + e27200)
1292
+ qbinc = max(0., e00900 - c03260 + e26270 + e02100 + e27200)
1284
1293
  if qbinc > 0. and PT_qbid_rt > 0.:
1285
1294
  qbid_before_limits = qbinc * PT_qbid_rt
1286
1295
  lower_thd = PT_qbid_taxinc_thd[MARS - 1]
@@ -1899,7 +1908,7 @@ def AGIsurtax(c00100, MARS, AGI_surtax_trt, AGI_surtax_thd, taxbc, surtax):
1899
1908
  def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc,
1900
1909
  c04470, c17000, c20800, c21040, e24515, MARS, sep, dwks19,
1901
1910
  dwks14, c05700, e62900, e00700, dwks10, age_head, age_spouse,
1902
- earned, cmbtp,
1911
+ earned, cmbtp, qbided,
1903
1912
  AMT_child_em_c_age, AMT_brk1,
1904
1913
  AMT_em, AMT_prt, AMT_rt1, AMT_rt2,
1905
1914
  AMT_child_em, AMT_em_ps, AMT_em_pe,
@@ -1936,7 +1945,7 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc,
1936
1945
  c20800: float
1937
1946
  Schedule A: net limited miscellaneous deductions deducted
1938
1947
  c21040: float
1939
- Itemized deductiosn that are phased out
1948
+ Itemized deductions that are phased out
1940
1949
  e24515: float
1941
1950
  Schedule D: Un-Recaptured Section 1250 Gain
1942
1951
  MARS: int
@@ -1963,6 +1972,8 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc,
1963
1972
  Earned income for filing unit
1964
1973
  cmbtp: float
1965
1974
  Estimate of income on (AMT) Form 6251 but not in AGI
1975
+ qbided: float
1976
+ Qualified business income deduction
1966
1977
  AMT_child_em_c_age: float
1967
1978
  Age ceiling for special AMT exemption
1968
1979
  AMT_brk1: float
@@ -2014,11 +2025,11 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc,
2014
2025
  # pylint: disable=too-many-statements,too-many-branches
2015
2026
  # Form 6251, Part I
2016
2027
  if standard == 0.0:
2017
- c62100 = (c00100 - e00700 - c04470 +
2028
+ c62100 = (c00100 - e00700 - qbided - c04470 +
2018
2029
  max(0., min(c17000, 0.025 * c00100)) +
2019
2030
  c18300 + c20800 - c21040)
2020
2031
  if standard > 0.0:
2021
- c62100 = c00100 - e00700
2032
+ c62100 = c00100 - e00700 - qbided
2022
2033
  c62100 += cmbtp # add income not in AGI but considered income for AMT
2023
2034
  if MARS == 3:
2024
2035
  amtsepadd = max(0.,
@@ -2136,7 +2147,8 @@ def NetInvIncTax(e00300, e00600, e02000, e26270, c01000,
2136
2147
  @iterate_jit(nopython=True)
2137
2148
  def F2441(MARS, earned_p, earned_s, f2441, CDCC_c, e32800,
2138
2149
  exact, c00100, CDCC_ps, CDCC_ps2, CDCC_crt, CDCC_frt,
2139
- CDCC_prt, CDCC_refundable, c05800, e07300, c07180, CDCC_refund):
2150
+ CDCC_po_step_size, CDCC_po_rate_per_step, CDCC_refundable,
2151
+ c05800, e07300, c07180, CDCC_refund):
2140
2152
  """
2141
2153
  Calculates Form 2441 child and dependent care expense credit, c07180.
2142
2154
 
@@ -2166,16 +2178,18 @@ def F2441(MARS, earned_p, earned_s, f2441, CDCC_c, e32800,
2166
2178
  Child/dependent care credit phaseout rate ceiling
2167
2179
  CDCC_frt: float
2168
2180
  Child/dependent care credit phaseout rate floor
2169
- CDCC_prt: float
2170
- Child/dependent care credit phaseout rate
2181
+ CDCC_po_step_size: float
2182
+ Child/dependent care credit phaseout AGI step size
2183
+ CDCC_po_rate_per_step: float
2184
+ Child/dependent care credit phaseout rate per step size
2185
+ CDCC_refund: bool
2186
+ Indicator for whether CDCC is refundable
2171
2187
  c05800: float
2172
2188
  Total (regular + AMT) income tax liability before credits
2173
2189
  e07300: float
2174
2190
  Foreign tax credit from Form 1116
2175
2191
  c07180: float
2176
2192
  Credit for child and dependent care expenses from Form 2441
2177
- CDCC_refund: bool
2178
- Indicator for whether CDCC is refundable
2179
2193
 
2180
2194
  Returns
2181
2195
  -------
@@ -2192,22 +2206,22 @@ def F2441(MARS, earned_p, earned_s, f2441, CDCC_c, e32800,
2192
2206
  else:
2193
2207
  c32890 = earned_p
2194
2208
  c33000 = max(0., min(c32800, min(c32880, c32890)))
2195
- # credit is limited by AGI-related fraction
2209
+ # credit rate is limited at high AGI
2210
+ # ... first phase-down from CDCC_crt to CDCC_frt
2211
+ steps_fractional = max(0., c00100 - CDCC_ps) / CDCC_po_step_size
2196
2212
  if exact == 1: # exact calculation as on tax forms
2197
- # first phase-down from 35 to 20 percent
2198
- tratio1 = math.ceil(max(((c00100 - CDCC_ps) * CDCC_prt), 0.))
2199
- crate = max(CDCC_frt, CDCC_crt - min(CDCC_crt - CDCC_frt, tratio1))
2200
- # second phase-down from 20 percent to zero
2201
- if c00100 > CDCC_ps2:
2202
- tratio2 = math.ceil(max(((c00100 - CDCC_ps2) * CDCC_prt), 0.))
2203
- crate = max(0., CDCC_frt - min(CDCC_frt, tratio2))
2213
+ steps = math.ceil(steps_fractional)
2204
2214
  else:
2205
- crate = max(CDCC_frt, CDCC_crt -
2206
- max(((c00100 - CDCC_ps) * CDCC_prt), 0.))
2207
- if c00100 > CDCC_ps2:
2208
- crate = max(0., CDCC_frt -
2209
- max(((c00100 - CDCC_ps2) * CDCC_prt), 0.))
2210
-
2215
+ steps = steps_fractional
2216
+ crate = max(CDCC_frt, CDCC_crt - steps * CDCC_po_rate_per_step)
2217
+ # ... second phase-down from CDCC_frt to zero
2218
+ if c00100 > CDCC_ps2:
2219
+ steps_fractional = (c00100 - CDCC_ps2) / CDCC_po_step_size
2220
+ if exact == 1: # exact calculation as on tax forms
2221
+ steps = math.ceil(steps_fractional)
2222
+ else:
2223
+ steps = steps_fractional
2224
+ crate = max(0., CDCC_frt - steps * CDCC_po_rate_per_step)
2211
2225
  c33200 = c33000 * crate
2212
2226
  # credit is limited by tax liability if not refundable
2213
2227
  if CDCC_refundable:
@@ -2441,7 +2455,7 @@ def ChildDepTaxCredit(age_head, age_spouse, nu18, n24, MARS, c00100, XTOT, num,
2441
2455
  c07200,
2442
2456
  CTC_c, CTC_ps, CTC_prt, exact, ODC_c,
2443
2457
  CTC_c_under6_bonus, nu06,
2444
- CTC_refundable, CTC_include17,
2458
+ CTC_is_refundable, CTC_include17,
2445
2459
  c07220, odc, codtc_limited):
2446
2460
  """
2447
2461
  Computes amounts on "Child Tax Credit and Credit for Other Dependents
@@ -2540,7 +2554,7 @@ def ChildDepTaxCredit(age_head, age_spouse, nu18, n24, MARS, c00100, XTOT, num,
2540
2554
  line13 = line11 - line12
2541
2555
  line14 = 0.
2542
2556
  line15 = max(0., line13 - line14)
2543
- if CTC_refundable:
2557
+ if CTC_is_refundable:
2544
2558
  c07220 = line10 * line1 / line3
2545
2559
  odc = max(0., line10 - c07220)
2546
2560
  codtc_limited = max(0., line10 - c07220 - odc)
@@ -2910,7 +2924,7 @@ def CharityCredit(e19800, e20100, c00100, CR_Charity_rt, CR_Charity_f,
2910
2924
  def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400,
2911
2925
  e07600, p08000, odc,
2912
2926
  personal_nonrefundable_credit,
2913
- CTC_refundable,
2927
+ CTC_is_refundable,
2914
2928
  CR_RetirementSavings_hc, CR_ForeignTax_hc,
2915
2929
  CR_ResidentialEnergy_hc, CR_GeneralBusiness_hc,
2916
2930
  CR_MinimumTax_hc, CR_OtherCredits_hc, charity_credit,
@@ -2939,7 +2953,7 @@ def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400,
2939
2953
  Other Dependent Credit
2940
2954
  personal_nonrefundable_credit: float
2941
2955
  Personal nonrefundable credit
2942
- CTC_refundable: bool
2956
+ CTC_is_refundable: bool
2943
2957
  Whether the child tax credit is fully refundable
2944
2958
  CR_RetirementSavings_hc: float
2945
2959
  Credit for retirement savings haircut
@@ -3019,7 +3033,7 @@ def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400,
3019
3033
  c07240 = min(e07240 * (1. - CR_RetirementSavings_hc), avail)
3020
3034
  avail = avail - c07240
3021
3035
  # Child tax credit
3022
- if not CTC_refundable:
3036
+ if not CTC_is_refundable:
3023
3037
  c07220 = min(c07220, avail)
3024
3038
  avail = avail - c07220
3025
3039
  # Other dependent credit
@@ -3053,7 +3067,8 @@ def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400,
3053
3067
  @iterate_jit(nopython=True)
3054
3068
  def AdditionalCTC(codtc_limited, ACTC_c, n24, earned, ACTC_Income_thd,
3055
3069
  ACTC_rt, nu06, ACTC_rt_bonus_under6family, ACTC_ChildNum,
3056
- CTC_refundable, CTC_include17, age_head, age_spouse, MARS, nu18,
3070
+ CTC_is_refundable, CTC_include17,
3071
+ age_head, age_spouse, MARS, nu18,
3057
3072
  ptax_was, c03260, e09800, c59660, e11200,
3058
3073
  c11070):
3059
3074
  """
@@ -3101,7 +3116,7 @@ def AdditionalCTC(codtc_limited, ACTC_c, n24, earned, ACTC_Income_thd,
3101
3116
  # Part I
3102
3117
  line3 = codtc_limited
3103
3118
 
3104
- if CTC_refundable:
3119
+ if CTC_is_refundable:
3105
3120
  line4 = 0.
3106
3121
  else:
3107
3122
  if CTC_include17:
@@ -3142,7 +3157,8 @@ def AdditionalCTC(codtc_limited, ACTC_c, n24, earned, ACTC_Income_thd,
3142
3157
  def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3143
3158
  c07400, c07600, c08000, e09700, e09800, e09900, niit, othertaxes,
3144
3159
  c07100, c09200, odc, charity_credit,
3145
- personal_nonrefundable_credit, CTC_refundable, ODC_refundable):
3160
+ personal_nonrefundable_credit,
3161
+ CTC_is_refundable, ODC_is_refundable):
3146
3162
  """
3147
3163
  Computes total used nonrefundable credits, c07100, othertaxes, and
3148
3164
  income tax before refundable credits, c09200.
@@ -3203,8 +3219,9 @@ def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3203
3219
  """
3204
3220
  # total used nonrefundable credits (as computed in NonrefundableCredits)
3205
3221
  c07100 = (c07180 + c07200 + c07600 + c07300 + c07400 +
3206
- c07220 * (1. - CTC_refundable) + c08000 +
3207
- c07230 + c07240 + c07260 + odc * (1. - ODC_refundable) + charity_credit +
3222
+ c07220 * (1. - CTC_is_refundable) + c08000 +
3223
+ c07230 + c07240 + c07260 +
3224
+ odc * (1. - ODC_is_refundable) + charity_credit +
3208
3225
  personal_nonrefundable_credit)
3209
3226
  # tax after credits (2016 Form 1040, line 56)
3210
3227
  tax_net_nonrefundable_credits = max(0., c05800 - c07100)
@@ -3305,8 +3322,8 @@ def CTC_new(CTC_new_c, CTC_new_rt, CTC_new_c_under6_bonus,
3305
3322
  @iterate_jit(nopython=True)
3306
3323
  def IITAX(c59660, c11070, c10960, personal_refundable_credit, ctc_new, rptc,
3307
3324
  c09200, payrolltax, CDCC_refund, recovery_rebate_credit,
3308
- eitc, c07220, odc, CTC_refundable, ODC_refundable, refund,
3309
- ctc_total, ctc_refundable, iitax, combined):
3325
+ eitc, c07220, odc, CTC_is_refundable, ODC_is_refundable, refund,
3326
+ ctc_total, ctc_refundable, ctc_nonrefundable, iitax, combined):
3310
3327
  """
3311
3328
  Computes final taxes.
3312
3329
 
@@ -3352,17 +3369,19 @@ def IITAX(c59660, c11070, c10960, personal_refundable_credit, ctc_new, rptc,
3352
3369
  Total CTC amount (c07220 + c11070 + odc + ctc_new)
3353
3370
  ctc_refundable: float
3354
3371
  Portion of total CTC amount that is refundable
3372
+ ctc_nonrefundable: float
3373
+ Portion of total CTC amount that is nonrefundable
3355
3374
  iitax: float
3356
3375
  Total federal individual income tax liability
3357
3376
  combined: float
3358
3377
  Sum of iitax and payrolltax and lumpsum_tax
3359
3378
  """
3360
3379
  eitc = c59660
3361
- if CTC_refundable:
3380
+ if CTC_is_refundable:
3362
3381
  ctc_refund = c07220
3363
3382
  else:
3364
3383
  ctc_refund = 0.
3365
- if ODC_refundable:
3384
+ if ODC_is_refundable:
3366
3385
  odc_refund = odc
3367
3386
  else:
3368
3387
  odc_refund = 0.
@@ -3371,9 +3390,11 @@ def IITAX(c59660, c11070, c10960, personal_refundable_credit, ctc_new, rptc,
3371
3390
  odc_refund)
3372
3391
  ctc_total = c07220 + c11070 + odc + ctc_new
3373
3392
  ctc_refundable = ctc_refund + c11070 + odc_refund + ctc_new
3393
+ ctc_nonrefundable = max(0., ctc_total - ctc_refundable)
3374
3394
  iitax = c09200 - refund
3375
3395
  combined = iitax + payrolltax
3376
- return (eitc, refund, ctc_total, ctc_refundable, iitax, combined)
3396
+ return (eitc, refund, ctc_total, ctc_refundable, ctc_nonrefundable,
3397
+ iitax, combined)
3377
3398
 
3378
3399
 
3379
3400
  @JIT(nopython=True)