taxcalc 5.0.4__py3-none-any.whl → 5.2.0__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.
@@ -6,58 +6,58 @@ ITAX mtr histogram bin edges:
6
6
  [-1.0, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0]
7
7
  PTAX and ITAX mtr histogram bin counts for e00200p:
8
8
  252868 : 0 27604 0 0 0 0 0 225264 0 0
9
- 252868 : 7375 73 2056 13084 45751 76620 50855 31268 25019 767
9
+ 252868 : 7375 73 2056 13084 45744 76630 50857 31265 25017 767
10
10
  PTAX and ITAX mtr histogram bin counts for e00200s:
11
11
  119177 : 0 19575 0 0 0 0 0 99602 0 0
12
- 119177 : 1449 22 793 2751 11461 31291 26217 22346 22287 560
12
+ 119177 : 1449 22 793 2752 11456 31297 26219 22344 22285 560
13
13
  PTAX and ITAX mtr histogram bin counts for e00900p:
14
14
  252868 : 252868 0 0 0 0 0 0 0 0 0
15
- 252868 : 6835 305 1552 11855 42872 71235 52251 30593 31274 4096
15
+ 252868 : 6835 305 1552 11855 42865 71246 52250 30592 31272 4096
16
16
  PTAX and ITAX mtr histogram bin counts for e00300:
17
17
  252868 : 252868 0 0 0 0 0 0 0 0 0
18
- 252868 : 0 0 0 0 67635 76846 46558 31872 29139 818
18
+ 252868 : 0 0 0 0 67629 76854 46561 31869 29137 818
19
19
  PTAX and ITAX mtr histogram bin counts for e00400:
20
20
  252868 : 252868 0 0 0 0 0 0 0 0 0
21
21
  252868 : 0 0 0 0 249271 3332 262 3 0 0
22
22
  PTAX and ITAX mtr histogram bin counts for e00600:
23
23
  252868 : 252868 0 0 0 0 0 0 0 0 0
24
- 252868 : 0 0 0 0 67635 76846 46558 31872 29139 818
24
+ 252868 : 0 0 0 0 67629 76854 46561 31869 29137 818
25
25
  PTAX and ITAX mtr histogram bin counts for e00650:
26
26
  252868 : 252868 0 0 0 0 0 0 0 0 0
27
- 252868 : 0 0 6 62 145106 46816 59780 659 412 27
27
+ 252868 : 0 0 5 62 145112 46819 59773 658 412 27
28
28
  PTAX and ITAX mtr histogram bin counts for e01400:
29
29
  252868 : 252868 0 0 0 0 0 0 0 0 0
30
- 252868 : 0 0 0 0 67638 76870 50250 32352 24980 778
30
+ 252868 : 0 0 0 0 67630 76881 50252 32349 24978 778
31
31
  PTAX and ITAX mtr histogram bin counts for e01700:
32
32
  252868 : 252868 0 0 0 0 0 0 0 0 0
33
- 252868 : 0 0 0 0 67638 76870 50250 32352 24980 778
33
+ 252868 : 0 0 0 0 67630 76881 50252 32349 24978 778
34
34
  PTAX and ITAX mtr histogram bin counts for e02000:
35
35
  252868 : 252868 0 0 0 0 0 0 0 0 0
36
- 252868 : 0 0 0 0 67635 76846 46558 31872 29139 818
36
+ 252868 : 0 0 0 0 67629 76854 46561 31869 29137 818
37
37
  PTAX and ITAX mtr histogram bin counts for e02400:
38
38
  252868 : 252868 0 0 0 0 0 0 0 0 0
39
- 252868 : 0 0 0 0 114136 44771 59367 33596 965 33
39
+ 252868 : 0 0 0 0 114130 44782 59366 33592 965 33
40
40
  PTAX and ITAX mtr histogram bin counts for p22250:
41
41
  252868 : 252868 0 0 0 0 0 0 0 0 0
42
- 252868 : 0 0 1 1 79196 76751 53033 24967 18409 510
42
+ 252868 : 0 0 1 1 79195 76757 53030 24966 18408 510
43
43
  PTAX and ITAX mtr histogram bin counts for p23250:
44
44
  252868 : 252868 0 0 0 0 0 0 0 0 0
45
- 252868 : 0 0 1 47 152419 43637 51317 2838 2560 49
45
+ 252868 : 0 0 1 48 152420 43642 51311 2837 2560 49
46
46
  PTAX and ITAX mtr histogram bin counts for e18500:
47
47
  252868 : 252868 0 0 0 0 0 0 0 0 0
48
- 252868 : 25488 25944 19604 7737 174095 0 0 0 0 0
48
+ 252868 : 25489 25944 19603 7736 174096 0 0 0 0 0
49
49
  PTAX and ITAX mtr histogram bin counts for e19200:
50
50
  252868 : 252868 0 0 0 0 0 0 0 0 0
51
- 252868 : 39722 32892 19901 4940 155413 0 0 0 0 0
51
+ 252868 : 39723 32895 19901 4939 155410 0 0 0 0 0
52
52
  PTAX and ITAX mtr histogram bin counts for e26270:
53
53
  252868 : 252868 0 0 0 0 0 0 0 0 0
54
- 252868 : 0 0 0 0 67638 76870 50250 32352 24980 778
54
+ 252868 : 0 0 0 0 67630 76881 50252 32349 24978 778
55
55
  PTAX and ITAX mtr histogram bin counts for e19800:
56
56
  252868 : 252868 0 0 0 0 0 0 0 0 0
57
- 252868 : 39580 32462 19837 4914 156075 0 0 0 0 0
57
+ 252868 : 39575 32461 19826 4910 156096 0 0 0 0 0
58
58
  PTAX and ITAX mtr histogram bin counts for e20100:
59
59
  252868 : 252868 0 0 0 0 0 0 0 0 0
60
- 252868 : 39528 32464 19815 4932 156129 0 0 0 0 0
60
+ 252868 : 39490 32426 19767 4904 156281 0 0 0 0 0
61
61
  PTAX and ITAX mtr histogram bin counts for k1bx14p:
62
62
  252868 : 252868 0 0 0 0 0 0 0 0 0
63
- 252868 : 6835 305 1552 11855 42872 71235 52251 30593 31274 4096
63
+ 252868 : 6835 305 1552 11855 42865 71246 52250 30592 31272 4096
@@ -564,6 +564,8 @@ PT_qbid_alt_w2_wages_rt = 0.25
564
564
  PT_qbid_alt_property_rt = 0.025
565
565
  PT_qbid_ps = [9e99, 9e99, 9e99, 9e99, 9e99]
566
566
  PT_qbid_prt = 0.0
567
+ PT_qbid_min_ded = 400.0 # OBBBA value in 2026
568
+ PT_qbid_min_qbi = 1000.0 # OBBBA value in 2026
567
569
 
568
570
  # Input variable values for tests
569
571
  c00100 = [527860.66, 337675.10, 603700.00, 90700.00]
@@ -578,52 +580,57 @@ e02100 = [0.00, 0.00, 0.00, 0.00]
578
580
  e27200 = [0.00, 0.00, 0.00, 0.00]
579
581
  e00650 = [5000.00, 8000.00, 3000.00, 9000.00]
580
582
  c01000 = [7000.00, 4000.00, -3000.00, -3000.00]
583
+ senior_deduction = [0.00, 0.00, 1000.00, 0.00]
581
584
  auto_loan_interest_deduction = [0.00, 0.00, 0.00, 1000.00]
582
585
  PT_SSTB_income = [0, 1, 1, 1]
583
586
  PT_binc_w2_wages = [0.00, 0.00, 0.00, 0.00]
584
587
  PT_ubia_property = [0.00, 0.00, 0.00, 0.00]
585
- c04800 = [0.0, 0.0, 0.0, 0.0] # unimportant for function
586
- qbided = [0.0, 0.0, 0.0, 0.0] # unimportant for function
588
+ c04800 = [0.0, 0.0, 0.0, 0.0] # calculated by function
589
+ qbided = [0.0, 0.0, 0.0, 0.0] # calculated by function
587
590
 
588
591
  tuple0 = (
589
592
  c00100[0], standard[0], c04470[0], c04600[0], MARS[0], e00900[0],
590
593
  c03260[0], e26270[0],
591
594
  e02100[0], e27200[0], e00650[0], c01000[0],
592
- auto_loan_interest_deduction[0], PT_SSTB_income[0],
595
+ senior_deduction[0], auto_loan_interest_deduction[0], PT_SSTB_income[0],
593
596
  PT_binc_w2_wages[0], PT_ubia_property[0], PT_qbid_rt, PT_qbid_limited,
594
597
  PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
595
- PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt, c04800[0],
596
- PT_qbid_ps, PT_qbid_prt, qbided[0])
597
- expected0 = (490860.66, 0)
598
+ PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt,
599
+ PT_qbid_ps, PT_qbid_prt, PT_qbid_min_ded, PT_qbid_min_qbi,
600
+ c04800[0], qbided[0])
601
+ expected0 = (490460.66, 400.00)
598
602
  tuple1 = (
599
603
  c00100[1], standard[1], c04470[1], c04600[1], MARS[1], e00900[1],
600
604
  c03260[1], e26270[1],
601
605
  e02100[1], e27200[1], e00650[1], c01000[1],
602
- auto_loan_interest_deduction[1], PT_SSTB_income[1],
606
+ senior_deduction[1], auto_loan_interest_deduction[1], PT_SSTB_income[1],
603
607
  PT_binc_w2_wages[1], PT_ubia_property[1], PT_qbid_rt, PT_qbid_limited,
604
608
  PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
605
- PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt, c04800[1],
606
- PT_qbid_ps, PT_qbid_prt, qbided[1])
609
+ PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt,
610
+ PT_qbid_ps, PT_qbid_prt, PT_qbid_min_ded, PT_qbid_min_qbi,
611
+ c04800[1], qbided[1])
607
612
  expected1 = (284400.08, 4275.02)
608
613
  tuple2 = (
609
614
  c00100[2], standard[2], c04470[2], c04600[2], MARS[2], e00900[2],
610
615
  c03260[2], e26270[2],
611
616
  e02100[2], e27200[2], e00650[2], c01000[2],
612
- auto_loan_interest_deduction[2], PT_SSTB_income[2],
617
+ senior_deduction[2], auto_loan_interest_deduction[2], PT_SSTB_income[2],
613
618
  PT_binc_w2_wages[2], PT_ubia_property[2], PT_qbid_rt, PT_qbid_limited,
614
619
  PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
615
- PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt, c04800[2],
616
- PT_qbid_ps, PT_qbid_prt, qbided[2])
617
- expected2 = (579300.00, 0)
620
+ PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt,
621
+ PT_qbid_ps, PT_qbid_prt, PT_qbid_min_ded, PT_qbid_min_qbi,
622
+ c04800[2], qbided[2])
623
+ expected2 = (577900.00, 400.00)
618
624
  tuple3 = (
619
625
  c00100[3], standard[3], c04470[3], c04600[3], MARS[3], e00900[3],
620
626
  c03260[3], e26270[3],
621
627
  e02100[3], e27200[3], e00650[3], c01000[3],
622
- auto_loan_interest_deduction[3], PT_SSTB_income[3],
628
+ senior_deduction[3], auto_loan_interest_deduction[3], PT_SSTB_income[3],
623
629
  PT_binc_w2_wages[3], PT_ubia_property[3], PT_qbid_rt, PT_qbid_limited,
624
630
  PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
625
- PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt, c04800[3],
626
- PT_qbid_ps, PT_qbid_prt, qbided[3])
631
+ PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt,
632
+ PT_qbid_ps, PT_qbid_prt, PT_qbid_min_ded, PT_qbid_min_qbi,
633
+ c04800[3], qbided[3])
627
634
  expected3 = (56500.00, 1200)
628
635
 
629
636
 
@@ -337,6 +337,7 @@ def test_bad_json_names(tests_path):
337
337
  Calculator.read_json_param_objects(None, test_url)
338
338
 
339
339
 
340
+ @pytest.mark.local
340
341
  def test_json_assump_url():
341
342
  """
342
343
  Test reading JSON assumption file using URL.
@@ -25,6 +25,7 @@ from taxcalc.calculator import Calculator
25
25
 
26
26
 
27
27
  START_YEAR = 2017
28
+ NUM_YEARS = 19
28
29
 
29
30
 
30
31
  @pytest.mark.cpscsv_agg
@@ -33,7 +34,7 @@ def test_agg(tests_path, cps_fullsample):
33
34
  Test current-law aggregate taxes using cps.csv file.
34
35
  """
35
36
  # pylint: disable=too-many-statements,too-many-locals
36
- nyrs = 10
37
+ nyrs = NUM_YEARS
37
38
  # create a baseline Policy object with current-law policy parameters
38
39
  baseline_policy = Policy()
39
40
  # create a Records object (rec) containing all cps.csv input records
@@ -62,6 +62,7 @@ def test_incorrect_implement_reform_usage():
62
62
  pol.implement_reform({2020: {'II_em': -1000}})
63
63
 
64
64
 
65
+ @pytest.mark.local
65
66
  def test_json_reform_url():
66
67
  """
67
68
  Test reading a JSON reform from a URL. Results from the URL are expected
@@ -262,7 +263,6 @@ def test_multi_year_reform():
262
263
  2019: 700000},
263
264
  'SS_Earnings_c-indexed': {2017: False,
264
265
  2019: True},
265
- 'CTC_c': {2015: 2000},
266
266
  'EITC_c': {2016: [900, 5000, 8000, 9000],
267
267
  2019: [1200, 7000, 10000, 12000]},
268
268
  'II_em': {2016: 7000,
@@ -280,35 +280,9 @@ def test_multi_year_reform():
280
280
  check_eitc_c(pol, reform, ifactor)
281
281
  check_ii_em(pol, reform, ifactor)
282
282
  check_ss_earnings_c(pol, reform, wfactor)
283
- check_ctc_c(pol, reform)
284
283
  # end of test_multi_year_reform with the check_* functions below:
285
284
 
286
285
 
287
- def check_ctc_c(ppo, reform):
288
- """
289
- Compare actual and expected _CTC_c parameter values
290
- generated by the test_multi_year_reform() function above.
291
- Ensure that future-year values in policy_current_law.json
292
- are overwritten by reform.
293
- """
294
- actual = {}
295
- arr = getattr(ppo, '_CTC_c')
296
- for i in range(0, ppo.num_years):
297
- actual[ppo.start_year + i] = arr[i]
298
- assert actual[2013] == 1000
299
- assert actual[2014] == 1000
300
- e2015 = reform['CTC_c'][2015]
301
- assert actual[2015] == e2015
302
- e2016 = actual[2015]
303
- assert actual[2016] == e2016
304
- e2017 = actual[2016]
305
- assert actual[2017] == e2017
306
- e2018 = actual[2017]
307
- assert actual[2018] == e2018
308
- e2019 = actual[2018]
309
- assert actual[2019] == e2019
310
-
311
-
312
286
  def check_eitc_c(ppo, reform, ifactor):
313
287
  """
314
288
  Compare actual and expected _EITC_c parameter values
@@ -901,27 +875,27 @@ def test_index_offset_reform():
901
875
  policy0.implement_reform({'parameter_indexing_CPI_offset': {2017: 0}})
902
876
  cpiu_rates = policy0.inflation_rates()
903
877
 
904
- reform1 = {'CTC_c-indexed': {2020: True}}
878
+ reform1 = {'ODC_c-indexed': {2020: True}}
905
879
  policy1 = Policy()
906
880
  policy1.implement_reform(reform1)
907
881
  offset = -0.005
908
- reform2 = {'CTC_c-indexed': {2020: True},
882
+ reform2 = {'ODC_c-indexed': {2020: True},
909
883
  'parameter_indexing_CPI_offset': {2020: offset}}
910
884
  policy2 = Policy()
911
- policy2.implement_reform(reform2) # caused T-C crash before PR#2364
912
- # extract from policy1 and policy2 the parameter values of CTC_c
885
+ policy2.implement_reform(reform2)
886
+ # extract from policy1 and policy2 the parameter values of ODC_c
913
887
  pvalue1 = {}
914
888
  pvalue2 = {}
915
889
  for cyr in [2019, 2020, 2021]:
916
890
  policy1.set_year(cyr)
917
- pvalue1[cyr] = policy1.CTC_c[0]
891
+ pvalue1[cyr] = policy1.ODC_c[0]
918
892
  policy2.set_year(cyr)
919
- pvalue2[cyr] = policy2.CTC_c[0]
893
+ pvalue2[cyr] = policy2.ODC_c[0]
920
894
  # check that pvalue1 and pvalue2 dictionaries contain the expected values
921
895
  assert pvalue2[2019] == pvalue1[2019]
922
896
  assert pvalue2[2020] == pvalue1[2020]
923
897
  assert pvalue2[2020] == pvalue2[2019]
924
- # ... indexing of CTC_c begins shows up first in 2021 parameter values
898
+ # ... indexing of ODC_c begins shows up first in 2021 parameter values
925
899
  assert pvalue1[2021] > pvalue1[2020]
926
900
  assert pvalue2[2021] > pvalue2[2020]
927
901
  # ... calculate expected pvalue2[2021] from inflation rates and offset
@@ -998,11 +972,15 @@ def test_raise_errors_regression():
998
972
  """
999
973
  This tests that raise_errors prevents the error from being thrown. The
1000
974
  correct behavior is to exit the `adjust` function and store the errors.
975
+ ** From the parameters.py docstring for the adjust method:
976
+ raise_errors: Boolean
977
+ Raise errors as a ValidationError. If False, they will be stored
978
+ in the errors attribute.
1001
979
  """
1002
980
  ref = {
1003
- "II_brk7-indexed": [{"value": True}],
981
+ "II_brk7-indexed": [{"value": False}],
1004
982
  "II_brk6": [{"value": 316700, "MARS": "single", "year": 2020}],
1005
- "II_brk7": [{"value": 445400, "MARS": "single", "year": 2020}],
983
+ "II_brk7": [{"value": 320700, "MARS": "single", "year": 2020}],
1006
984
 
1007
985
  }
1008
986
  pol = Policy()
@@ -1177,14 +1155,14 @@ def test_activate_index():
1177
1155
  """
1178
1156
  pol1 = Policy()
1179
1157
  pol1.implement_reform({
1180
- "CTC_c": {2022: 2000},
1181
- "CTC_c-indexed": {2022: True}
1158
+ "ODC_c": {2022: 1000},
1159
+ "ODC_c-indexed": {2022: True}
1182
1160
  })
1183
1161
  pol2 = Policy()
1184
1162
  pol2.adjust(
1185
1163
  {
1186
- "CTC_c": [{"year": 2022, "value": 2000}],
1187
- "CTC_c-indexed": [{"year": 2022, "value": True}],
1164
+ "ODC_c": [{"year": 2022, "value": 1000}],
1165
+ "ODC_c-indexed": [{"year": 2022, "value": True}],
1188
1166
  }
1189
1167
  )
1190
1168
  cmp_policy_objs(pol1, pol2)
@@ -1193,12 +1171,12 @@ def test_activate_index():
1193
1171
  pol0.set_year(year=2021)
1194
1172
  pol2.set_state(year=[2021, 2022, 2023])
1195
1173
  exp = np.array([
1196
- pol0.CTC_c[0],
1197
- 2000,
1198
- 2000 * (1 + pol2.inflation_rates(year=2022))
1174
+ pol0.ODC_c[0],
1175
+ 1000,
1176
+ 1000 * (1 + pol2.inflation_rates(year=2022))
1199
1177
  ]).round(2)
1200
1178
 
1201
- np.testing.assert_allclose(pol2.CTC_c, exp)
1179
+ np.testing.assert_allclose(pol2.ODC_c, exp)
1202
1180
 
1203
1181
 
1204
1182
  def test_apply_cpi_offset():
@@ -1404,7 +1382,7 @@ def test_adj_cpi_offset_and_index_status():
1404
1382
  """
1405
1383
  pol1 = Policy()
1406
1384
  pol1.implement_reform({
1407
- "CTC_c-indexed": {2020: True},
1385
+ "ODC_c-indexed": {2020: True},
1408
1386
  "parameter_indexing_CPI_offset": {2020: -0.005}},
1409
1387
  )
1410
1388
  pol2 = Policy()
@@ -1412,7 +1390,7 @@ def test_adj_cpi_offset_and_index_status():
1412
1390
  {
1413
1391
  "parameter_indexing_CPI_offset":
1414
1392
  [{"year": 2020, "value": -0.005}],
1415
- "CTC_c-indexed": [{"year": 2020, "value": True}],
1393
+ "ODC_c-indexed": [{"year": 2020, "value": True}],
1416
1394
  }
1417
1395
  )
1418
1396
  cmp_policy_objs(pol1, pol2)
@@ -1429,7 +1407,7 @@ def test_adj_cpi_offset_and_index_status():
1429
1407
 
1430
1408
  pol2.set_state(year=[2021, 2022])
1431
1409
  np.testing.assert_equal(
1432
- (pol2.CTC_c[1] / pol2.CTC_c[0] - 1).round(4),
1410
+ (pol2.ODC_c[1] / pol2.ODC_c[0] - 1).round(4),
1433
1411
  round(pol0.inflation_rates(year=2021) + (-0.005), 4),
1434
1412
  )
1435
1413
 
@@ -1515,9 +1493,9 @@ def test_cpi_offset_does_not_affect_wage_indexed_params():
1515
1493
  np.testing.assert_equal(act_before_2025, exp_before_2025)
1516
1494
 
1517
1495
 
1518
- def test_ext_plus_ctc1_reform(tests_path):
1496
+ def test_ext_plus_odc1_reform(tests_path):
1519
1497
  """
1520
- Test ext.json plus ctc1 compound reform relative to ext.json baseline.
1498
+ Test ext.json plus odc1 compound reform relative to ext.json baseline.
1521
1499
  """
1522
1500
  # specify baseline policy, bas, as the extend-TCJA reform
1523
1501
  bas = Policy()
@@ -1526,37 +1504,37 @@ def test_ext_plus_ctc1_reform(tests_path):
1526
1504
  ext_text = rfile.read()
1527
1505
  bas.implement_reform(Policy.read_json_reform(ext_text))
1528
1506
  assert not bas.parameter_errors
1529
- # specify reform policy, ref, as extend-TCJA plus liberalization of CTC
1507
+ # specify reform policy, ref, as extend-TCJA plus liberalization of ODC
1530
1508
  ref = Policy()
1531
1509
  ref.implement_reform(Policy.read_json_reform(ext_text))
1532
- ctc1_reform = {
1533
- # one possible child-tax-credit revision to the extend-TCJA reform
1534
- 'CTC_c': {
1535
- 2026: 2500.00,
1536
- 2027: 2500.00,
1537
- 2028: 2500.00,
1538
- 2029: 2000.00,
1510
+ odc1_reform = {
1511
+ # one possible other-dependent-credit revision to extend-TCJA reform
1512
+ 'ODC_c': {
1513
+ 2026: 1000.00,
1514
+ 2027: 1000.00,
1515
+ 2028: 1000.00,
1516
+ 2029: 1000.00,
1539
1517
  },
1540
- 'CTC_c-indexed': {2029: True},
1518
+ 'ODC_c-indexed': {2029: True},
1541
1519
  }
1542
- ref.implement_reform(ctc1_reform)
1520
+ ref.implement_reform(odc1_reform)
1543
1521
  assert not ref.parameter_errors
1544
1522
  # check bas and ref parameter values against expected parameter values
1545
- exp_ctc_c_bas = {
1546
- 2025: 2000,
1547
- 2026: 2000,
1548
- 2027: 2000,
1549
- 2028: 2000,
1550
- 2029: 2000,
1551
- 2030: 2000,
1523
+ exp_odc_c_bas = {
1524
+ 2025: 500,
1525
+ 2026: 500,
1526
+ 2027: 500,
1527
+ 2028: 500,
1528
+ 2029: 500,
1529
+ 2030: 500,
1552
1530
  }
1553
- exp_ctc_c_ref = {
1554
- 2025: 2000,
1555
- 2026: 2500,
1556
- 2027: 2500,
1557
- 2028: 2500,
1558
- 2029: 2000,
1559
- 2030: 2044.80,
1531
+ exp_odc_c_ref = {
1532
+ 2025: 500,
1533
+ 2026: 1000,
1534
+ 2027: 1000,
1535
+ 2028: 1000,
1536
+ 2029: 1000,
1537
+ 2030: 1022.4,
1560
1538
  }
1561
1539
  exp_actc_c = {
1562
1540
  2025: 1700,
@@ -1568,16 +1546,16 @@ def test_ext_plus_ctc1_reform(tests_path):
1568
1546
  }
1569
1547
  for year in range(2025, 2031):
1570
1548
  bas.set_year(year)
1571
- assert np.allclose([bas.CTC_c], [exp_ctc_c_bas[year]])
1549
+ assert np.allclose([bas.ODC_c], [exp_odc_c_bas[year]])
1572
1550
  assert np.allclose([bas.ACTC_c], [exp_actc_c[year]])
1573
1551
  ref.set_year(year)
1574
- assert np.allclose([ref.CTC_c], [exp_ctc_c_ref[year]])
1552
+ assert np.allclose([ref.ODC_c], [exp_odc_c_ref[year]])
1575
1553
  assert np.allclose([ref.ACTC_c], [exp_actc_c[year]])
1576
1554
 
1577
1555
 
1578
- def test_ext_plus_ctc2_reform(tests_path):
1556
+ def test_ext_plus_odc2_reform(tests_path):
1579
1557
  """
1580
- Test ext.json plus ctc2 compound reform relative to ext.json baseline.
1558
+ Test ext.json plus odc2 compound reform relative to ext.json baseline.
1581
1559
  """
1582
1560
  # specify baseline policy, bas, as the extend-TCJA reform
1583
1561
  bas = Policy()
@@ -1586,39 +1564,39 @@ def test_ext_plus_ctc2_reform(tests_path):
1586
1564
  ext_text = rfile.read()
1587
1565
  bas.implement_reform(Policy.read_json_reform(ext_text))
1588
1566
  assert not bas.parameter_errors
1589
- # specify reform policy, ref, as extend-TCJA plus liberalization of CTC
1567
+ # specify reform policy, ref, as extend-TCJA plus liberalization of ODC
1590
1568
  ref = Policy()
1591
1569
  ref.implement_reform(Policy.read_json_reform(ext_text))
1592
- ctc2_reform = {
1593
- # one possible child-tax-credit revision to the extend-TCJA reform
1594
- 'CTC_c': {
1595
- 2026: 2500.00,
1596
- 2027: 2500.00,
1597
- 2028: 2500.00,
1598
- 2029: 2000.00,
1570
+ odc2_reform = {
1571
+ # one possible other-dependent-credit revision to extend-TCJA reform
1572
+ 'ODC_c': {
1573
+ 2026: 600.00,
1574
+ 2027: 600.00,
1575
+ 2028: 600.00,
1576
+ 2029: 800.00,
1599
1577
  },
1600
- 'CTC_c-indexed': {2029: True},
1578
+ 'ODC_c-indexed': {2029: True},
1601
1579
  'ACTC_c': {2029: 1750},
1602
1580
  'ACTC_c-indexed': {2029: False},
1603
1581
  }
1604
- ref.implement_reform(ctc2_reform)
1582
+ ref.implement_reform(odc2_reform)
1605
1583
  assert not ref.parameter_errors
1606
1584
  # check bas and ref parameter values against expected parameter values
1607
- exp_ctc_c_bas = {
1608
- 2025: 2000,
1609
- 2026: 2000,
1610
- 2027: 2000,
1611
- 2028: 2000,
1612
- 2029: 2000,
1613
- 2030: 2000,
1585
+ exp_odc_c_bas = {
1586
+ 2025: 500,
1587
+ 2026: 500,
1588
+ 2027: 500,
1589
+ 2028: 500,
1590
+ 2029: 500,
1591
+ 2030: 500,
1614
1592
  }
1615
- exp_ctc_c_ref = {
1616
- 2025: 2000,
1617
- 2026: 2500,
1618
- 2027: 2500,
1619
- 2028: 2500,
1620
- 2029: 2000,
1621
- 2030: 2044.80,
1593
+ exp_odc_c_ref = {
1594
+ 2025: 500,
1595
+ 2026: 600,
1596
+ 2027: 600,
1597
+ 2028: 600,
1598
+ 2029: 800,
1599
+ 2030: 817.92,
1622
1600
  }
1623
1601
  exp_actc_c_bas = {
1624
1602
  2025: 1700,
@@ -1638,8 +1616,8 @@ def test_ext_plus_ctc2_reform(tests_path):
1638
1616
  }
1639
1617
  for year in range(2025, 2031):
1640
1618
  bas.set_year(year)
1641
- assert np.allclose([bas.CTC_c], [exp_ctc_c_bas[year]])
1619
+ assert np.allclose([bas.ODC_c], [exp_odc_c_bas[year]])
1642
1620
  assert np.allclose([bas.ACTC_c], [exp_actc_c_bas[year]])
1643
1621
  ref.set_year(year)
1644
- assert np.allclose([ref.CTC_c], [exp_ctc_c_ref[year]])
1622
+ assert np.allclose([ref.ODC_c], [exp_odc_c_ref[year]])
1645
1623
  assert np.allclose([ref.ACTC_c], [exp_actc_c_ref[year]])
@@ -170,7 +170,7 @@ def test_puf_var_stats(tests_path, puf_fullsample):
170
170
  del table_corr['description']
171
171
  # add statistics to tables
172
172
  year_headers = ['description']
173
- for year in range(Policy.JSON_START_YEAR, 2034 + 1):
173
+ for year in range(Policy.JSON_START_YEAR, 2024 + 1):
174
174
  assert year == calc.current_year
175
175
  year_headers.append(str(year))
176
176
  calc.calc_all()
@@ -24,6 +24,7 @@ from taxcalc.calculator import Calculator
24
24
 
25
25
 
26
26
  START_YEAR = 2017
27
+ NUM_YEARS = 19
27
28
 
28
29
 
29
30
  @pytest.mark.pufcsv_agg
@@ -34,7 +35,7 @@ def test_agg(tests_path, puf_fullsample):
34
35
  the full-sample puf.csv and a small sub-sample of puf.csv
35
36
  """
36
37
  # pylint: disable=too-many-locals,too-many-statements
37
- nyrs = 10
38
+ nyrs = NUM_YEARS
38
39
  # create a baseline Policy object with current-law policy parameters
39
40
  baseline_policy = Policy()
40
41
  # create a Records object (rec) containing all puf.csv input records
@@ -48,7 +48,7 @@ def test_2017_law_reform(tests_path):
48
48
  'EITC_ps_MarriedJ': {'relation': '>', 'value': 5680},
49
49
  'EITC_InvestIncome_c': {'relation': '>', 'value': 3500},
50
50
  # ... parameters affected by TCJA and that are not indexed
51
- 'ID_Charity_crt_cash': {'relation': '=', 'value': 0.5},
51
+ 'ID_Charity_crt_all': {'relation': '=', 'value': 0.5},
52
52
  'II_rt3': {'relation': '=', 'value': 0.25},
53
53
  # ... parameters affected by TCJA and that are indexed
54
54
  'II_brk3': {'relation': '>', 'value': 91900},
@@ -373,7 +373,7 @@ def test_ext_reform(tests_path):
373
373
  ext.implement_reform(Policy.read_json_reform(rtext))
374
374
  assert not ext.parameter_errors
375
375
  ext.set_year(2026)
376
- assert ext.II_em < end.II_em
376
+ assert np.allclose([ext.II_em], [end.II_em])
377
377
  # test tax output generated by ext.json reform file using public CPS data
378
378
  recs = Records.cps_constructor()
379
379
  calc_end = Calculator(policy=end, records=recs, verbose=False)
@@ -386,4 +386,4 @@ def test_ext_reform(tests_path):
386
386
  iitax_ext = calc_ext.array('iitax')
387
387
  rdiff = iitax_ext - iitax_end
388
388
  weighted_sum_rdiff = (rdiff * calc_end.array('s006')).sum() * 1.0e-9
389
- assert np.allclose([weighted_sum_rdiff], [-214.393], rtol=0.0, atol=0.01)
389
+ assert np.allclose([weighted_sum_rdiff], [45.491], rtol=0.0, atol=0.01)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taxcalc
3
- Version: 5.0.4
3
+ Version: 5.2.0
4
4
  Summary: Tax-Calculator
5
5
  Home-page: https://github.com/PSLmodels/Tax-Calculator
6
6
  Download-URL: https://github.com/PSLmodels/Tax-Calculator