taxcalc 4.3.4__py3-none-any.whl → 4.4.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.
- taxcalc/__init__.py +1 -1
- taxcalc/assumptions/README.md +1 -1
- taxcalc/assumptions/economic_assumptions_template.json +1 -1
- taxcalc/calculator.py +7 -3
- taxcalc/consumption.py +5 -5
- taxcalc/cps_weights.csv.gz +0 -0
- taxcalc/growdiff.py +5 -10
- taxcalc/growfactors.csv +25 -65
- taxcalc/parameters.py +12 -13
- taxcalc/policy.py +38 -34
- taxcalc/policy_current_law.json +87 -87
- taxcalc/puf_ratios.csv +14 -14
- taxcalc/puf_weights.csv.gz +0 -0
- taxcalc/records.py +6 -3
- taxcalc/reforms/2017_law.out.csv +9 -9
- taxcalc/reforms/BrownKhanna.out.csv +9 -9
- taxcalc/reforms/README.md +7 -6
- taxcalc/reforms/Renacci.out.csv +9 -9
- taxcalc/reforms/TCJA.out.csv +9 -9
- taxcalc/reforms/Trump2016.out.csv +9 -9
- taxcalc/reforms/Trump2017.out.csv +9 -9
- taxcalc/reforms/ext.json +21 -21
- taxcalc/reforms/ptaxes0.out.csv +9 -9
- taxcalc/reforms/ptaxes1.out.csv +9 -9
- taxcalc/reforms/ptaxes2.out.csv +9 -9
- taxcalc/reforms/ptaxes3.out.csv +9 -9
- taxcalc/taxcalcio.py +47 -32
- taxcalc/tests/cpscsv_agg_expect.csv +17 -17
- taxcalc/tests/puf_var_wght_means_by_year.csv +39 -39
- taxcalc/tests/pufcsv_agg_expect.csv +19 -19
- taxcalc/tests/reforms_expect.csv +19 -19
- taxcalc/tests/test_4package.py +42 -0
- taxcalc/tests/test_calculator.py +8 -7
- taxcalc/tests/test_consumption.py +5 -6
- taxcalc/tests/test_cpscsv.py +49 -1
- taxcalc/tests/test_growdiff.py +5 -7
- taxcalc/tests/test_parameters.py +3 -2
- taxcalc/tests/test_policy.py +2 -2
- taxcalc/tests/test_reforms.py +1 -1
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/METADATA +5 -7
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/RECORD +45 -45
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/LICENSE +0 -0
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/WHEEL +0 -0
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/entry_points.txt +0 -0
- {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/top_level.txt +0 -0
@@ -1,44 +1,44 @@
|
|
1
1
|
,description,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034
|
2
|
-
c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60318, 61591, 63130, 73017, 72224, 75916, 77963,
|
2
|
+
c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60318, 61591, 63130, 73017, 72224, 75916, 77963, 80249, 82361, 84515, 86849, 89341, 91949, 94676, 98274, 99813, 102616
|
3
3
|
c02500,OASDI benefits in AGI, 1295, 1394, 1416, 1479, 1501, 1587, 1690, 1832, 2005, 2129, 2428, 2659, 2844, 3028, 3214, 3413, 3619, 3833, 4055, 4308, 4459, 4698
|
4
|
-
c04470,Post-phase-out itemized deduction, 5908, 6037, 6150, 6383, 6563,
|
5
|
-
c04600,Post-phase-out personal exemption, 7105, 7131, 7163, 7217, 7149,
|
6
|
-
c04800,Federal regular taxable income, 35753, 39297, 39663, 39591, 42568,
|
7
|
-
c05200,Regular tax on taxable income, 7671, 8731, 8725, 8584, 9499,
|
8
|
-
c07180,Child care credit, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17,
|
9
|
-
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139,
|
10
|
-
c09600,Federal AMT liability, 212, 227, 240, 251, 268,
|
11
|
-
c11070,Extra child tax credit (refunded), 150, 144, 138, 133, 126,
|
12
|
-
c21040,Itemized deduction that is phased out, 203, 242, 231, 219, 255,
|
13
|
-
cmbtp,Estimate of income on (AMT) Form 6251 but not in AGI, 370, 386, 403, 416, 434, 452, 463, 493, 526, 526, 547, 570, 592, 616, 636, 658, 680, 703, 708,
|
4
|
+
c04470,Post-phase-out itemized deduction, 5908, 6037, 6150, 6383, 6563, 6799, 7003, 7481, 7870, 8002, 8296, 8655, 8929, 9267, 9592, 9920, 10242, 10589, 10945, 11419, 11619, 11977
|
5
|
+
c04600,Post-phase-out personal exemption, 7105, 7131, 7163, 7217, 7149, 7280, 7448, 7574, 7621, 7988, 8640, 8989, 9218, 9445, 9662, 9869, 10084, 10307, 10540, 10788, 11005, 11255
|
6
|
+
c04800,Federal regular taxable income, 35753, 39297, 39663, 39591, 42568, 44486, 45339, 46360, 55795, 54396, 57019, 58210, 59884, 61349, 62887, 64617, 66498, 68459, 70505, 73204, 74342, 76428
|
7
|
+
c05200,Regular tax on taxable income, 7671, 8731, 8725, 8584, 9499, 9983, 10101, 10420, 13279, 12471, 13014, 13143, 13469, 13736, 14036, 14397, 14799, 15213, 15633, 16166, 16565, 17002
|
8
|
+
c07180,Child care credit, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 16, 16, 17, 17, 17, 16, 16
|
9
|
+
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 128, 123, 359, 114, 104, 99, 96, 92, 89, 86, 83, 80, 77, 75, 71, 69
|
10
|
+
c09600,Federal AMT liability, 212, 227, 240, 251, 268, 279, 286, 315, 347, 334, 341, 354, 368, 382, 395, 409, 423, 439, 450, 477, 487, 503
|
11
|
+
c11070,Extra child tax credit (refunded), 150, 144, 138, 133, 126, 123, 120, 121, 0, 110, 112, 111, 109, 107, 105, 103, 102, 100, 99, 98, 97, 96
|
12
|
+
c21040,Itemized deduction that is phased out, 203, 242, 231, 219, 255, 270, 270, 283, 375, 344, 357, 356, 362, 367, 373, 380, 389, 397, 404, 409, 438, 447
|
13
|
+
cmbtp,Estimate of income on (AMT) Form 6251 but not in AGI, 370, 386, 403, 416, 434, 452, 463, 493, 526, 526, 547, 570, 592, 616, 636, 658, 680, 703, 708, 752, 779, 804
|
14
14
|
data_source,1 if unit is created primarily from IRS-SOI PUF data; 0 if created primarily from CPS data (not used in tax-calculation logic), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
15
|
-
e00200,"Wages, salaries, and tips for filing unit net of pension contributions", 35512, 37221, 37448, 37946, 39051, 40312, 41580, 41587,
|
16
|
-
e00300,Taxable interest income, 537, 499, 497, 500, 538, 550, 554, 544, 541, 564, 575, 661, 718, 784, 831, 869, 890, 919, 951,
|
15
|
+
e00200,"Wages, salaries, and tips for filing unit net of pension contributions", 35512, 37221, 37448, 37946, 39051, 40312, 41580, 41587, 44620, 47745, 49844, 51560, 53247, 54853, 56386, 57942, 59564, 61248, 62996, 65293, 66185, 67901
|
16
|
+
e00300,Taxable interest income, 537, 499, 497, 500, 538, 550, 554, 544, 541, 564, 575, 661, 718, 784, 831, 869, 890, 919, 951, 993, 1007, 1029
|
17
17
|
e00400,Tax-exempt interest income, 343, 326, 322, 327, 353, 365, 369, 367, 367, 386, 397, 459, 499, 548, 582, 609, 623, 643, 661, 678, 710, 726
|
18
|
-
e00600,Ordinary dividends included in AGI, 1179, 1397, 1392, 1356, 1479, 1578, 1631, 1770, 1861, 1928, 2160, 2197, 2240, 2271, 2289, 2326, 2388, 2455, 2525,
|
19
|
-
e00650,Qualified dividends included in ordinary dividends, 846, 1001, 992, 966, 1048, 1115, 1151, 1247,
|
18
|
+
e00600,Ordinary dividends included in AGI, 1179, 1397, 1392, 1356, 1479, 1578, 1631, 1770, 1861, 1928, 2160, 2197, 2240, 2271, 2289, 2326, 2388, 2455, 2525, 2618, 2656, 2729
|
19
|
+
e00650,Qualified dividends included in ordinary dividends, 846, 1001, 992, 966, 1048, 1115, 1151, 1247, 1310, 1356, 1517, 1541, 1570, 1591, 1601, 1625, 1667, 1714, 1763, 1827, 1847, 1898
|
20
20
|
e00700,Taxable refunds of state and local income taxes, 163, 170, 174, 179, 186, 191, 196, 209, 221, 223, 233, 243, 251, 260, 268, 277, 285, 294, 302, 313, 321, 330
|
21
21
|
e00800,Alimony received, 47, 52, 60, 61, 70, 73, 76, 81, 87, 88, 93, 97, 101, 106, 110, 115, 119, 123, 128, 134, 142, 147
|
22
|
-
e00900,Sch C business net profit/loss for filing unit, 1657, 1740, 1774, 1752, 1814, 1874, 1868, 1887, 1982, 2015, 2029, 2098, 2164, 2233, 2296, 2357, 2417, 2479,
|
23
|
-
e01100,Capital gain distributions not reported on Sch D, 13, 18, 18, 16, 22, 24, 22, 28, 50, 31, 33, 31, 30, 29, 29, 30, 30, 31, 32,
|
24
|
-
e01200,Other net gain/loss from Form 4797, -119, -164, -163, -147, -188, -198, -181, -233, -417, -260, -273, -255, -247, -241, -235, -234, -
|
25
|
-
e01400,Taxable IRA distributions, 1390, 1489, 1627, 1721, 1890, 1994, 2084, 2251, 2428,
|
26
|
-
e01500,Total pensions and annuities, 5494, 5708, 5855, 5915, 6150, 6371, 6548, 6972, 7413, 7496, 7844,
|
27
|
-
e01700,Taxable pensions and annuities, 3503, 3638, 3690, 3703, 3819, 3944, 4041, 4289, 4542, 4580, 4782,
|
28
|
-
e02000,"Sch E total rental, royalty, partnership, S-corporation, etc, income/loss (includes e26270 and e27200)", 3365, 3727, 3814, 3772, 4017, 4275, 4324, 4069, 4920, 5124, 5558,
|
22
|
+
e00900,Sch C business net profit/loss for filing unit, 1657, 1740, 1774, 1752, 1814, 1874, 1868, 1887, 1982, 2015, 2029, 2098, 2164, 2233, 2296, 2357, 2417, 2479, 2545, 2639, 2681, 2757
|
23
|
+
e01100,Capital gain distributions not reported on Sch D, 13, 18, 18, 16, 22, 24, 22, 28, 50, 31, 33, 31, 30, 29, 29, 30, 30, 31, 32, 33, 34, 35
|
24
|
+
e01200,Other net gain/loss from Form 4797, -119, -164, -163, -147, -188, -198, -181, -233, -417, -260, -273, -255, -247, -241, -235, -234, -237, -242, -254, -267, -262, -270
|
25
|
+
e01400,Taxable IRA distributions, 1390, 1489, 1627, 1721, 1890, 1994, 2084, 2251, 2428, 2490, 2641, 2788, 2931, 3073, 3210, 3354, 3496, 3644, 3795, 3983, 4093, 4254
|
26
|
+
e01500,Total pensions and annuities, 5494, 5708, 5855, 5915, 6150, 6371, 6548, 6972, 7413, 7496, 7844, 8188, 8486, 8783, 9073, 9362, 9648, 9935, 10235, 10594, 11008, 11315
|
27
|
+
e01700,Taxable pensions and annuities, 3503, 3638, 3690, 3703, 3819, 3944, 4041, 4289, 4542, 4580, 4782, 4975, 5145, 5316, 5484, 5656, 5828, 6012, 6205, 6458, 6573, 6773
|
28
|
+
e02000,"Sch E total rental, royalty, partnership, S-corporation, etc, income/loss (includes e26270 and e27200)", 3365, 3727, 3814, 3772, 4017, 4275, 4324, 4069, 4920, 5124, 5558, 5567, 5646, 5697, 5765, 5873, 6006, 6122, 6247, 6449, 6516, 6677
|
29
29
|
e02100,Farm net income/loss for filing unit from Sch F, -45, -41, -19, -20, -15, -14, -13, -15, -17, -31, -20, -18, -17, -16, -15, -15, -14, -12, -11, -5, -14, -12
|
30
30
|
e02300,Unemployment insurance benefits, 289, 187, 150, 141, 131, 120, 112, 115, 988, 150, 112, 148, 170, 175, 182, 189, 197, 205, 212, 219, 221, 227
|
31
|
-
e02400,Total social security (OASDI) benefits, 4837, 5027, 5154, 5271, 5380, 5568, 5845, 6102, 6289, 6714, 7419, 7939, 8325, 8703, 9084, 9481, 9881, 10283, 10682,
|
31
|
+
e02400,Total social security (OASDI) benefits, 4837, 5027, 5154, 5271, 5380, 5568, 5845, 6102, 6289, 6714, 7419, 7939, 8325, 8703, 9084, 9481, 9881, 10283, 10682, 10900, 11568, 11995
|
32
32
|
e03150,Total deductible IRA contributions, 63, 64, 66, 69, 69, 72, 74, 79, 84, 84, 88, 92, 96, 100, 103, 107, 111, 115, 119, 126, 124, 129
|
33
33
|
e03210,Student loan interest, 55, 55, 57, 58, 59, 62, 63, 67, 71, 71, 74, 77, 80, 82, 85, 88, 90, 93, 96, 99, 103, 106
|
34
34
|
e03220,Educator expenses, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11
|
35
35
|
e03230,Tuition and fees from Form 8917, 24, 25, 25, 26, 26, 27, 28, 30, 32, 32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 45, 46, 47
|
36
36
|
e03240,Domestic production activities from Form 8903, 51, 53, 53, 54, 56, 57, 58, 62, 65, 66, 68, 71, 73, 75, 77, 79, 81, 83, 85, 86, 92, 93
|
37
|
-
e03270,Self-employed health insurance deduction, 152, 155, 160, 171, 174, 177, 181, 188, 189, 196, 195, 197,
|
37
|
+
e03270,Self-employed health insurance deduction, 152, 155, 160, 171, 174, 177, 181, 188, 189, 196, 195, 197, 189, 191, 193, 196, 200, 204, 209, 218, 205, 210
|
38
38
|
e03290,Health savings account deduction from Form 8889, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 23, 24, 22, 23, 23, 23, 23, 24, 24, 25, 24, 24
|
39
39
|
e03300,"Contributions to SEP, SIMPLE and qualified plans", 114, 117, 115, 118, 118, 121, 123, 130, 137, 138, 144, 150, 154, 159, 163, 167, 171, 176, 180, 192, 188, 192
|
40
40
|
e03400,Penalty on early withdrawal of savings, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6
|
41
|
-
e03500,Alimony paid, 41, 45, 44, 46, 46, 47, 48, 51, 54,
|
41
|
+
e03500,Alimony paid, 41, 45, 44, 46, 46, 47, 48, 51, 54, 54, 57, 60, 62, 64, 66, 67, 69, 71, 72, 75, 76, 77
|
42
42
|
e07240,Retirement savings contributions credit from Form 8880, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11
|
43
43
|
e07260,Residential energy credit from Form 5695, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 18, 19, 19, 19
|
44
44
|
e07300,Foreign tax credit from Form 1116, 94, 97, 91, 88, 92, 97, 98, 92, 111, 116, 125, 125, 127, 127, 129, 131, 133, 136, 137, 141, 144, 147
|
@@ -48,33 +48,33 @@ e09700,Recapture of Investment Credit, 0, 0, 0, 0,
|
|
48
48
|
e09800,Unreported payroll taxes from Form 4137 or 8919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
49
49
|
e09900,Penalty tax on qualified retirement plans, 35, 37, 39, 40, 43, 45, 46, 48, 50, 50, 51, 53, 54, 56, 57, 58, 60, 61, 63, 66, 68, 70
|
50
50
|
e11200,Excess payroll (FICA/RRTA) tax withheld, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 21, 21
|
51
|
-
e17500,Itemizable medical and dental expenses. WARNING: this variable is zero below the floor in PUF data., 799, 833, 861, 906, 938, 962, 995, 1044, 1063, 1112, 1123, 1145, 1106, 1127, 1149,
|
52
|
-
e18400,Itemizable state and local income/sales taxes, 1669, 1768, 1803, 1855, 1944, 2004, 2052, 2178, 2306, 2326, 2428, 2525,
|
53
|
-
e18500,Itemizable real-estate taxes paid, 1145, 1200, 1251, 1298, 1358, 1409, 1449, 1545, 1642, 1663, 1743, 1821, 1891, 1962, 2031, 2101, 2171, 2245, 2321,
|
54
|
-
e19200,Itemizable interest paid, 1878, 1841, 1817, 1844, 1884, 1965, 2032, 2177, 2327, 2368, 2495, 2619, 2734, 2850, 2965, 3084, 3203, 3328, 3463,
|
51
|
+
e17500,Itemizable medical and dental expenses. WARNING: this variable is zero below the floor in PUF data., 799, 833, 861, 906, 938, 962, 995, 1044, 1063, 1112, 1123, 1145, 1106, 1127, 1149, 1169, 1193, 1216, 1240, 1276, 1264, 1285
|
52
|
+
e18400,Itemizable state and local income/sales taxes, 1669, 1768, 1803, 1855, 1944, 2004, 2052, 2178, 2306, 2326, 2428, 2525, 2611, 2699, 2782, 2866, 2948, 3035, 3123, 3237, 3322, 3412
|
53
|
+
e18500,Itemizable real-estate taxes paid, 1145, 1200, 1251, 1298, 1358, 1409, 1449, 1545, 1642, 1663, 1743, 1821, 1891, 1962, 2031, 2101, 2171, 2245, 2321, 2404, 2464, 2540
|
54
|
+
e19200,Itemizable interest paid, 1878, 1841, 1817, 1844, 1884, 1965, 2032, 2177, 2327, 2368, 2495, 2619, 2734, 2850, 2965, 3084, 3203, 3328, 3463, 3625, 3713, 3851
|
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, 1302, 1359, 1411, 1463, 1514, 1567, 1618, 1670, 1724, 1783, 1831, 1886
|
56
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, 310, 322, 334, 345, 356, 368, 380, 392, 405, 416, 427, 439
|
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,
|
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, 1019, 1059, 1097, 1135, 1171, 1206, 1242, 1280, 1316, 1364, 1408, 1448
|
58
58
|
e24515,Sch D: Un-Recaptured Section 1250 Gain, 79, 110, 112, 100, 137, 147, 136, 176, 315, 199, 209, 192, 188, 182, 181, 183, 187, 192, 200, 206, 205, 213
|
59
59
|
e24518,Sch D: 28% Rate Gain or Loss, 24, 34, 34, 30, 39, 41, 38, 49, 87, 55, 58, 54, 52, 50, 50, 50, 50, 50, 51, 52, 56, 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, 4398, 4394, 4447, 4477, 4519, 4594, 4687,
|
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, 4398, 4394, 4447, 4477, 4519, 4594, 4687, 4766, 4836, 4951, 5066, 5178
|
61
61
|
e27200,Sch E: Farm rent net income or loss (included in e02000), 35, 37, 38, 39, 44, 47, 49, 47, 58, 62, 68, 69, 71, 72, 75, 78, 81, 85, 90, 96, 92, 96
|
62
62
|
e32800,Child/dependent-care expenses for qualifying persons from Form 2441, 108, 111, 113, 114, 118, 121, 123, 130, 137, 137, 143, 148, 152, 156, 160, 164, 168, 173, 178, 186, 187, 192
|
63
63
|
e58990,Investment income elected amount from Form 4952, 14, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 26, 26
|
64
|
-
e62900,Alternative Minimum Tax foreign tax credit from Form 6251, 78, 86, 84, 84, 90, 93, 95, 100, 106, 107, 111, 116, 119, 123, 126, 130, 133, 138, 140,
|
64
|
+
e62900,Alternative Minimum Tax foreign tax credit from Form 6251, 78, 86, 84, 84, 90, 93, 95, 100, 106, 107, 111, 116, 119, 123, 126, 130, 133, 138, 140, 144, 149, 154
|
65
65
|
e87521,Total tentative AmOppCredit amount for all students, 172, 176, 182, 184, 191, 197, 201, 213, 225, 227, 236, 245, 253, 261, 269, 278, 286, 296, 305, 318, 325, 336
|
66
66
|
e87530,Adjusted qualified lifetime learning expenses for all students, 93, 92, 94, 96, 99, 102, 105, 111, 117, 118, 123, 128, 132, 137, 141, 145, 150, 153, 158, 163, 171, 176
|
67
|
-
eitc,Federal EITC, 376, 369, 364, 352, 342,
|
67
|
+
eitc,Federal EITC, 376, 369, 364, 352, 342, 343, 346, 355, 335, 348, 382, 396, 402, 409, 415, 420, 426, 433, 440, 451, 457, 467
|
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, 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, 42, 44, 47, 48, 50, 52, 55, 57, 60, 63, 62, 66
|
70
|
-
iitax,Federal income tax liability, 6826, 7764, 7820, 7778, 8605,
|
71
|
-
k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -139, -133, -129, -156, -168, -183, -181, -
|
70
|
+
iitax,Federal income tax liability, 6826, 7764, 7820, 7778, 8605, 9071, 9251, 6827, 9422, 11452, 11929, 12145, 12523, 12849, 13188, 13577, 13998, 14428, 14862, 15419, 15805, 16254
|
71
|
+
k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -139, -133, -129, -156, -168, -183, -181, -177, -174, -168, -158, -145, -124, -103, -68, -150, -123
|
72
72
|
k1bx14s,Partner self-employment earnings/loss for spouse (included in e26270 total), -7, -9, 0, 2, 8, 10, 11, 11, 13, 14, 14, 14, 15, 16, 18, 21, 25, 27, 31, 34, 28, 33
|
73
73
|
nu06,Number of dependents under 6 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
75
75
|
p08000,Other tax credits (but not including Sch R credit), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
76
|
-
p22250,Sch D: Net short-term capital gains/losses, -120, -173, -172, -151, -195, -212, -202, -267, -481, -308, -330, -304, -299, -292, -288, -288, -290, -293, -284, -
|
77
|
-
p23250,Sch D: Net long-term capital gains/losses, 2284, 3191, 3138, 2776, 3680, 3912, 3596, 4616, 8212, 5153,
|
78
|
-
payrolltax,Payroll taxes (ee+er) for OASDI+HI, 4917, 5091, 5141, 5215, 5352, 5497, 5667, 5696, 6069, 6441,
|
79
|
-
pencon_p,Contributions to defined-contribution pension plans for taxpayer, 856, 897, 916, 941, 963, 996, 1029, 1030, 1107, 1185, 1239, 1282, 1326, 1368,
|
76
|
+
p22250,Sch D: Net short-term capital gains/losses, -120, -173, -172, -151, -195, -212, -202, -267, -481, -308, -330, -304, -299, -292, -288, -288, -290, -293, -284, -285, -327, -335
|
77
|
+
p23250,Sch D: Net long-term capital gains/losses, 2284, 3191, 3138, 2776, 3680, 3912, 3596, 4616, 8212, 5153, 5390, 4987, 4839, 4662, 4598, 4612, 4669, 4756, 4864, 5021, 5090, 5224
|
78
|
+
payrolltax,Payroll taxes (ee+er) for OASDI+HI, 4917, 5091, 5141, 5215, 5352, 5497, 5667, 5696, 6069, 6441, 6769, 7016, 7253, 7477, 7690, 7906, 8129, 8363, 8611, 8939, 9038, 9280
|
79
|
+
pencon_p,Contributions to defined-contribution pension plans for taxpayer, 856, 897, 916, 941, 963, 996, 1029, 1030, 1107, 1185, 1239, 1282, 1326, 1368, 1407, 1448, 1490, 1532, 1578, 1637, 1655, 1698
|
80
80
|
pencon_s,Contributions to defined-contribution pension plans for spouse, 393, 410, 421, 424, 440, 452, 466, 466, 500, 535, 558, 577, 595, 612, 629, 645, 661, 678, 695, 720, 738, 756
|
@@ -1,26 +1,26 @@
|
|
1
1
|
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
|
2
2
|
Returns (#m),190.9,194.3,197.3,200.1,202.9,205.6,208.4,211.2,214.0,216.8
|
3
|
-
AGI ($b),11078.7,11816.6,12247.2,12722.3,
|
4
|
-
Itemizers (#m),45.7,19.4,20.0,21.0,22.6,22.8,21.7,21.2,21.2,51.
|
5
|
-
Itemized Deduction ($b),1274.3,602.7,633.9,692.3,761.9,782.
|
6
|
-
Standard Deduction Filers (#m),145.2,174.8,177.2,178.5,179.6,182.8,186.7,190.0,192.7,
|
7
|
-
Standard Deduction ($b),1239.3,2865.3,2954.5,3025.8,3081.1,3234.0,3537.
|
8
|
-
Personal Exemption ($b),1365.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
|
9
|
-
Taxable Income ($b),8112.2,9179.2,9520.5,9907.3,12003.
|
10
|
-
Regular Tax ($b),1656.8,1712.3,1778.2,1838.3,2281.5,2282.7,2423.
|
11
|
-
AMT Income ($b),10512.4,11343.5,11749.7,12180.1,14330.
|
12
|
-
AMT Liability ($b),51.3,22.1,23.0,25.1,27.8,27.4,28.8,30.3,31.8,87.
|
13
|
-
AMT Filers (#m),5.7,0.2,0.2,0.3,0.4,0.3,0.3,0.3,0.3,7.
|
14
|
-
Tax before Credits ($b),1708.1,1734.4,1801.1,1863.4,2309.
|
15
|
-
Refundable Credits ($b),102.9,117.5,118.5,642.0,802.6,119.2,126.9,133.5,136.0,122.
|
16
|
-
Nonrefundable Credits ($b),67.0,127.3,129.2,128.5,47.6,141.0,143.3,144.0,145.7,77.
|
3
|
+
AGI ($b),11078.7,11816.6,12247.2,12722.3,14929.8,14973.8,15954.9,16597.5,17309.9,18000.8
|
4
|
+
Itemizers (#m),45.7,19.4,20.0,21.0,22.6,22.8,21.7,21.2,21.2,51.7
|
5
|
+
Itemized Deduction ($b),1274.3,602.7,633.9,692.3,761.9,782.6,788.6,808.1,833.2,2044.2
|
6
|
+
Standard Deduction Filers (#m),145.2,174.8,177.2,178.5,179.6,182.8,186.7,190.0,192.7,165.0
|
7
|
+
Standard Deduction ($b),1239.3,2865.3,2954.5,3025.8,3081.1,3234.0,3537.6,3798.4,3962.0,1893.0
|
8
|
+
Personal Exemption ($b),1365.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2000.8
|
9
|
+
Taxable Income ($b),8112.2,9179.2,9520.5,9907.3,12003.1,11927.7,12697.7,13130.8,13698.9,13412.7
|
10
|
+
Regular Tax ($b),1656.8,1712.3,1778.2,1838.3,2281.5,2282.7,2423.3,2489.9,2598.6,2793.0
|
11
|
+
AMT Income ($b),10512.4,11343.5,11749.7,12180.1,14330.6,14356.1,15322.9,15943.1,16631.5,17084.9
|
12
|
+
AMT Liability ($b),51.3,22.1,23.0,25.1,27.8,27.4,28.8,30.3,31.8,87.2
|
13
|
+
AMT Filers (#m),5.7,0.2,0.2,0.3,0.4,0.3,0.3,0.3,0.3,7.1
|
14
|
+
Tax before Credits ($b),1708.1,1734.4,1801.1,1863.4,2309.3,2310.1,2452.2,2520.2,2630.4,2880.2
|
15
|
+
Refundable Credits ($b),102.9,117.5,118.5,642.0,802.6,119.2,126.9,133.5,136.0,122.8
|
16
|
+
Nonrefundable Credits ($b),67.0,127.3,129.2,128.5,47.6,141.0,143.3,144.0,145.7,77.2
|
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
|
18
18
|
Other Taxes ($b),101.9,110.3,110.9,122.1,159.4,140.3,148.2,151.5,157.0,162.3
|
19
|
-
Ind Income Tax ($b),1640.1,1599.8,1664.4,1215.0,1618.
|
20
|
-
Payroll Taxes ($b),1021.9,1067.9,1118.1,1139.7,1231.5,1324.7,1410.9,1481.
|
21
|
-
Combined Liability ($b),2662.0,2667.7,2782.4,2354.8,
|
22
|
-
With Income Tax <= 0 (#m),88.5,94.0,95.1,129.1,122.6,95.7,97.1,98.6,99.6,96.
|
23
|
-
With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.1,94.5,68.9,70.2,71.6,72.7,72.
|
19
|
+
Ind Income Tax ($b),1640.1,1599.8,1664.4,1215.0,1618.4,2190.2,2330.2,2394.2,2505.7,2842.5
|
20
|
+
Payroll Taxes ($b),1021.9,1067.9,1118.1,1139.7,1231.5,1324.7,1410.9,1481.8,1552.2,1620.6
|
21
|
+
Combined Liability ($b),2662.0,2667.7,2782.4,2354.8,2849.9,3514.9,3741.0,3876.0,4057.9,4463.1
|
22
|
+
With Income Tax <= 0 (#m),88.5,94.0,95.1,129.1,122.6,95.7,97.1,98.6,99.6,96.7
|
23
|
+
With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.1,94.5,68.9,70.2,71.6,72.7,72.5
|
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
|
25
25
|
"Total Benefits, Consumption Value ($b)",1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1707.8,1818.1,1924.4
|
26
26
|
Total Benefits Cost ($b),1052.3,1104.9,1175.3,1243.9,1476.4,1411.5,1569.5,1707.8,1818.1,1924.4
|
taxcalc/tests/reforms_expect.csv
CHANGED
@@ -4,7 +4,7 @@ rid,res1,res2,res3,res4
|
|
4
4
|
3,73.3,74.5,78.4,82.2
|
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
|
+
6,37.9,37.8,39.4,40.7
|
8
8
|
7,7.2,7.4,7.5,7.9
|
9
9
|
8,1.9,1.9,2.1,2.2
|
10
10
|
9,3.8,3.8,4.2,4.6
|
@@ -17,32 +17,32 @@ rid,res1,res2,res3,res4
|
|
17
17
|
16,-1.0,-1.0,-1.5,-1.6
|
18
18
|
17,-0.2,-0.2,-0.3,-0.3
|
19
19
|
18,33.4,34.7,37.1,39.3
|
20
|
-
19,63.8,65.5,70.8,76.
|
21
|
-
20,97.9,101.5,109.4,
|
22
|
-
21,65.9,67.8,72.8,76.
|
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
23
|
22,9.7,10.3,10.6,11.2
|
24
24
|
23,0.5,0.6,0.6,0.6
|
25
|
-
24,50.4,52.6,55.8,59.
|
25
|
+
24,50.4,52.6,55.8,59.3
|
26
26
|
25,1.9,2.0,2.1,2.2
|
27
27
|
26,0.1,0.1,0.1,0.1
|
28
28
|
27,0.1,0.1,0.1,0.1
|
29
29
|
28,3.8,3.7,4.2,4.6
|
30
|
-
29,17.9,18.4,20.6,22.
|
30
|
+
29,17.9,18.4,20.6,22.1
|
31
31
|
30,14.7,13.3,17.2,18.6
|
32
32
|
31,-6.6,-6.4,-1.6,-1.6
|
33
33
|
32,57.4,57.9,61.8,65.4
|
34
|
-
33,12.0,11.5,13.3,14.
|
35
|
-
34,7.5,7.1,8.3,9.
|
34
|
+
33,12.0,11.5,13.3,14.4
|
35
|
+
34,7.5,7.1,8.3,9.0
|
36
36
|
35,-1.2,-0.9,-1.5,-1.6
|
37
37
|
36,-2.9,-2.8,-3.5,-3.7
|
38
38
|
37,3.1,3.2,3.6,3.9
|
39
|
-
38,29.8,30.9,34.1,36.
|
39
|
+
38,29.8,30.9,34.1,36.2
|
40
40
|
39,9.2,9.6,10.5,11.3
|
41
41
|
40,-0.6,-0.5,-0.7,-0.7
|
42
42
|
41,54.0,52.3,51.2,50.2
|
43
43
|
42,0.5,0.6,0.6,0.6
|
44
44
|
43,-0.2,-0.2,-0.2,-0.2
|
45
|
-
44,70.6,68.8,67.9,
|
45
|
+
44,70.6,68.8,67.9,69.4
|
46
46
|
45,1.2,1.1,1.1,1.2
|
47
47
|
46,-2.1,-2.0,-2.2,-2.2
|
48
48
|
47,-2.1,-1.8,-2.1,-2.2
|
@@ -50,16 +50,16 @@ rid,res1,res2,res3,res4
|
|
50
50
|
49,-0.0,-0.0,-0.0,-0.0
|
51
51
|
50,-26.5,-23.7,-31.1,-33.9
|
52
52
|
51,-0.3,-0.3,-0.5,-0.5
|
53
|
-
52,-187.0,-187.5,-193.6,-
|
54
|
-
53,-130.0,-129.3,-132.7,-
|
55
|
-
54,30.7,33.2,31.
|
56
|
-
55,86.1,90.
|
53
|
+
52,-187.0,-187.5,-193.6,-201.6
|
54
|
+
53,-130.0,-129.3,-132.7,-137.7
|
55
|
+
54,30.7,33.2,31.4,41.0
|
56
|
+
55,86.1,90.8,94.7,102.1
|
57
57
|
56,0.0,0.0,0.0,0.0
|
58
|
-
57,-14.1,-15.6,-
|
59
|
-
58,-15.5,-17.
|
58
|
+
57,-14.1,-15.6,-15.9,-14.4
|
59
|
+
58,-15.5,-17.0,-17.4,-15.8
|
60
60
|
59,-66.9,-66.9,-67.0,-67.1
|
61
61
|
60,-67.3,-67.2,-67.3,-67.4
|
62
|
-
61,-1.0,-0.
|
63
|
-
62,-17.
|
62
|
+
61,-1.0,-0.6,-0.8,-1.7
|
63
|
+
62,-17.4,-18.0,-24.3,-20.0
|
64
64
|
63,-12.7,-13.0,-23.4,-13.8
|
65
|
-
64,-46.9,-
|
65
|
+
64,-46.9,-48.1,-49.2,-52.0
|
taxcalc/tests/test_4package.py
CHANGED
@@ -10,6 +10,34 @@ import re
|
|
10
10
|
import subprocess
|
11
11
|
import yaml
|
12
12
|
import pytest
|
13
|
+
import ast
|
14
|
+
|
15
|
+
|
16
|
+
def extract_install_requires(setup_py_content):
|
17
|
+
"""
|
18
|
+
Extract the install_requires list from a setup.py file content.
|
19
|
+
|
20
|
+
Args:
|
21
|
+
setup_py_content (str): The full content of the setup.py file
|
22
|
+
|
23
|
+
Returns:
|
24
|
+
list: A list of package requirements
|
25
|
+
"""
|
26
|
+
# Use regex to find the install_requires list
|
27
|
+
match = re.search(r'"install_requires"\s*:\s*\[([^\]]+)\]', setup_py_content, re.DOTALL)
|
28
|
+
|
29
|
+
if match:
|
30
|
+
# Extract the contents of the list and split into packages
|
31
|
+
packages_str = match.group(1)
|
32
|
+
# Use ast.literal_eval to safely parse the string representations
|
33
|
+
packages = [
|
34
|
+
ast.literal_eval(f'{pkg.strip()}')
|
35
|
+
for pkg in packages_str.split(',')
|
36
|
+
if pkg.strip()
|
37
|
+
]
|
38
|
+
return packages
|
39
|
+
|
40
|
+
return []
|
13
41
|
|
14
42
|
|
15
43
|
@pytest.mark.local
|
@@ -38,6 +66,7 @@ def test_for_consistency(tests_path):
|
|
38
66
|
'coverage',
|
39
67
|
"pip",
|
40
68
|
"jupyter-book",
|
69
|
+
"setuptools"
|
41
70
|
])
|
42
71
|
# read conda.recipe/meta.yaml requirements
|
43
72
|
meta_file = os.path.join(tests_path, '..', '..',
|
@@ -65,3 +94,16 @@ def test_for_consistency(tests_path):
|
|
65
94
|
# confirm that extras in env (relative to run) equal the dev_pkgs set
|
66
95
|
extras = env - run
|
67
96
|
assert extras == dev_pkgs
|
97
|
+
# Read the setup.py file and extract the install_requires list
|
98
|
+
setup_file = os.path.join(tests_path, '..', '..',
|
99
|
+
'setup.py')
|
100
|
+
with open(setup_file, 'r') as f:
|
101
|
+
setup_py_content = f.read()
|
102
|
+
setup = set(extract_install_requires(setup_py_content))
|
103
|
+
# confirm that setup.py
|
104
|
+
print("Setup packages = ", setup)
|
105
|
+
print("Meta packages = ", bld)
|
106
|
+
# if package in both, confirm that the version is the same
|
107
|
+
for pkg in setup.intersection(bld):
|
108
|
+
assert pkg in setup
|
109
|
+
assert pkg in bld
|
taxcalc/tests/test_calculator.py
CHANGED
@@ -13,7 +13,7 @@ import copy
|
|
13
13
|
import pytest
|
14
14
|
import numpy as np
|
15
15
|
import pandas as pd
|
16
|
-
from taxcalc import Policy, Records, Calculator, Consumption
|
16
|
+
from taxcalc import GrowFactors, Policy, Records, Calculator, Consumption
|
17
17
|
|
18
18
|
|
19
19
|
def test_make_calculator(cps_subsample):
|
@@ -74,9 +74,9 @@ def test_make_calculator_with_policy_reform(cps_subsample):
|
|
74
74
|
assert calc.current_year == year
|
75
75
|
assert calc.policy_param('II_em') == 4000
|
76
76
|
assert np.allclose(calc.policy_param('_II_em'),
|
77
|
-
np.array([4000] *
|
77
|
+
np.array([4000] * pol.num_years))
|
78
78
|
exp_STD_Aged = [[1600, 1300, 1300,
|
79
|
-
1600, 1600]] *
|
79
|
+
1600, 1600]] * pol.num_years
|
80
80
|
assert np.allclose(calc.policy_param('_STD_Aged'),
|
81
81
|
np.array(exp_STD_Aged))
|
82
82
|
assert np.allclose(calc.policy_param('STD_Aged'),
|
@@ -100,10 +100,9 @@ def test_make_calculator_with_multiyear_reform(cps_subsample):
|
|
100
100
|
# create a Calculator object using this policy-reform
|
101
101
|
calc = Calculator(policy=pol, records=rec)
|
102
102
|
# check that Policy object embedded in Calculator object is correct
|
103
|
-
assert pol.num_years == Policy.DEFAULT_NUM_YEARS
|
104
103
|
assert calc.current_year == year
|
105
104
|
assert calc.policy_param('II_em') == 3950
|
106
|
-
exp_II_em = [3900, 3950, 5000] + [6000] * (
|
105
|
+
exp_II_em = [3900, 3950, 5000] + [6000] * (pol.num_years - 3)
|
107
106
|
assert np.allclose(calc.policy_param('_II_em'),
|
108
107
|
np.array(exp_II_em))
|
109
108
|
calc.increment_year()
|
@@ -568,7 +567,8 @@ def test_noreform_documentation():
|
|
568
567
|
"""
|
569
568
|
params = Calculator.read_json_param_objects(reform_json, assump_json)
|
570
569
|
assert isinstance(params, dict)
|
571
|
-
|
570
|
+
gfs = GrowFactors()
|
571
|
+
actual_doc = Calculator.reform_documentation(params, gfs)
|
572
572
|
expected_doc = (
|
573
573
|
'REFORM DOCUMENTATION\n'
|
574
574
|
'Baseline Growth-Difference Assumption Values by Year:\n'
|
@@ -623,7 +623,8 @@ def test_reform_documentation():
|
|
623
623
|
params = Calculator.read_json_param_objects(reform_json, assump_json)
|
624
624
|
assert isinstance(params, dict)
|
625
625
|
second_reform = {'II_em': {2019: 6500}}
|
626
|
-
|
626
|
+
gfs = GrowFactors()
|
627
|
+
doc = Calculator.reform_documentation(params, gfs, [second_reform])
|
627
628
|
assert isinstance(doc, str)
|
628
629
|
dump = False # set to True to print documentation and force test failure
|
629
630
|
if dump:
|
@@ -8,9 +8,8 @@ import copy
|
|
8
8
|
from taxcalc import Policy, Records, Calculator, Consumption
|
9
9
|
|
10
10
|
|
11
|
-
def
|
11
|
+
def test_start_year_consistency():
|
12
12
|
assert Consumption.JSON_START_YEAR == Policy.JSON_START_YEAR
|
13
|
-
assert Consumption.DEFAULT_NUM_YEARS == Policy.DEFAULT_NUM_YEARS
|
14
13
|
|
15
14
|
|
16
15
|
def test_validity_of_consumption_vars_set():
|
@@ -31,23 +30,23 @@ def test_update_consumption():
|
|
31
30
|
2015: 0.80}
|
32
31
|
}
|
33
32
|
consump.update_consumption(revision)
|
34
|
-
expected_mpc_e20400 = np.full((
|
33
|
+
expected_mpc_e20400 = np.full((consump.num_years,), 0.06)
|
35
34
|
expected_mpc_e20400[0] = 0.0
|
36
35
|
expected_mpc_e20400[1] = 0.05
|
37
36
|
assert np.allclose(consump._MPC_e20400,
|
38
37
|
expected_mpc_e20400,
|
39
38
|
rtol=0.0)
|
40
39
|
assert np.allclose(consump._MPC_e17500,
|
41
|
-
np.zeros((
|
40
|
+
np.zeros((consump.num_years,)),
|
42
41
|
rtol=0.0)
|
43
|
-
expected_ben_mcare_value = np.full((
|
42
|
+
expected_ben_mcare_value = np.full((consump.num_years,), 0.80)
|
44
43
|
expected_ben_mcare_value[0] = 1.0
|
45
44
|
expected_ben_mcare_value[1] = 0.75
|
46
45
|
assert np.allclose(consump._BEN_mcare_value,
|
47
46
|
expected_ben_mcare_value,
|
48
47
|
rtol=0.0)
|
49
48
|
assert np.allclose(consump._BEN_snap_value,
|
50
|
-
np.ones((
|
49
|
+
np.ones((consump.num_years,)),
|
51
50
|
rtol=0.0)
|
52
51
|
consump.set_year(2015)
|
53
52
|
assert consump.current_year == 2015
|
taxcalc/tests/test_cpscsv.py
CHANGED
@@ -18,7 +18,7 @@ import pytest
|
|
18
18
|
import numpy as np
|
19
19
|
import pandas as pd
|
20
20
|
# pylint: disable=import-error
|
21
|
-
from taxcalc import Policy, Records, Calculator
|
21
|
+
from taxcalc import GrowFactors, GrowDiff, Policy, Records, Calculator
|
22
22
|
|
23
23
|
|
24
24
|
START_YEAR = 2017
|
@@ -161,3 +161,51 @@ def nonsmall_diffs(linelist1, linelist2, small=0.0):
|
|
161
161
|
else:
|
162
162
|
return True
|
163
163
|
return False
|
164
|
+
|
165
|
+
|
166
|
+
def test_flexible_last_budget_year(cps_fullsample):
|
167
|
+
"""
|
168
|
+
Test flexible LAST_BUDGET_YEAR logic using cps.csv file.
|
169
|
+
"""
|
170
|
+
tax_calc_year = Policy.LAST_BUDGET_YEAR - 1
|
171
|
+
growdiff_year = tax_calc_year - 1
|
172
|
+
growdiff_dict = {'AWAGE': {growdiff_year: 0.01, tax_calc_year: 0.0}}
|
173
|
+
|
174
|
+
def default_calculator(growdiff_dictionary):
|
175
|
+
"""
|
176
|
+
Return CPS-based Calculator object using default LAST_BUDGET_YEAR.
|
177
|
+
"""
|
178
|
+
g_factors = GrowFactors()
|
179
|
+
gdiff = GrowDiff()
|
180
|
+
gdiff.update_growdiff(growdiff_dictionary)
|
181
|
+
gdiff.apply_to(g_factors)
|
182
|
+
pol = Policy(gfactors=g_factors)
|
183
|
+
rec = Records.cps_constructor(data=cps_fullsample, gfactors=g_factors)
|
184
|
+
calc = Calculator(policy=pol, records=rec)
|
185
|
+
return calc
|
186
|
+
|
187
|
+
def flexible_calculator(growdiff_dictionary, last_b_year):
|
188
|
+
"""
|
189
|
+
Return CPS-based Calculator object using custom LAST_BUDGET_YEAR.
|
190
|
+
"""
|
191
|
+
g_factors = GrowFactors()
|
192
|
+
gdiff = GrowDiff(last_budget_year=last_b_year)
|
193
|
+
gdiff.update_growdiff(growdiff_dictionary)
|
194
|
+
gdiff.apply_to(g_factors)
|
195
|
+
pol = Policy(gfactors=g_factors, last_budget_year=last_b_year)
|
196
|
+
rec = Records.cps_constructor(data=cps_fullsample, gfactors=g_factors)
|
197
|
+
calc = Calculator(policy=pol, records=rec)
|
198
|
+
return calc
|
199
|
+
|
200
|
+
# begin main test logic
|
201
|
+
cdef = default_calculator(growdiff_dict)
|
202
|
+
cdef.advance_to_year(tax_calc_year)
|
203
|
+
cdef.calc_all()
|
204
|
+
iitax_def = round(cdef.weighted_total('iitax'))
|
205
|
+
|
206
|
+
cflx = flexible_calculator(growdiff_dict, tax_calc_year)
|
207
|
+
cflx.advance_to_year(tax_calc_year)
|
208
|
+
cflx.calc_all()
|
209
|
+
iitax_flx = round(cflx.weighted_total('iitax'))
|
210
|
+
|
211
|
+
assert np.allclose([iitax_flx], [iitax_def])
|
taxcalc/tests/test_growdiff.py
CHANGED
@@ -8,9 +8,8 @@ import pytest
|
|
8
8
|
from taxcalc import GrowDiff, GrowFactors, Policy
|
9
9
|
|
10
10
|
|
11
|
-
def
|
11
|
+
def test_start_year_consistency():
|
12
12
|
assert GrowDiff.JSON_START_YEAR == Policy.JSON_START_YEAR
|
13
|
-
assert GrowDiff.DEFAULT_NUM_YEARS == Policy.DEFAULT_NUM_YEARS
|
14
13
|
|
15
14
|
|
16
15
|
def test_update_and_apply_growdiff():
|
@@ -22,14 +21,13 @@ def test_update_and_apply_growdiff():
|
|
22
21
|
}
|
23
22
|
gdiff.update_growdiff(diffs)
|
24
23
|
expected_wage_diffs = [0.00, 0.01, 0.01, 0.02, 0.02]
|
25
|
-
extra_years =
|
24
|
+
extra_years = gdiff.num_years - len(expected_wage_diffs)
|
26
25
|
expected_wage_diffs.extend([0.02] * extra_years)
|
27
26
|
assert np.allclose(gdiff._AWAGE, expected_wage_diffs, atol=0.0, rtol=0.0)
|
28
27
|
# apply growdiff to GrowFactors instance
|
29
28
|
gf = GrowFactors()
|
30
|
-
syr =
|
31
|
-
|
32
|
-
lyr = syr + nyrs - 1
|
29
|
+
syr = gdiff.start_year
|
30
|
+
lyr = gdiff.end_year
|
33
31
|
pir_pre = gf.price_inflation_rates(syr, lyr)
|
34
32
|
wgr_pre = gf.wage_growth_rates(syr, lyr)
|
35
33
|
gfactors = GrowFactors()
|
@@ -37,7 +35,7 @@ def test_update_and_apply_growdiff():
|
|
37
35
|
pir_pst = gfactors.price_inflation_rates(syr, lyr)
|
38
36
|
wgr_pst = gfactors.wage_growth_rates(syr, lyr)
|
39
37
|
expected_wgr_pst = [wgr_pre[i] + expected_wage_diffs[i]
|
40
|
-
for i in range(0,
|
38
|
+
for i in range(0, gdiff.num_years)]
|
41
39
|
assert np.allclose(pir_pre, pir_pst, atol=0.0, rtol=0.0)
|
42
40
|
assert np.allclose(wgr_pst, expected_wgr_pst, atol=1.0e-9, rtol=0.0)
|
43
41
|
|
taxcalc/tests/test_parameters.py
CHANGED
@@ -18,10 +18,10 @@ from taxcalc import (
|
|
18
18
|
Parameters,
|
19
19
|
Policy,
|
20
20
|
Consumption,
|
21
|
+
GrowDiff,
|
21
22
|
GrowFactors,
|
22
23
|
is_paramtools_format,
|
23
24
|
)
|
24
|
-
from taxcalc.growdiff import GrowDiff
|
25
25
|
|
26
26
|
|
27
27
|
# Test specification and use of simple Parameters-derived class that has
|
@@ -244,7 +244,7 @@ def test_json_file_contents(tests_path, fname):
|
|
244
244
|
elif fname == "growdiff.json":
|
245
245
|
o = GrowDiff()
|
246
246
|
param_list = []
|
247
|
-
for k in o:
|
247
|
+
for k in o:
|
248
248
|
if k[0].isupper(): # find parameters by case of first letter
|
249
249
|
param_list.append(k)
|
250
250
|
for param in param_list:
|
@@ -395,6 +395,7 @@ class ArrayParams(Parameters):
|
|
395
395
|
ArrayParams.NUM_YEARS,
|
396
396
|
**kwargs
|
397
397
|
)
|
398
|
+
self._gfactors = GrowFactors()
|
398
399
|
self._inflation_rates = [0.02] * self.num_years
|
399
400
|
self._wage_growth_rates = [0.03] * self.num_years
|
400
401
|
|
taxcalc/tests/test_policy.py
CHANGED
@@ -247,9 +247,9 @@ def test_multi_year_reform():
|
|
247
247
|
Test multi-year reform involving 1D and 2D parameters.
|
248
248
|
"""
|
249
249
|
# specify dimensions of policy Policy object
|
250
|
-
syr = Policy.JSON_START_YEAR
|
251
|
-
nyrs = Policy.DEFAULT_NUM_YEARS
|
252
250
|
pol = Policy()
|
251
|
+
syr = pol.start_year
|
252
|
+
nyrs = pol.num_years
|
253
253
|
iratelist = pol.inflation_rates()
|
254
254
|
ifactor = {}
|
255
255
|
for i in range(0, nyrs):
|
taxcalc/tests/test_reforms.py
CHANGED
@@ -383,4 +383,4 @@ def test_ext_reform(tests_path):
|
|
383
383
|
iitax_ext = calc_ext.array('iitax')
|
384
384
|
rdiff = iitax_ext - iitax_end
|
385
385
|
weighted_sum_rdiff = (rdiff * calc_end.array('s006')).sum() * 1.0e-9
|
386
|
-
assert np.allclose([weighted_sum_rdiff], [-
|
386
|
+
assert np.allclose([weighted_sum_rdiff], [-215.659], rtol=0.0, atol=0.01)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: taxcalc
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.4.0
|
4
4
|
Summary: taxcalc
|
5
5
|
Home-page: https://github.com/PSLmodels/Tax-Calculator
|
6
6
|
Download-URL: https://github.com/PSLmodels/Tax-Calculator
|
@@ -18,13 +18,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
19
19
|
Description-Content-Type: text/markdown
|
20
20
|
License-File: LICENSE
|
21
|
-
Requires-Dist:
|
22
|
-
Requires-Dist:
|
23
|
-
Requires-Dist:
|
24
|
-
Requires-Dist: bokeh
|
21
|
+
Requires-Dist: numpy>=1.26
|
22
|
+
Requires-Dist: pandas>=2.2
|
23
|
+
Requires-Dist: bokeh>=2.4
|
25
24
|
Requires-Dist: numba
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist: paramtools>=0.18.3
|
25
|
+
Requires-Dist: paramtools>=0.19.0
|
28
26
|
|
29
27
|
| | |
|
30
28
|
| --- | --- |
|