taxcalc 5.2.0__py3-none-any.whl → 6.0.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.
Files changed (46) hide show
  1. taxcalc/__init__.py +3 -3
  2. taxcalc/calcfunctions.py +2 -2
  3. taxcalc/calculator.py +4 -4
  4. taxcalc/cli/tc.py +16 -19
  5. taxcalc/data.py +2 -3
  6. taxcalc/decorators.py +9 -8
  7. taxcalc/growfactors.py +2 -1
  8. taxcalc/policy.py +6 -23
  9. taxcalc/policy_current_law.json +31 -631
  10. taxcalc/records.py +78 -82
  11. taxcalc/records_variables.json +106 -106
  12. taxcalc/reforms/ARPA.out.csv +9 -9
  13. taxcalc/taxcalcio.py +101 -77
  14. taxcalc/tests/conftest.py +20 -15
  15. taxcalc/tests/puf_var_correl_coeffs_2016.csv +24 -24
  16. taxcalc/tests/puf_var_wght_means_by_year.csv +11 -11
  17. taxcalc/tests/pufcsv_agg_expect.csv +20 -20
  18. taxcalc/tests/pufcsv_mtr_expect.txt +21 -21
  19. taxcalc/tests/reforms.json +3 -1
  20. taxcalc/tests/reforms_expect.csv +54 -54
  21. taxcalc/tests/test_4package.py +8 -9
  22. taxcalc/tests/test_calculator.py +55 -18
  23. taxcalc/tests/test_consumption.py +2 -2
  24. taxcalc/tests/test_cpscsv.py +2 -24
  25. taxcalc/tests/test_data.py +11 -3
  26. taxcalc/tests/test_decorators.py +57 -52
  27. taxcalc/tests/test_growdiff.py +2 -2
  28. taxcalc/tests/test_parameters.py +101 -53
  29. taxcalc/tests/test_policy.py +154 -154
  30. taxcalc/tests/test_records.py +144 -9
  31. taxcalc/tests/test_reforms.py +104 -104
  32. taxcalc/tests/test_taxcalcio.py +13 -62
  33. taxcalc/utils.py +3 -3
  34. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/METADATA +3 -6
  35. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/RECORD +39 -46
  36. taxcalc/puf_ratios.csv +0 -26
  37. taxcalc/puf_weights.csv.gz +0 -0
  38. taxcalc/reforms/clp.out.csv +0 -10
  39. taxcalc/tests/test_compare.py +0 -330
  40. taxcalc/tests/test_compatible_data.py +0 -334
  41. taxcalc/tests/test_puf_var_stats.py +0 -194
  42. taxcalc/tests/test_pufcsv.py +0 -328
  43. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/WHEEL +0 -0
  44. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/entry_points.txt +0 -0
  45. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/licenses/LICENSE +0 -0
  46. {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  ,description,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024
2
- c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60318, 61591, 63130, 73017, 72054, 72247, 79575
2
+ c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60318, 61591, 63130, 73018, 72054, 72247, 79575
3
3
  c02500,OASDI benefits in AGI, 1295, 1394, 1416, 1479, 1501, 1587, 1690, 1832, 2005, 2128, 2402, 2686
4
- c04470,Post-phase-out itemized deduction, 5907, 6036, 6149, 6382, 6562, 6798, 7003, 7480, 7870, 8006, 8419, 8785
4
+ c04470,Post-phase-out itemized deduction, 5909, 6037, 6150, 6383, 6563, 6797, 7001, 7479, 7870, 8005, 8417, 8783
5
5
  c04600,Post-phase-out personal exemption, 7105, 7131, 7163, 7217, 7149, 7280, 7448, 7574, 7621, 7989, 8661, 9047
6
- c04800,Federal regular taxable income, 35754, 39297, 39664, 39592, 42568, 44486, 45340, 46361, 55796, 54215, 53036, 59734
6
+ c04800,Federal regular taxable income, 35754, 39298, 39664, 39591, 42568, 44486, 45340, 46361, 55796, 54215, 53036, 59733
7
7
  c05200,Regular tax on taxable income, 7672, 8732, 8725, 8585, 9500, 9984, 10102, 10421, 13279, 12406, 11654, 13635
8
8
  c07180,Child care credit, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17
9
- c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 128, 123, 359, 114, 105, 98
9
+ c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 128, 123, 360, 114, 105, 98
10
10
  c09600,Federal AMT liability, 212, 227, 240, 251, 268, 279, 286, 315, 347, 334, 344, 361
11
11
  c11070,Extra child tax credit (refunded), 150, 144, 138, 133, 126, 123, 120, 121, 0, 110, 113, 111
12
12
  c21040,Itemized deduction that is phased out, 203, 242, 231, 219, 255, 270, 270, 283, 375, 342, 302, 380
@@ -53,22 +53,22 @@ e18400,Itemizable state and local income/sales taxes, 1669, 1768, 1803,
53
53
  e18500,Itemizable real-estate taxes paid, 1145, 1200, 1251, 1298, 1358, 1409, 1449, 1545, 1642, 1663, 1750, 1851
54
54
  e19200,Itemizable interest paid, 1878, 1841, 1817, 1844, 1884, 1965, 2032, 2177, 2327, 2368, 2504, 2662
55
55
  e19800,Itemizable charitable giving: cash/check contributions. WARNING: this variable is already capped in PUF data., 887, 932, 951, 979, 1018, 1054, 1082, 1153, 1226, 1242, 1307, 1381
56
- e20100,Itemizable charitable giving: other than cash/check contributions. WARNING: this variable is already capped in PUF data., 224, 235, 233, 239, 245, 253, 260, 276, 293, 296, 311, 328
57
- e20400,Itemizable miscellaneous deductions. WARNING: this variable is zero below the floor in PUF data., 713, 740, 759, 786, 811, 838, 860, 912, 967, 976, 1023, 1076
56
+ e20100,Itemizable charitable giving: other than cash/check contributions. WARNING: this variable is already capped in PUF data., 224, 235, 233, 239, 245, 253, 259, 276, 293, 296, 311, 328
57
+ e20400,Itemizable miscellaneous deductions. WARNING: this variable is zero below the floor in PUF data., 713, 740, 759, 786, 811, 838, 860, 912, 967, 975, 1023, 1076
58
58
  e24515,Sch D: Un-Recaptured Section 1250 Gain, 79, 110, 112, 100, 137, 147, 136, 176, 315, 193, 141, 200
59
59
  e24518,Sch D: 28% Rate Gain or Loss, 24, 34, 34, 30, 39, 41, 38, 49, 87, 53, 39, 56
60
- e26270,Sch E: Combined partnership and S-corporation net income/loss (includes k1bx14p and k1bx14s amounts and is included in e02000), 2741, 2969, 3037, 2995, 3222, 3424, 3455, 3244, 3910, 4062, 3520, 5112
60
+ e26270,Sch E: Combined partnership and S-corporation net income/loss (includes k1bx14p and k1bx14s amounts and is included in e02000), 2741, 2969, 3037, 2995, 3222, 3424, 3455, 3243, 3910, 4062, 3520, 5112
61
61
  e27200,Sch E: Farm rent net income or loss (included in e02000), 35, 37, 38, 39, 44, 47, 49, 47, 58, 62, 55, 80
62
62
  e32800,Child/dependent-care expenses for qualifying persons from Form 2441, 108, 111, 113, 114, 118, 121, 123, 130, 137, 137, 143, 150
63
63
  e58990,Investment income elected amount from Form 4952, 14, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21
64
64
  e62900,Alternative Minimum Tax foreign tax credit from Form 6251, 78, 86, 84, 84, 90, 93, 95, 100, 106, 107, 112, 118
65
65
  e87521,Total tentative AmOppCredit amount for all students, 172, 176, 182, 184, 191, 197, 201, 213, 225, 227, 237, 249
66
66
  e87530,Adjusted qualified lifetime learning expenses for all students, 93, 92, 94, 96, 99, 102, 105, 111, 117, 118, 124, 130
67
- eitc,Federal EITC, 376, 369, 364, 352, 342, 343, 346, 355, 335, 348, 387, 399
67
+ eitc,Federal EITC, 376, 369, 364, 352, 342, 343, 347, 355, 335, 348, 387, 399
68
68
  elderly_dependents,number of dependents age 65+ in filing unit excluding taxpayer and spouse, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
69
69
  g20500,Itemizable gross (before 10% AGI disregard) casualty or theft loss, 29, 30, 31, 32, 33, 35, 36, 38, 40, 41, 43, 45
70
70
  iitax,Federal income tax liability, 6826, 7765, 7820, 7778, 8605, 9072, 9252, 6827, 9422, 11409, 10888, 12600
71
- k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -139, -133, -129, -156, -168, -146, -211
71
+ k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -139, -133, -129, -156, -168, -147, -211
72
72
  k1bx14s,Partner self-employment earnings/loss for spouse (included in e26270 total), -7, -9, 0, 2, 8, 10, 11, 11, 13, 14, 11, 17
73
73
  nu06,Number of dependents under 6 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
74
74
  nu13,Number of dependents under 13 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -76,5 +76,5 @@ p08000,Other tax credits (but not including Sch R credit), 1, 1,
76
76
  p22250,Sch D: Net short-term capital gains/losses, -120, -173, -172, -151, -195, -212, -202, -267, -481, -300, -223, -316
77
77
  p23250,Sch D: Net long-term capital gains/losses, 2284, 3191, 3138, 2776, 3680, 3912, 3596, 4616, 8212, 5011, 3634, 5193
78
78
  payrolltax,Payroll taxes (ee+er) for OASDI+HI, 4917, 5091, 5141, 5215, 5352, 5497, 5667, 5696, 6069, 6441, 6728, 7035
79
- pencon_p,Contributions to defined-contribution pension plans for taxpayer, 856, 897, 916, 941, 963, 996, 1029, 1030, 1107, 1185, 1229, 1286
80
- pencon_s,Contributions to defined-contribution pension plans for spouse, 393, 410, 421, 424, 440, 452, 466, 466, 500, 535, 554, 579
79
+ pencon_p,Contributions to defined-contribution pension plans for taxpayer, 858, 900, 918, 943, 965, 999, 1032, 1033, 1110, 1188, 1233, 1291
80
+ pencon_s,Contributions to defined-contribution pension plans for spouse, 390, 407, 419, 423, 438, 451, 465, 465, 499, 534, 553, 578
@@ -1,26 +1,26 @@
1
1
  ,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035
2
- Returns (#m),190.9,194.3,197.3,200.1,202.9,205.6,208.4,211.2,214.0,216.8,219.5,222.2,224.8,227.4,229.8,229.8,235.7,238.2,240.7
3
- AGI ($b),11078.7,11816.6,12247.2,12722.3,14930.0,14939.1,15160.9,16963.9,17819.4,18520.2,19183.5,19911.8,20689.6,21516.3,22393.3,23307.3,24244.7,25218.0,26229.5
4
- Itemizers (#m),45.7,19.4,20.0,21.0,22.6,22.8,21.8,21.6,25.9,24.0,24.7,25.6,26.5,19.2,19.7,20.2,20.2,20.7,21.1
5
- Itemized Deduction ($b),1274.1,602.6,633.8,692.2,761.9,782.7,795.0,829.9,1148.0,1063.2,1125.4,1196.7,1272.4,858.1,898.4,943.2,972.9,1017.4,1063.4
6
- Standard Deduction Filers (#m),145.2,174.8,177.2,178.5,179.6,182.8,186.5,189.5,188.0,192.3,194.3,196.0,197.8,207.6,209.5,209.1,214.8,216.9,219.0
7
- Standard Deduction ($b),1239.3,2865.3,2954.5,3025.8,3081.1,3234.0,3533.8,3787.3,4014.3,4232.2,4378.6,4517.8,4658.7,5065.2,5227.3,5328.6,5592.0,5770.6,5954.0
2
+ Returns (#m),190.9,194.3,197.3,200.1,202.9,205.6,208.4,211.2,214.0,216.8,219.5,222.2,224.8,227.4,229.8,230.0,235.7,238.2,240.7
3
+ AGI ($b),11078.7,11816.6,12247.2,12722.3,14930.0,14939.1,15161.0,16964.0,17819.5,18520.2,19183.5,19911.8,20689.6,21516.4,22393.3,23307.3,24244.7,25218.0,26229.5
4
+ Itemizers (#m),45.7,19.4,20.0,21.0,22.6,22.8,21.8,21.6,25.9,24.0,24.7,25.6,26.5,19.3,19.7,20.2,20.3,20.7,21.1
5
+ Itemized Deduction ($b),1274.4,602.5,633.7,692.3,761.4,782.8,794.9,829.6,1148.5,1063.4,1125.8,1196.9,1273.4,858.4,898.9,943.8,973.9,1018.2,1063.9
6
+ Standard Deduction Filers (#m),145.2,174.8,177.2,178.5,179.6,182.8,186.6,189.5,188.0,192.3,194.3,196.0,197.8,207.6,209.5,209.2,214.8,216.9,219.0
7
+ Standard Deduction ($b),1239.1,2865.4,2954.6,3025.7,3081.5,3233.9,3534.0,3787.5,4013.8,4232.0,4378.4,4517.7,4657.6,5064.9,5226.6,5331.9,5591.1,5769.8,5953.2
8
8
  Personal Exemption ($b),1365.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
9
- Taxable Income ($b),8112.4,9179.3,9520.6,9907.3,12003.2,11891.1,11879.2,13486.3,13765.7,14348.6,14843.1,15400.8,16166.7,17042.4,17755.3,18502.9,19289.5,20080.9,20904.4
10
- Regular Tax ($b),1656.8,1712.3,1778.2,1838.3,2281.5,2275.4,2228.2,2589.0,2646.4,2778.1,2867.9,2969.8,3103.8,3281.3,3417.2,3553.6,3745.8,3898.9,4057.1
11
- AMT Income ($b),10512.6,11343.6,11749.8,12180.2,14330.8,14321.2,14527.8,16287.7,17079.8,17847.5,18471.0,19156.5,19884.7,20785.8,21618.9,22494.2,23414.3,24344.5,25308.5
12
- AMT Liability ($b),51.3,22.1,23.0,25.1,27.8,27.4,28.7,31.2,32.9,35.5,36.9,38.5,40.4,41.9,42.4,45.1,48.1,50.2,51.9
9
+ Taxable Income ($b),8112.3,9179.3,9520.6,9907.3,12003.2,11891.1,11879.2,13486.4,13765.9,14348.6,14843.3,15401.0,16166.8,17042.4,17755.4,18502.9,19289.6,20081.0,20904.6
10
+ Regular Tax ($b),1656.8,1712.3,1778.2,1838.3,2281.5,2275.4,2228.2,2589.0,2646.5,2778.1,2868.0,2969.8,3103.8,3281.3,3417.2,3553.6,3745.8,3898.9,4057.2
11
+ AMT Income ($b),10512.4,11343.7,11750.0,12180.2,14331.2,14321.1,14527.9,16287.9,17079.5,17847.3,18470.5,19156.2,19884.1,20785.6,21618.5,22493.8,23413.5,24343.8,25308.1
12
+ AMT Liability ($b),51.3,22.1,23.0,25.1,27.8,27.4,28.7,31.2,32.9,35.6,36.9,38.5,40.4,41.9,42.4,45.1,48.1,50.2,51.9
13
13
  AMT Filers (#m),5.7,0.2,0.2,0.3,0.4,0.3,0.2,0.3,0.3,0.4,0.4,0.4,0.3,0.3,0.3,0.4,0.4,0.4,0.4
14
- Tax before Credits ($b),1708.1,1734.4,1801.2,1863.4,2309.4,2302.8,2256.9,2620.2,2679.4,2813.6,2904.8,3008.4,3144.1,3323.2,3459.6,3598.7,3793.9,3949.1,4109.0
15
- Refundable Credits ($b),102.9,117.5,118.5,642.0,802.6,119.2,128.4,133.4,139.6,142.7,146.1,149.4,152.6,156.1,159.7,162.8,168.1,172.3,176.2
16
- Nonrefundable Credits ($b),67.0,127.3,129.2,128.5,47.6,141.0,137.8,148.6,154.8,158.6,161.3,163.8,166.9,170.5,173.9,177.6,182.6,186.8,190.7
14
+ Tax before Credits ($b),1708.1,1734.4,1801.2,1863.4,2309.4,2302.8,2256.9,2620.2,2679.4,2813.6,2904.8,3008.4,3144.1,3323.2,3459.6,3598.7,3793.9,3949.1,4109.1
15
+ Refundable Credits ($b),102.9,117.5,118.5,642.0,802.7,119.2,128.4,133.4,139.6,142.7,146.2,149.4,152.7,156.1,159.7,162.8,168.1,172.3,176.2
16
+ Nonrefundable Credits ($b),67.0,127.3,129.2,128.5,47.6,141.0,137.8,148.6,154.7,158.6,161.3,163.8,166.9,170.5,173.9,177.7,182.6,186.8,190.7
17
17
  Reform Surtaxes ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
18
18
  Other Taxes ($b),101.9,110.3,110.9,122.1,159.4,139.1,133.5,157.8,166.9,172.1,177.0,183.5,191.0,199.5,208.7,219.3,227.8,239.2,251.4
19
- Ind Income Tax ($b),1640.1,1599.8,1664.4,1215.0,1618.5,2181.8,2124.2,2495.9,2552.0,2684.5,2774.4,2878.6,3015.6,3196.0,3334.8,3477.6,3670.9,3829.2,3993.6
20
- Payroll Taxes ($b),1021.9,1067.9,1118.1,1139.7,1231.5,1324.7,1402.2,1485.7,1559.3,1632.0,1702.2,1774.7,1848.5,1923.1,2000.3,2080.8,2154.2,2237.7,2324.6
21
- Combined Liability ($b),2662.0,2667.7,2782.4,2354.8,2850.0,3506.5,3526.4,3981.7,4111.2,4316.5,4476.7,4653.2,4864.1,5119.2,5335.1,5558.3,5825.1,6066.9,6318.2
22
- With Income Tax <= 0 (#m),88.5,94.0,95.1,129.1,122.6,95.7,97.8,98.3,102.3,103.2,104.0,104.8,103.8,104.4,104.8,102.6,107.8,108.3,108.8
23
- With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.1,94.5,68.9,70.7,71.3,74.1,75.0,75.9,76.8,76.3,77.0,77.5,75.7,79.9,80.5,81.0
19
+ Ind Income Tax ($b),1640.1,1599.8,1664.4,1215.0,1618.5,2181.8,2124.2,2495.9,2552.0,2684.5,2774.5,2878.6,3015.6,3196.0,3334.8,3477.5,3670.9,3829.2,3993.6
20
+ Payroll Taxes ($b),1021.8,1067.8,1118.0,1139.7,1231.5,1324.7,1402.2,1485.7,1559.3,1632.0,1702.3,1774.7,1848.5,1923.2,2000.3,2080.8,2154.2,2237.7,2324.6
21
+ Combined Liability ($b),2661.9,2667.6,2782.4,2354.7,2849.9,3506.5,3526.4,3981.7,4111.2,4316.5,4476.7,4653.3,4864.1,5119.2,5335.1,5558.4,5825.1,6067.0,6318.2
22
+ With Income Tax <= 0 (#m),88.5,94.0,95.1,129.1,122.6,95.7,97.8,98.3,102.3,103.2,104.0,104.8,103.8,104.4,104.8,102.8,107.8,108.3,108.8
23
+ With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.0,94.5,68.9,70.7,71.3,74.1,75.0,75.9,76.8,76.3,77.0,77.5,75.9,79.9,80.5,81.0
24
24
  UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
25
- "Total Benefits, Consumption Value ($b)",1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1703.5,1817.8,1924.3,2032.5,2147.0,2263.7,2381.5,2499.5,2545.8,2770.9,2898.1,3029.6
26
- Total Benefits Cost ($b),1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1703.5,1817.8,1924.3,2032.5,2147.0,2263.7,2381.5,2499.5,2545.8,2770.9,2898.1,3029.6
25
+ "Total Benefits, Consumption Value ($b)",1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1703.5,1817.8,1924.3,2032.5,2147.0,2263.7,2381.5,2499.5,2549.6,2770.9,2898.1,3029.6
26
+ Total Benefits Cost ($b),1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1703.5,1817.8,1924.3,2032.5,2147.0,2263.7,2381.5,2499.5,2549.6,2770.9,2898.1,3029.6
@@ -5,59 +5,59 @@ PTAX mtr histogram bin edges:
5
5
  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
- 252868 : 0 27604 0 0 0 0 0 225264 0 0
9
- 252868 : 7375 73 2056 13084 45744 76630 50857 31265 25017 767
8
+ 252868 : 0 27589 0 0 0 0 0 225279 0 0
9
+ 252868 : 7375 73 2056 13092 45752 76594 50874 31261 25021 770
10
10
  PTAX and ITAX mtr histogram bin counts for e00200s:
11
- 119177 : 0 19575 0 0 0 0 0 99602 0 0
12
- 119177 : 1449 22 793 2752 11456 31297 26219 22344 22285 560
11
+ 119177 : 0 19601 0 0 0 0 0 99576 0 0
12
+ 119177 : 1449 22 792 2760 11456 31293 26220 22338 22285 562
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 42865 71246 52250 30592 31272 4096
15
+ 252868 : 6835 305 1552 11868 42851 71250 52249 30574 31283 4101
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 67629 76854 46561 31869 29137 818
18
+ 252868 : 0 0 0 0 67638 76842 46566 31860 29142 820
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
- 252868 : 0 0 0 0 249271 3332 262 3 0 0
21
+ 252868 : 0 0 0 0 249270 3332 264 2 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 67629 76854 46561 31869 29137 818
24
+ 252868 : 0 0 0 0 67638 76842 46566 31860 29142 820
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 5 62 145112 46819 59773 658 412 27
27
+ 252868 : 0 0 5 62 145111 46818 59777 655 414 26
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 67630 76881 50252 32349 24978 778
30
+ 252868 : 0 0 0 0 67639 76869 50256 32344 24980 780
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 67630 76881 50252 32349 24978 778
33
+ 252868 : 0 0 0 0 67639 76869 50256 32344 24980 780
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 67629 76854 46561 31869 29137 818
36
+ 252868 : 0 0 0 0 67638 76842 46566 31860 29142 820
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 114130 44782 59366 33592 965 33
39
+ 252868 : 0 0 0 0 114131 44785 59359 33593 967 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 79195 76757 53030 24966 18408 510
42
+ 252868 : 0 0 1 1 79203 76747 53033 24962 18409 512
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 48 152420 43642 51311 2837 2560 49
45
+ 252868 : 0 0 1 48 152419 43642 51315 2833 2562 48
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 : 25489 25944 19603 7736 174096 0 0 0 0 0
48
+ 252868 : 25486 25946 19626 7738 174072 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 : 39723 32895 19901 4939 155410 0 0 0 0 0
51
+ 252868 : 39721 32896 19923 4941 155387 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 67630 76881 50252 32349 24978 778
54
+ 252868 : 0 0 0 0 67639 76869 50256 32344 24980 780
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 : 39575 32461 19826 4910 156096 0 0 0 0 0
57
+ 252868 : 39573 32462 19847 4913 156073 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 : 39490 32426 19767 4904 156281 0 0 0 0 0
60
+ 252868 : 39488 32427 19788 4907 156258 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 42865 71246 52250 30592 31272 4096
63
+ 252868 : 6835 305 1552 11868 42851 71250 52249 30574 31283 4101
@@ -504,7 +504,9 @@
504
504
  "start_year": 2017,
505
505
  "value": {"FST_AGI_trt": 0.3,
506
506
  "FST_AGI_thd_lo": [1.0e6, 1.0e6, 0.5e6, 1.0e6, 1.0e6],
507
- "FST_AGI_thd_hi": [2.0e6, 2.0e6, 1.0e6, 2.0e6, 2.0e6]},
507
+ "FST_AGI_thd_lo-indexed": true,
508
+ "FST_AGI_thd_hi": [2.0e6, 2.0e6, 1.0e6, 2.0e6, 2.0e6],
509
+ "FST_AGI_thd_hi-indexed": true},
508
510
  "name": "Increase FST rate from zero to 0.30 beginning in 2017",
509
511
  "output_type": "iitax",
510
512
  "compare_with": {"Tax Foundation": [321, "ten-year(2016-25)",
@@ -1,61 +1,61 @@
1
1
  rid,res1,res2,res3,res4
2
- 1,60.8,61.9,64.9,67.6
3
- 2,50.4,54.6,49.5,57.2
4
- 3,73.3,74.5,78.4,82.2
2
+ 1,61.2,61.7,65.1,70.4
3
+ 2,43.5,45.9,43.1,52.8
4
+ 3,67.7,68.3,72.1,81.1
5
5
  4,0.0,0.0,0.0,0.0
6
6
  5,0.0,0.0,0.0,0.0
7
- 6,37.9,37.8,39.4,40.7
8
- 7,7.2,7.4,7.5,7.9
9
- 8,1.9,1.9,2.1,2.2
10
- 9,3.8,3.8,4.2,4.6
11
- 10,6.7,7.1,7.4,7.7
12
- 11,3.1,3.3,3.6,3.8
13
- 12,0.1,0.1,0.1,0.1
14
- 13,-33.2,-32.0,-34.7,-36.1
15
- 14,-0.1,-0.1,-0.1,-0.1
16
- 15,0.1,0.1,0.1,0.2
17
- 16,-1.0,-1.0,-1.5,-1.6
7
+ 6,33.1,34.1,35.9,41.4
8
+ 7,6.8,7.0,7.7,10.7
9
+ 8,1.8,1.9,2.0,2.3
10
+ 9,5.6,5.7,5.6,7.6
11
+ 10,5.6,5.8,6.4,6.1
12
+ 11,0.0,0.0,0.0,0.0
13
+ 12,0.0,0.0,0.0,0.0
14
+ 13,-34.5,-33.0,-36.1,-38.0
15
+ 14,-0.1,-0.1,-0.1,-0.2
16
+ 15,0.5,0.4,0.3,0.5
17
+ 16,-0.7,-0.8,-1.1,-1.2
18
18
  17,-0.2,-0.2,-0.3,-0.3
19
- 18,33.4,34.7,37.1,39.3
20
- 19,63.8,65.5,70.8,76.0
21
- 20,97.9,101.5,109.4,115.8
22
- 21,65.9,67.8,72.8,76.8
23
- 22,9.7,10.3,10.6,11.2
24
- 23,0.5,0.6,0.6,0.6
25
- 24,50.4,52.6,55.8,59.3
26
- 25,1.9,2.0,2.1,2.2
27
- 26,0.1,0.1,0.1,0.1
28
- 27,0.1,0.1,0.1,0.1
29
- 28,3.8,3.7,4.2,4.6
30
- 29,14.7,13.3,17.2,18.6
31
- 30,-6.6,-6.4,-1.6,-1.6
32
- 31,57.4,57.9,61.8,65.4
33
- 32,12.0,11.5,13.3,14.4
34
- 33,7.5,7.1,8.3,9.0
35
- 34,-1.2,-0.9,-1.5,-1.6
36
- 35,-2.9,-2.8,-3.5,-3.7
37
- 36,3.1,3.2,3.6,3.9
38
- 37,29.8,30.9,34.1,36.2
39
- 38,9.2,9.6,10.5,11.3
40
- 39,-0.6,-0.5,-0.7,-0.7
41
- 40,54.0,52.3,51.2,50.2
42
- 41,0.5,0.6,0.6,0.6
19
+ 18,26.8,27.3,30.0,33.1
20
+ 19,78.5,79.4,87.3,96.4
21
+ 20,64.9,66.7,73.7,84.8
22
+ 21,39.6,40.8,45.0,52.8
23
+ 22,8.9,9.9,9.6,10.8
24
+ 23,0.0,0.0,0.0,0.0
25
+ 24,34.4,35.5,38.0,42.8
26
+ 25,1.5,1.5,1.6,1.8
27
+ 26,0.0,0.1,0.1,0.1
28
+ 27,0.1,0.1,0.1,0.2
29
+ 28,0.5,0.4,0.5,1.6
30
+ 29,22.4,20.9,25.3,27.0
31
+ 30,-3.2,-3.1,-0.8,-0.8
32
+ 31,53.7,54.2,57.4,66.2
33
+ 32,7.9,7.8,8.6,13.6
34
+ 33,3.9,3.8,4.3,6.8
35
+ 34,-0.5,-0.4,-0.8,-0.9
36
+ 35,-1.2,-1.1,-1.7,-1.9
37
+ 36,1.5,1.5,2.1,2.6
38
+ 37,15.8,16.2,18.9,25.1
39
+ 38,3.3,3.3,4.0,5.8
40
+ 39,-0.3,-0.2,-0.3,-0.4
41
+ 40,52.0,50.6,49.4,55.3
42
+ 41,0.4,0.4,0.5,0.6
43
43
  42,-0.2,-0.2,-0.2,-0.2
44
- 43,70.6,68.8,67.9,69.4
45
- 44,1.2,1.1,1.1,1.2
46
- 45,-2.1,-2.0,-2.2,-2.2
47
- 46,-2.1,-1.8,-2.1,-2.2
48
- 47,-0.8,-0.8,-0.8,-0.7
44
+ 43,59.1,57.4,52.5,68.5
45
+ 44,1.3,1.2,1.2,1.5
46
+ 45,-2.1,-2.0,-2.1,-2.6
47
+ 46,-2.0,-1.7,-1.9,-2.4
48
+ 47,-0.9,-0.8,-0.7,-0.9
49
49
  48,-0.0,-0.0,-0.0,-0.0
50
- 49,-26.5,-23.7,-31.1,-33.9
51
- 50,-0.3,-0.3,-0.5,-0.5
52
- 51,-187.0,-187.5,-193.6,-201.6
53
- 52,-130.0,-129.3,-132.7,-137.7
54
- 53,30.7,33.2,31.4,41.0
50
+ 49,-37.3,-36.0,-40.4,-44.7
51
+ 50,-0.1,-0.1,-0.1,-0.1
52
+ 51,-184.8,-185.3,-189.7,-206.8
53
+ 52,-129.7,-129.6,-131.1,-143.6
54
+ 53,3.5,3.9,2.9,5.6
55
55
  54,0.0,0.0,0.0,0.0
56
- 55,-66.9,-66.9,-67.0,-67.1
57
- 56,-67.3,-67.2,-67.3,-67.4
58
- 57,-1.0,-0.6,-0.8,-1.7
59
- 58,-17.4,-18.0,-24.3,-20.0
60
- 59,-12.7,-13.0,-23.4,-13.8
61
- 60,-46.9,-48.1,-49.2,-52.0
56
+ 55,-65.5,-71.9,-72.4,-72.5
57
+ 56,-66.6,-73.3,-73.8,-73.9
58
+ 57,-23.7,-25.7,-26.9,-28.5
59
+ 58,-25.5,-26.4,-33.6,-28.8
60
+ 59,-51.2,-52.9,-60.1,-52.3
61
+ 60,-51.7,-53.2,-54.4,-57.5
@@ -66,9 +66,9 @@ def test_for_consistency(tests_path):
66
66
  'pycodestyle',
67
67
  'pylint',
68
68
  'coverage',
69
- "pip",
70
- "jupyter-book",
71
- "setuptools"
69
+ 'pip',
70
+ 'jupyter-book',
71
+ 'setuptools'
72
72
  ])
73
73
  # read conda.recipe/meta.yaml requirements
74
74
  meta_file = os.path.join(tests_path, '..', '..',
@@ -86,10 +86,10 @@ def test_for_consistency(tests_path):
86
86
  envr = yaml.safe_load(stream)
87
87
 
88
88
  env = []
89
- for dep in envr["dependencies"]:
89
+ for dep in envr['dependencies']:
90
90
  if isinstance(dep, dict):
91
- assert list(dep.keys()) == ["pip"]
92
- env += dep["pip"]
91
+ assert list(dep.keys()) == ['pip']
92
+ env += dep['pip']
93
93
  else:
94
94
  env.append(dep)
95
95
  env = set(env)
@@ -102,9 +102,8 @@ def test_for_consistency(tests_path):
102
102
  with open(setup_file, 'r', encoding='utf-8') as f:
103
103
  setup_py_content = f.read()
104
104
  setup = set(extract_install_requires(setup_py_content))
105
- # confirm that setup.py
106
- print("Setup packages = ", setup)
107
- print("Meta packages = ", bld)
105
+ print('Setup packages = ', setup)
106
+ print('Meta packages = ', bld)
108
107
  # if package in both, confirm that the version is the same
109
108
  for pkg in setup.intersection(bld):
110
109
  assert pkg in setup
@@ -319,7 +319,7 @@ def test_calculator_using_nonstd_input():
319
319
 
320
320
  def test_bad_json_names(tests_path):
321
321
  """
322
- Test that ValueError raised with assump or reform do not end in '.json'
322
+ Test that ValueError raised with assump or reform do not end in ".json"
323
323
  """
324
324
  test_url = (
325
325
  'https://raw.githubusercontent.com/PSLmodels/'
@@ -418,9 +418,11 @@ def test_json_assump_url():
418
418
  }
419
419
  }
420
420
  """
421
- assump_url = ('https://raw.githubusercontent.com/PSLmodels/'
422
- 'Tax-Calculator/master/taxcalc/assumptions/'
423
- 'economic_assumptions_template.json')
421
+ assump_url = (
422
+ 'https://raw.githubusercontent.com/PSLmodels/'
423
+ 'Tax-Calculator/master/taxcalc/assumptions/'
424
+ 'economic_assumptions_template.json'
425
+ )
424
426
  params_str = Calculator.read_json_param_objects(None, assump_str)
425
427
  assert params_str
426
428
  params_url = Calculator.read_json_param_objects(None, assump_url)
@@ -428,8 +430,8 @@ def test_json_assump_url():
428
430
  assert params_url == params_str
429
431
 
430
432
  assump_gh_url = (
431
- "github://PSLmodels:Tax-Calculator@master/taxcalc/assumptions/"
432
- "economic_assumptions_template.json"
433
+ 'github://PSLmodels:Tax-Calculator@master/taxcalc/assumptions/'
434
+ 'economic_assumptions_template.json'
433
435
  )
434
436
  params_gh_url = Calculator.read_json_param_objects(None, assump_gh_url)
435
437
  assert params_gh_url
@@ -690,8 +692,6 @@ def test_ce_aftertax_income(cps_subsample):
690
692
 
691
693
 
692
694
  @pytest.mark.itmded_vars
693
- @pytest.mark.pre_release
694
- @pytest.mark.requires_pufcsv
695
695
  @pytest.mark.parametrize('year, cvname, hcname',
696
696
  [(2018, 'c17000', 'ID_Medical_hc'),
697
697
  (2018, 'c18300', 'ID_AllTaxes_hc'),
@@ -705,7 +705,7 @@ def test_ce_aftertax_income(cps_subsample):
705
705
  (2017, 'c19700', 'ID_Charity_hc'),
706
706
  (2017, 'c20500', 'ID_Casualty_hc'),
707
707
  (2017, 'c20800', 'ID_Miscellaneous_hc')])
708
- def test_itemded_component_amounts(year, cvname, hcname, puf_fullsample):
708
+ def test_itemded_component_amounts(year, cvname, hcname, cps_fullsample):
709
709
  """
710
710
  Check that all c04470 components are adjusted to reflect the filing
711
711
  unit's standard-vs-itemized-deduction decision. Check for 2018
@@ -718,7 +718,7 @@ def test_itemded_component_amounts(year, cvname, hcname, puf_fullsample):
718
718
  here use c21060, instead of c04470, as the itemized deductions total.
719
719
  """
720
720
  # pylint: disable=too-many-locals
721
- recs = Records(data=puf_fullsample)
721
+ recs = Records.cps_constructor(data=cps_fullsample)
722
722
  # policy1 such that everybody itemizes deductions and all are allowed
723
723
  policy1 = Policy()
724
724
  reform1 = {
@@ -821,9 +821,9 @@ def test_qbid_calculation():
821
821
 
822
822
 
823
823
  def test_calc_all_benefits_amounts(cps_subsample):
824
- '''
824
+ """
825
825
  Testing how benefits are handled in the calc_all method
826
- '''
826
+ """
827
827
  # set a reform with a positive UBI amount
828
828
  ubi_ref = {'UBI_21': {2020: 1000}}
829
829
 
@@ -865,14 +865,18 @@ def test_cg_top_rate():
865
865
  cy = 2019
866
866
 
867
867
  # set NIIT and STD to zero to isolate CG tax rates
868
- base = {"NIIT_rt": {2019: 0},
869
- "STD": {2019: [0, 0, 0, 0, 0]}}
868
+ base = {
869
+ 'NIIT_rt': {2019: 0},
870
+ 'STD': {2019: [0, 0, 0, 0, 0]}
871
+ }
870
872
 
871
873
  # create additional top CG bracket and rate
872
- ref = {"CG_brk3": {2019: [1000000, 1000000, 1000000, 1000000, 1000000]},
873
- "CG_rt4": {2019: 0.4},
874
- "NIIT_rt": {2019: 0},
875
- "STD": {2019: [0, 0, 0, 0, 0]}}
874
+ ref = {
875
+ 'CG_brk3': {2019: [1000000, 1000000, 1000000, 1000000, 1000000]},
876
+ 'CG_rt4': {2019: 0.4},
877
+ 'NIIT_rt': {2019: 0},
878
+ 'STD': {2019: [0, 0, 0, 0, 0]}
879
+ }
876
880
 
877
881
  # create one record just below the top CG bracket and one just above
878
882
  VARS = 'RECID,MARS,p23250\n'
@@ -919,3 +923,36 @@ def test_cg_top_rate():
919
923
  # check that MTR of household above top threshold is equal to
920
924
  # CG_rt4
921
925
  assert np.allclose(mtr_itax_ref[1], cg_rt4_ref)
926
+
927
+
928
+ def test_credit_reforms(cps_subsample):
929
+ """
930
+ Test personal credit reforms using cps.csv subsample
931
+ """
932
+ rec = Records.cps_constructor(data=cps_subsample)
933
+ reform_year = 2017
934
+ # create current-law Calculator object, calc1
935
+ pol = Policy()
936
+ calc1 = Calculator(policy=pol, records=rec)
937
+ calc1.advance_to_year(reform_year)
938
+ calc1.calc_all()
939
+ itax1 = calc1.weighted_total('iitax')
940
+ # create personal-refundable-credit-reform Calculator object, calc2
941
+ reform = {'II_credit': {reform_year: [1000, 1000, 1000, 1000, 1000]}}
942
+ pol.implement_reform(reform)
943
+ calc2 = Calculator(policy=pol, records=rec)
944
+ calc2.advance_to_year(reform_year)
945
+ calc2.calc_all()
946
+ itax2 = calc2.weighted_total('iitax')
947
+ # create personal-nonrefundable-credit-reform Calculator object, calc3
948
+ reform = {'II_credit_nr': {reform_year: [1000, 1000, 1000, 1000, 1000]}}
949
+ pol = Policy()
950
+ pol.implement_reform(reform)
951
+ calc3 = Calculator(policy=pol, records=rec)
952
+ calc3.advance_to_year(reform_year)
953
+ calc3.calc_all()
954
+ itax3 = calc3.weighted_total('iitax')
955
+ # check income tax revenues generated by the three Calculator objects
956
+ assert itax2 < itax1 # because refundable credits lower revenues
957
+ assert itax3 > itax2 # because nonrefundable credits lower revenues less
958
+ assert itax3 < itax1 # because nonrefundable credits lower revenues some
@@ -119,9 +119,9 @@ def test_consumption_default_data():
119
119
  pdata = consump.specification(meta_data=True, ignore_state=True)
120
120
  for pname in pdata.keys():
121
121
  if pname.startswith('MPC'):
122
- assert pdata[pname]['value'] == [{"value": 0.0, "year": 2013}]
122
+ assert pdata[pname]['value'] == [{'value': 0.0, 'year': 2013}]
123
123
  elif pname.startswith('BEN'):
124
- assert pdata[pname]['value'] == [{"value": 1.0, "year": 2013}]
124
+ assert pdata[pname]['value'] == [{'value': 1.0, 'year': 2013}]
125
125
 
126
126
 
127
127
  def test_consumption_response(cps_subsample):
@@ -13,8 +13,6 @@ Read Tax-Calculator/TESTING.md for details.
13
13
  # pylint --disable=locally-disabled test_cpscsv.py
14
14
 
15
15
  import os
16
- import json
17
- import pytest
18
16
  import numpy as np
19
17
  import pandas as pd
20
18
  from taxcalc.growfactors import GrowFactors
@@ -28,7 +26,6 @@ START_YEAR = 2017
28
26
  NUM_YEARS = 19
29
27
 
30
28
 
31
- @pytest.mark.cpscsv_agg
32
29
  def test_agg(tests_path, cps_fullsample):
33
30
  """
34
31
  Test current-law aggregate taxes using cps.csv file.
@@ -45,7 +42,7 @@ def test_agg(tests_path, cps_fullsample):
45
42
  calc_start_year = calc.current_year
46
43
  # create aggregate diagnostic table (adt) as a Pandas DataFrame object
47
44
  adt = calc.diagnostic_table(nyrs).round(1) # column labels are int
48
- taxes_fullsample = adt.loc["Combined Liability ($b)"]
45
+ taxes_fullsample = adt.loc['Combined Liability ($b)']
49
46
  # compare actual DataFrame, adt, with the expected DataFrame, edt
50
47
  aggres_path = os.path.join(tests_path, 'cpscsv_agg_expect.csv')
51
48
  edt = pd.read_csv(aggres_path, index_col=False) # column labels are str
@@ -76,7 +73,7 @@ def test_agg(tests_path, cps_fullsample):
76
73
  calc_subsample.advance_to_year(START_YEAR)
77
74
  adt_subsample = calc_subsample.diagnostic_table(nyrs)
78
75
  # compare combined tax liability from full and sub samples for each year
79
- taxes_subsample = adt_subsample.loc["Combined Liability ($b)"]
76
+ taxes_subsample = adt_subsample.loc['Combined Liability ($b)']
80
77
  print('taxes_submsampe = ', taxes_subsample)
81
78
  print('TAXES full sample = ', taxes_fullsample)
82
79
  msg = ''
@@ -103,25 +100,6 @@ def test_agg(tests_path, cps_fullsample):
103
100
  raise ValueError(msg)
104
101
 
105
102
 
106
- def test_cps_availability(tests_path, cps_path):
107
- """
108
- Cross-check records_variables.json data with variables in cps.csv file.
109
- """
110
- cpsdf = pd.read_csv(cps_path)
111
- cpsvars = set(list(cpsdf))
112
- # make set of variable names that are marked as cps.csv available
113
- rvpath = os.path.join(tests_path, '..', 'records_variables.json')
114
- with open(rvpath, 'r', encoding='utf-8') as rvfile:
115
- rvdict = json.load(rvfile)
116
- recvars = set()
117
- for vname, vdict in rvdict['read'].items():
118
- if 'taxdata_cps' in vdict.get('availability', ''):
119
- recvars.add(vname)
120
- # check that cpsvars and recvars sets are the same
121
- assert (cpsvars - recvars) == set()
122
- assert (recvars - cpsvars) == set()
123
-
124
-
125
103
  def nonsmall_diffs(linelist1, linelist2, small=0.0):
126
104
  """
127
105
  Return True if line lists differ significantly; otherwise return False.
@@ -67,6 +67,7 @@ def test_recs_class(recs_varinfo_file, cps_subsample):
67
67
  """
68
68
  Specify Data-derived Recs class and test it.
69
69
  """
70
+ # pylint: disable=too-many-statements
70
71
 
71
72
  class Recs(Data):
72
73
  """
@@ -84,6 +85,9 @@ def test_recs_class(recs_varinfo_file, cps_subsample):
84
85
  self, 'e00300', val * self.gfactors.factor_value('AINTS', year)
85
86
  )
86
87
 
88
+ # create CPS weights DataFrame
89
+ wghts_path = os.path.join(GrowFactors.FILE_PATH, 'cps_weights.csv.gz')
90
+ wghts_df = pd.read_csv(wghts_path)
87
91
  # test Recs class for incorrect instantiation:
88
92
  with pytest.raises(ValueError):
89
93
  Recs(data=[], start_year=2000,
@@ -100,7 +104,10 @@ def test_recs_class(recs_varinfo_file, cps_subsample):
100
104
  with pytest.raises(ValueError):
101
105
  Recs(data=cps_subsample, start_year=2000,
102
106
  gfactors='', weights='')
103
- # test Recs class for correct instantiation with no aging of data:
107
+ with pytest.raises(ValueError):
108
+ Recs(data=cps_subsample, start_year=2000,
109
+ gfactors=GrowFactors(), weights=wghts_df[:10])
110
+ # test Recs class for correct instantiation without aging of data:
104
111
  syr = 2014
105
112
  rec = Recs(data=cps_subsample, start_year=syr,
106
113
  gfactors=None, weights=None)
@@ -115,8 +122,6 @@ def test_recs_class(recs_varinfo_file, cps_subsample):
115
122
  assert np.allclose([sum_e00300_in_syr], [sum_e00300_in_syr_plus_one])
116
123
  del rec
117
124
  # test Recs class for correct instantiation with aging of data
118
- wghts_path = os.path.join(GrowFactors.FILE_PATH, 'cps_weights.csv.gz')
119
- wghts_df = pd.read_csv(wghts_path)
120
125
  rec = Recs(data=cps_subsample, start_year=syr,
121
126
  gfactors=GrowFactors(), weights=wghts_df)
122
127
  assert isinstance(rec, Recs)
@@ -138,3 +143,6 @@ def test_recs_class(recs_varinfo_file, cps_subsample):
138
143
  rec._read_weights(weights=None)
139
144
  with pytest.raises(ValueError):
140
145
  rec._read_weights(weights=[])
146
+ incomplete_data = pd.DataFrame({'MARS': np.array([1, 2, 3])})
147
+ with pytest.raises(ValueError):
148
+ rec._read_data(data=incomplete_data)