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.
- taxcalc/__init__.py +3 -3
- taxcalc/calcfunctions.py +2 -2
- taxcalc/calculator.py +4 -4
- taxcalc/cli/tc.py +16 -19
- taxcalc/data.py +2 -3
- taxcalc/decorators.py +9 -8
- taxcalc/growfactors.py +2 -1
- taxcalc/policy.py +6 -23
- taxcalc/policy_current_law.json +31 -631
- taxcalc/records.py +78 -82
- taxcalc/records_variables.json +106 -106
- taxcalc/reforms/ARPA.out.csv +9 -9
- taxcalc/taxcalcio.py +101 -77
- taxcalc/tests/conftest.py +20 -15
- taxcalc/tests/puf_var_correl_coeffs_2016.csv +24 -24
- taxcalc/tests/puf_var_wght_means_by_year.csv +11 -11
- taxcalc/tests/pufcsv_agg_expect.csv +20 -20
- taxcalc/tests/pufcsv_mtr_expect.txt +21 -21
- taxcalc/tests/reforms.json +3 -1
- taxcalc/tests/reforms_expect.csv +54 -54
- taxcalc/tests/test_4package.py +8 -9
- taxcalc/tests/test_calculator.py +55 -18
- taxcalc/tests/test_consumption.py +2 -2
- taxcalc/tests/test_cpscsv.py +2 -24
- taxcalc/tests/test_data.py +11 -3
- taxcalc/tests/test_decorators.py +57 -52
- taxcalc/tests/test_growdiff.py +2 -2
- taxcalc/tests/test_parameters.py +101 -53
- taxcalc/tests/test_policy.py +154 -154
- taxcalc/tests/test_records.py +144 -9
- taxcalc/tests/test_reforms.py +104 -104
- taxcalc/tests/test_taxcalcio.py +13 -62
- taxcalc/utils.py +3 -3
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/METADATA +3 -6
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/RECORD +39 -46
- taxcalc/puf_ratios.csv +0 -26
- taxcalc/puf_weights.csv.gz +0 -0
- taxcalc/reforms/clp.out.csv +0 -10
- taxcalc/tests/test_compare.py +0 -330
- taxcalc/tests/test_compatible_data.py +0 -334
- taxcalc/tests/test_puf_var_stats.py +0 -194
- taxcalc/tests/test_pufcsv.py +0 -328
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/WHEEL +0 -0
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/entry_points.txt +0 -0
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/licenses/LICENSE +0 -0
- {taxcalc-5.2.0.dist-info → taxcalc-6.0.0.dist-info}/top_level.txt +0 -0
taxcalc/utils.py
CHANGED
@@ -387,7 +387,7 @@ def create_distribution_table(vdf, groupby, income_measure,
|
|
387
387
|
dist_table.iloc[11] = topdec_row
|
388
388
|
del topdec_row
|
389
389
|
else:
|
390
|
-
dist_table.loc[
|
390
|
+
dist_table.loc['ALL'] = sum_row
|
391
391
|
del sum_row
|
392
392
|
# ensure dist_table columns are in correct order
|
393
393
|
assert dist_table.columns.values.tolist() == DIST_TABLE_COLUMNS
|
@@ -580,7 +580,7 @@ def create_difference_table(vdf1, vdf2, groupby, tax_to_diff,
|
|
580
580
|
diff_table.iloc[11] = topdec_row
|
581
581
|
del topdec_row
|
582
582
|
else:
|
583
|
-
diff_table.loc[
|
583
|
+
diff_table.loc['ALL'] = sum_row
|
584
584
|
# delete intermediate Pandas DataFrame objects
|
585
585
|
del gdf
|
586
586
|
del dframe
|
@@ -1603,7 +1603,7 @@ def json_to_dict(jsontext):
|
|
1603
1603
|
# if the 2nd group (capturing comments) is not None,
|
1604
1604
|
# it means we have captured a non-quoted (real) comment string.
|
1605
1605
|
if match.group(2) is not None:
|
1606
|
-
return
|
1606
|
+
return '\n' # preserve line numbers
|
1607
1607
|
# otherwise, we will return the 1st group
|
1608
1608
|
return match.group(1) # captured quoted-string
|
1609
1609
|
# begin main remove_comments function logic
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: taxcalc
|
3
|
-
Version:
|
3
|
+
Version: 6.0.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
|
@@ -12,9 +12,9 @@ Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
13
13
|
Classifier: Programming Language :: Python
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
19
19
|
Description-Content-Type: text/markdown
|
20
20
|
License-File: LICENSE
|
@@ -36,7 +36,7 @@ Dynamic: summary
|
|
36
36
|
| | |
|
37
37
|
| --- | --- |
|
38
38
|
| Org | [](https://www.PSLmodels.org) [](https://github.com/PSLmodels/Tax-Calculator/blob/master/LICENSE) [](https://pslmodels.github.io/Tax-Calculator/) |
|
39
|
-
| Package | [](https://www.python.org/downloads/release/python-3118/) [](https://www.python.org/downloads/release/python-3121/) [](https://www.python.org/downloads/release/python-3131/) [](https://pypi.org/project/taxcalc/) [](https://pypi.org/project/taxcalc/) [](https://anaconda.org/conda-forge/taxcalc)|
|
40
40
|
| Testing |   [](https://codecov.io/gh/PSLmodels/Tax-Calculator) |
|
41
41
|
|
42
42
|
|
@@ -57,6 +57,3 @@ explains the workflow involved in contributing model enhancements.
|
|
57
57
|
|
58
58
|
Complete documentation is available
|
59
59
|
[here](https://PSLmodels.github.io/Tax-Calculator/).
|
60
|
-
This documentation includes
|
61
|
-
[examples](https://taxcalc.pslmodels.org/usage/tcja_after_2025.html)
|
62
|
-
of how to analyze different ways of extending TCJA policy beyond 2025.
|
@@ -1,36 +1,34 @@
|
|
1
|
-
taxcalc/__init__.py,sha256=
|
2
|
-
taxcalc/calcfunctions.py,sha256=
|
3
|
-
taxcalc/calculator.py,sha256=
|
1
|
+
taxcalc/__init__.py,sha256=bx1f6yo5NhIJZFyNhOBAu1hfPUE-LyHd1l2Y-fMfpAc,536
|
2
|
+
taxcalc/calcfunctions.py,sha256=8XUhXncnsRkqDL-3uqH1Ew2HIMs3p-gf97KHRKnJZJM,135517
|
3
|
+
taxcalc/calculator.py,sha256=u7I5Wru2RTdo1G4tJ4RBGsAzrvx78VGUhZyegiIf8dg,64151
|
4
4
|
taxcalc/conftest.py,sha256=nO4J7qu1sTHgjqrzhpRMvfMJUrNm6GP_IsSuuDt_MeQ,141
|
5
5
|
taxcalc/consumption.json,sha256=FbGpsLP0W02sYc7o8N-BVz8Xw8hfk_gCr5MtHtgEBQQ,7615
|
6
6
|
taxcalc/consumption.py,sha256=pkXhFGpFqu7hW62KaTctfRSzR-pXzMB1ai8XCQRAgXk,3480
|
7
7
|
taxcalc/cps.csv.gz,sha256=SS6tSduU_Eu0EJwzpslnmqMsQQQucVMzzITfH-SeV40,9851074
|
8
8
|
taxcalc/cps_weights.csv.gz,sha256=-k31Swqss0WEGA3Zo8AoReLR_C7BRUk4PDmfh-oVVyo,13657706
|
9
|
-
taxcalc/data.py,sha256=
|
10
|
-
taxcalc/decorators.py,sha256=
|
9
|
+
taxcalc/data.py,sha256=8whYnj8qRZiYi6iUjLvRQbIZrUjj9zqIxNGcEJ933jw,11676
|
10
|
+
taxcalc/decorators.py,sha256=C8H4IpdCzioI0-aTCNHVjIxWsGh-_EZWryDEox2Dt1Q,11331
|
11
11
|
taxcalc/growdiff.json,sha256=GCMuFsHv5qP2HBzqiev3CbFJy0BXnhM2ShaPT2QuNTs,14601
|
12
12
|
taxcalc/growdiff.py,sha256=Q3St-KPIUN2I_l1S0jwN0yr8O4LuzkNIU-_qbXTkrZw,2977
|
13
13
|
taxcalc/growfactors.csv,sha256=URIGSKApCY4McvdILkCaIm8EhCGEME2Du-ef5Q9c0uE,5134
|
14
|
-
taxcalc/growfactors.py,sha256=
|
14
|
+
taxcalc/growfactors.py,sha256=OrYmlWMQAmoMe5fhgnPJcIdvFs0aDf9JBy2aU7J0kBQ,6576
|
15
15
|
taxcalc/parameters.py,sha256=ObwQMBlPjq3tyNwiR94Nj0zouIVsNaHIho-OQK1RNKg,35966
|
16
|
-
taxcalc/policy.py,sha256=
|
17
|
-
taxcalc/policy_current_law.json,sha256=
|
18
|
-
taxcalc/
|
19
|
-
taxcalc/
|
20
|
-
taxcalc/
|
21
|
-
taxcalc/
|
22
|
-
taxcalc/taxcalcio.py,sha256=_ylnC-dZUpDFn79F8pjkZEq-wJhPCQA7Ig9SRLyhrUA,37691
|
23
|
-
taxcalc/utils.py,sha256=Wsvni2UP7WgnByN4bRIiLGgamDFwfQoexiy420o6ewY,63666
|
16
|
+
taxcalc/policy.py,sha256=vLhqvbsOrImpb0BsRhmgdrnRCsOvPWUc_fTUSYq8yOM,8700
|
17
|
+
taxcalc/policy_current_law.json,sha256=_8OHMh4VsK4VJ7LN5aGQX_b_UbimYDqzsEt8P6NZaw4,608288
|
18
|
+
taxcalc/records.py,sha256=IrUlfM3AiVq2K_rp_jBOc5X2h6PKREQf_MmfgJDjdpY,17490
|
19
|
+
taxcalc/records_variables.json,sha256=-yo5d9kVvCgVCdx8E8bOiZlC_Pu-zjznjLeYWTiT4Uw,44583
|
20
|
+
taxcalc/taxcalcio.py,sha256=CjByunQKr6Jc-bSPZjso7bjb6KW5nMNVy3CaDdBdLyo,39047
|
21
|
+
taxcalc/utils.py,sha256=R12cGWrhVNNxuWfXVVlWiu5FGoxyX9tzrO_iKsW8mjg,63666
|
24
22
|
taxcalc/utilsprvt.py,sha256=iIyWp9-N3_XWjQj2jV2CWnJy7vrNlKB2_vIMwYjgbWY,1323
|
25
23
|
taxcalc/assumptions/ASSUMPTIONS.md,sha256=cFQqWn1nScaladVaQ7xNm1jDY8CsGdLmqZEzUZeRrb8,1917
|
26
24
|
taxcalc/assumptions/README.md,sha256=Ww55r2zH1neoRSl_MawrPmX-ugaztIZ7_ALrquuatdQ,809
|
27
25
|
taxcalc/assumptions/economic_assumptions_template.json,sha256=utMk38GwSQFrkOAtRrDVhMQLpfaZH3JmtTznKX7IouM,2610
|
28
26
|
taxcalc/cli/__init__.py,sha256=cyZ0tdx41j_vV_B6GAkqJmNKKG-B0wUC0ThC75lJlk4,104
|
29
|
-
taxcalc/cli/tc.py,sha256=
|
27
|
+
taxcalc/cli/tc.py,sha256=YAtcWnGcwTgT3DJIWbwfHAtonXav8k2X_yDV5fCxf8M,18760
|
30
28
|
taxcalc/reforms/2017_law.json,sha256=4QHE3gMKueXD3M97ODqA0LjofXUfSmwVvJA1FLclaqQ,5264
|
31
29
|
taxcalc/reforms/2017_law.out.csv,sha256=nnNKXqY2kof8HC1nnU8srPsvNNepi6ISXQ9OJpQnT7M,473
|
32
30
|
taxcalc/reforms/ARPA.json,sha256=6oGn3pZ4clAhjFHvqpmm7sXcm407Ea_8mjJchSscKpc,3203
|
33
|
-
taxcalc/reforms/ARPA.out.csv,sha256=
|
31
|
+
taxcalc/reforms/ARPA.out.csv,sha256=NBH9eOO_NYmr6FyIHK9AS0paof7o6Rz6AHODvEo-uLU,476
|
34
32
|
taxcalc/reforms/BrownKhanna.json,sha256=yydcFsixV28p1I5uB0VgwJJ5GyGL0JU8K-IUwrPHlzs,964
|
35
33
|
taxcalc/reforms/BrownKhanna.out.csv,sha256=D2pPxtH5RyMnf8wQad3R2W1Uh4ZLXa7MAQ_dQccMkPA,475
|
36
34
|
taxcalc/reforms/CARES.json,sha256=lTAt0waGCgyUZ3ayrBOoiifqJYVgf19JHdqGusg400o,1977
|
@@ -53,7 +51,6 @@ taxcalc/reforms/Trump2016.out.csv,sha256=TXPSVmc3rE-6-RTVjk632A041e3_p8WW6IjoyYi
|
|
53
51
|
taxcalc/reforms/Trump2017.json,sha256=sCaQkvFY66VPQa6GUzKbrsH5R3BxOcBwMuHE9Ypv0HU,1544
|
54
52
|
taxcalc/reforms/Trump2017.out.csv,sha256=By1quzZONFLQGK5E76mbNNFuORZ8aCGHpD1BR5iwTS8,474
|
55
53
|
taxcalc/reforms/cases.csv,sha256=JQ0LSnNeyl6xSgW5mimGUJMr7xwCWTOpiOpfwx2ETsg,570
|
56
|
-
taxcalc/reforms/clp.out.csv,sha256=qSUdI0LoQFGG6h24eT-249pLEqmxmt7TvLrv1HX_y3Y,475
|
57
54
|
taxcalc/reforms/ext.json,sha256=pD8bTjtb7NuYVrOd1IT8pqscKRMX2_5hkrTOQceSiVw,2309
|
58
55
|
taxcalc/reforms/growfactors_ext.csv,sha256=E0szWXtgV5jcpiyvREOz1yXw_poPIBC77bBQI1rlFxM,17733
|
59
56
|
taxcalc/reforms/ptaxes0.json,sha256=QkvqCVkI23sF7FvTHqaUYNpEJYuHNChbKwH0mH7Otp4,1718
|
@@ -75,34 +72,30 @@ taxcalc/reforms/archive/TCJA_Senate_120117.json,sha256=hruGq8bVtJEMmSsOIuTcWiYON
|
|
75
72
|
taxcalc/tests/benefits_expect.csv,sha256=CFpMpg8a-5iNVSRnmCnl9dncwXx6eGn-KSnTJ2GqmS4,4833
|
76
73
|
taxcalc/tests/cmpi_cps_expect.txt,sha256=NCyG3XhgnV8qJe9TaF9l-9yUuwNfANNDvFn1HcSfZ1c,6262
|
77
74
|
taxcalc/tests/cmpi_puf_expect.txt,sha256=dtHBPDY23qttxjQsPpxhLYoUId1tnPZ4uNHx49NlZ0s,6264
|
78
|
-
taxcalc/tests/conftest.py,sha256=
|
75
|
+
taxcalc/tests/conftest.py,sha256=XCqh5cZglHXyDd_zcpttlJk7nIV95IdxKTXlEC8zbeE,5371
|
79
76
|
taxcalc/tests/cpscsv_agg_expect.csv,sha256=80Sq2GlP2oz4vKJfrarYy4qRGWNxUs7DSBYV2qxesGk,3511
|
80
|
-
taxcalc/tests/puf_var_correl_coeffs_2016.csv,sha256=
|
81
|
-
taxcalc/tests/puf_var_wght_means_by_year.csv,sha256=
|
82
|
-
taxcalc/tests/pufcsv_agg_expect.csv,sha256=
|
83
|
-
taxcalc/tests/pufcsv_mtr_expect.txt,sha256=
|
84
|
-
taxcalc/tests/reforms.json,sha256=
|
85
|
-
taxcalc/tests/reforms_expect.csv,sha256=
|
86
|
-
taxcalc/tests/test_4package.py,sha256=
|
77
|
+
taxcalc/tests/puf_var_correl_coeffs_2016.csv,sha256=lQXyUEa9wAyhUEOtYm5j0p-cnzyswmViCNJwa22hztg,57314
|
78
|
+
taxcalc/tests/puf_var_wght_means_by_year.csv,sha256=ReclabBk9MVO8p1y62h9xNDoFw9anjXe8BmKiFEr0hk,12889
|
79
|
+
taxcalc/tests/pufcsv_agg_expect.csv,sha256=H9TCOhi_EksKNVa-Sp56cMGBxpCAD57xs3CHXzQNhp0,3545
|
80
|
+
taxcalc/tests/pufcsv_mtr_expect.txt,sha256=Y5-4ulrq2QWCceGhCQc60N2ulc7YTq7w-qf11mB74Os,4265
|
81
|
+
taxcalc/tests/reforms.json,sha256=dIP28djWy-fkPRI5gn7oXHLx_-bzB8KMlS77-1x8Ccc,17193
|
82
|
+
taxcalc/tests/reforms_expect.csv,sha256=AhrIJP2fON8d1exXJ6yLwnng0bm1X4dGn0IokP5ItQA,1354
|
83
|
+
taxcalc/tests/test_4package.py,sha256=bB8aHmeOchYPTdSYrzwQD3X5Gr-FmCdyu0Ykv3SSjaA,3573
|
87
84
|
taxcalc/tests/test_benefits.py,sha256=oaui5mO0TuW8Ht-uxvUCBL5zM3iTENq3Whyf_gEpY1U,3392
|
88
85
|
taxcalc/tests/test_calcfunctions.py,sha256=7uD1EW48TgsEE6pNHIxkXNi9gvZR7dbT7il6jAqgy9s,34653
|
89
|
-
taxcalc/tests/test_calculator.py,sha256=
|
90
|
-
taxcalc/tests/
|
91
|
-
taxcalc/tests/
|
92
|
-
taxcalc/tests/
|
93
|
-
taxcalc/tests/
|
94
|
-
taxcalc/tests/
|
95
|
-
taxcalc/tests/test_decorators.py,sha256=F31pt1S7jIgkgV62xMC-poWRzG7fzYVOJes9tOoCF40,10232
|
96
|
-
taxcalc/tests/test_growdiff.py,sha256=vXZTgPJTUi25mZrfmTPErytSC69Bs_36ydrQmWxgm9g,3420
|
86
|
+
taxcalc/tests/test_calculator.py,sha256=ZOqfg6yM93qivNnKiLZVC_OiCtdauDVN036ERPu6Wy8,35037
|
87
|
+
taxcalc/tests/test_consumption.py,sha256=CJ9xWtixcJXSpkVxyBrYC1jjQYGQHifsJ8IL1rK7BIk,6318
|
88
|
+
taxcalc/tests/test_cpscsv.py,sha256=pc-TGmAXcHL1_3g1Dyityad7Rm16Oem4YYOLMWS0t1g,7628
|
89
|
+
taxcalc/tests/test_data.py,sha256=xXbbVrBCgGJTyqxyk17LTxJbf2W1A93HOws-20G0aGk,4831
|
90
|
+
taxcalc/tests/test_decorators.py,sha256=hKM1_X_1U4YOat06UIAfsfbjr0WcDLQhuXhQfjlySr8,10309
|
91
|
+
taxcalc/tests/test_growdiff.py,sha256=-xUv33Bnzl5oB-DaIIkOqZ9375ULNCTrWam9LpvDwI8,3420
|
97
92
|
taxcalc/tests/test_growfactors.py,sha256=L-DQMR2fh_rOQa3Lx1CDVnB2Q73zXUfTYYVunt0heto,2796
|
98
|
-
taxcalc/tests/test_parameters.py,sha256=
|
99
|
-
taxcalc/tests/test_policy.py,sha256=
|
100
|
-
taxcalc/tests/
|
101
|
-
taxcalc/tests/
|
102
|
-
taxcalc/tests/test_records.py,sha256=ncswnbCY7vZgJ_h6xwql4oFw-jZG2gWOMWvEJC2_jdc,8827
|
103
|
-
taxcalc/tests/test_reforms.py,sha256=9wvMvCOQwafOBiVVGPU8IjgAD8JU6k58zfgEzF-yobU,16045
|
93
|
+
taxcalc/tests/test_parameters.py,sha256=LqN0zNfkvovzdDlFzS7CGF-mXAF_XTZd2Wb6ylqOugA,22102
|
94
|
+
taxcalc/tests/test_policy.py,sha256=rrJlh408be_cP7v6fa-k6hfiRuVH2FAYvGzxjIZAaUE,54902
|
95
|
+
taxcalc/tests/test_records.py,sha256=mB0BcEDzfrq1UHWGVRNf99xW-D9yjufAKtciAlTgDMw,13467
|
96
|
+
taxcalc/tests/test_reforms.py,sha256=IWOCWvq412hV1I7u_Tduj6kQM_IsyHBztgOT6Z2A5-w,15133
|
104
97
|
taxcalc/tests/test_responses.py,sha256=2CkVVdaDNCSALMoUcGgweRlS2tfsK3kXogHtDkZMqJU,1663
|
105
|
-
taxcalc/tests/test_taxcalcio.py,sha256=
|
98
|
+
taxcalc/tests/test_taxcalcio.py,sha256=OzSkDvqINcgPWg1ANErZ5L3fl2la8IRj1dw6_9rP798,22207
|
106
99
|
taxcalc/tests/test_utils.py,sha256=hqBVxddwcSP_6dEBccb-FlPMDm68EENzTtFaVVZ8exs,29403
|
107
100
|
taxcalc/validation/CSV_INPUT_VARS.md,sha256=MqlZZGt_a1n8JAU-nY5MjnTmjz1pMOuhtpVYIGUgl38,1433
|
108
101
|
taxcalc/validation/CSV_OUTPUT_VARS.md,sha256=wr8oyCJDXcxl4Lu0H_wMofUQYhEIyHDif6vkbas1FGE,3000
|
@@ -131,9 +124,9 @@ taxcalc/validation/taxsim35/expected_differences/b21-taxdiffs-expect.csv,sha256=
|
|
131
124
|
taxcalc/validation/taxsim35/expected_differences/c17-taxdiffs-expect.csv,sha256=YhgojbLowH3yujdYu7SGkdvBZmTgpugu4wYc1Be069M,1125
|
132
125
|
taxcalc/validation/taxsim35/expected_differences/c18-taxdiffs-expect.csv,sha256=g9J4BPbTySV-h-RcLvReJq9v1jscgiRSSZzi0taEA-k,1225
|
133
126
|
taxcalc/validation/taxsim35/expected_differences/c19-taxdiffs-expect.csv,sha256=Ceh15N_Xr3L7cpYjzGa-8NLCV3obc8PNHEhE5ZxSPhI,1238
|
134
|
-
taxcalc-
|
135
|
-
taxcalc-
|
136
|
-
taxcalc-
|
137
|
-
taxcalc-
|
138
|
-
taxcalc-
|
139
|
-
taxcalc-
|
127
|
+
taxcalc-6.0.0.dist-info/licenses/LICENSE,sha256=m5epLdB-_NXiY7NsEDgcHP4jDtJ4vOlRf5S3Jb-jraY,1299
|
128
|
+
taxcalc-6.0.0.dist-info/METADATA,sha256=PGKspEXSi4R_SU2zDezHX9q8Q2iPgpk6xUU3E6WCYtk,3509
|
129
|
+
taxcalc-6.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
130
|
+
taxcalc-6.0.0.dist-info/entry_points.txt,sha256=a3ZE1piRv683p27fOLdWZvVJXESkoslTOp5iXV7uVco,50
|
131
|
+
taxcalc-6.0.0.dist-info/top_level.txt,sha256=Wh8wTDHkA_cm4dn8IoUCviDyGgVQqwEQKPJnl8z6d4c,8
|
132
|
+
taxcalc-6.0.0.dist-info/RECORD,,
|
taxcalc/puf_ratios.csv
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
agi_bin,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
|
2
|
-
INT2011,1.0259,0.5597,0.9448,0.9681,0.9728,0.9464,0.8390,0.8997,0.9713,0.9239,0.9342,0.9413,0.9497,0.9510,0.9693,0.9702,0.9569,1.0123,1.7014
|
3
|
-
INT2012,0.7778,0.9454,0.8433,0.8157,0.7153,0.8101,0.7961,0.7940,0.8481,0.9063,0.9129,0.9181,1.0344,1.0435,1.0129,1.1436,1.0975,1.2339,1.3445
|
4
|
-
INT2013,1.1325,0.7670,0.7821,0.7778,0.8935,0.8699,0.9558,0.9051,0.8342,0.8596,0.9746,1.0272,1.0497,1.0505,1.0891,0.9632,1.0448,0.9690,1.1435
|
5
|
-
INT2014,0.9106,0.8669,0.8492,0.7737,0.8431,0.8802,0.9729,0.8834,0.8367,1.0108,0.8443,1.0534,1.0274,0.9291,1.0609,1.1524,1.0626,1.0728,1.0867
|
6
|
-
INT2015,0.9813,0.9511,0.9323,0.9470,0.9543,0.9246,0.9368,0.9315,0.9463,0.9699,0.9891,1.0163,0.9966,0.9906,1.0241,0.9827,1.0221,1.1437,1.1672
|
7
|
-
INT2016,0.9843,1.0086,1.0453,1.0314,1.0447,1.0342,1.0129,1.0016,1.0025,1.0175,0.9484,0.9531,0.9752,1.0131,1.0723,1.0130,1.0803,1.0810,0.9937
|
8
|
-
INT2017,0.9932,0.9174,0.8978,0.8924,0.8944,0.9131,0.9198,0.9410,0.9611,0.9787,1.0156,1.0693,1.0312,0.9881,0.9350,0.9756,0.9565,1.0484,1.1943
|
9
|
-
INT2018,0.9991,0.9744,0.9683,0.9667,0.9757,0.9725,0.9747,0.9779,0.9742,0.9969,0.9930,1.0038,1.0148,1.0067,1.0231,0.9898,1.0182,1.0911,0.9981
|
10
|
-
INT2019,0.9979,0.9771,0.9763,0.9903,0.9793,0.9805,0.9769,0.9852,0.9826,0.9938,0.9934,1.0109,1.0020,1.0074,0.9983,1.0006,1.0253,1.0282,1.0196
|
11
|
-
INT2020,1.0017,0.9799,0.9740,0.9756,0.9843,0.9849,0.9831,0.9833,0.9931,0.9964,0.9958,1.0114,1.0058,1.0047,1.0078,0.9991,1.0129,1.0113,1.0113
|
12
|
-
INT2021,0.9959,0.9797,0.9776,0.9780,0.9834,0.9898,0.9883,0.9869,0.9920,0.9978,1.0043,0.9974,1.0066,1.0119,1.0049,1.0040,1.0303,1.0085,1.0022
|
13
|
-
INT2022,1.0062,0.9815,0.9810,0.9783,0.9727,0.9820,0.9851,0.9893,0.9934,1.0049,1.0022,1.0050,1.0029,1.0041,1.0047,1.0044,1.0133,0.9990,1.0111
|
14
|
-
INT2023,0.9983,0.9812,0.9761,0.9789,0.9892,0.9893,0.9851,1.0197,0.9942,0.9956,1.0022,1.0012,1.0023,1.0074,1.0006,1.0093,1.0214,1.0020,0.9943
|
15
|
-
INT2024,1.0016,0.9843,0.9813,0.9791,0.9709,0.9789,0.9893,1.0102,0.9906,0.9984,0.9987,0.9971,1.0048,1.0076,1.0089,1.0075,1.0238,1.0148,1.0081
|
16
|
-
INT2025,1.0086,0.9934,0.9772,0.9767,0.9834,0.9817,1.0012,0.9941,0.9934,1.0008,0.9990,0.9978,1.0051,1.0074,1.0142,1.0150,1.0238,0.9941,0.9912
|
17
|
-
INT2026,1.0088,0.9843,0.9792,0.9796,0.9872,0.9904,0.9995,0.9909,0.9953,0.9939,0.9931,0.9932,1.0068,1.0143,1.0373,1.0250,1.0207,0.9992,0.9937
|
18
|
-
INT2027,1.0115,0.9888,0.9839,0.9805,0.9888,0.9905,0.9818,0.9951,0.9905,0.9944,0.9993,0.9913,1.0074,1.0184,1.0174,1.0275,1.0260,0.9935,0.9946
|
19
|
-
INT2028,1.0062,0.9977,0.9772,0.9829,0.9863,0.9878,1.0107,0.9957,0.9924,0.9955,0.9931,0.9921,1.0068,1.0177,1.0271,1.0221,1.0222,0.9960,0.9918
|
20
|
-
INT2029,1.0101,0.9939,0.9780,0.9801,0.9824,0.9852,1.0025,0.9850,0.9945,0.9933,0.9935,0.9928,1.0033,1.0285,1.0278,1.0474,1.0236,1.0012,0.9924
|
21
|
-
INT2030,1.0294,1.0010,0.9821,0.9840,0.9821,0.9917,0.9822,0.9867,0.9830,0.9890,0.9815,0.9921,1.0057,1.0359,1.0382,1.0449,1.0299,0.9948,0.9921
|
22
|
-
INT2031,1.0280,1.0214,0.9858,0.9918,0.9829,0.9887,0.9858,0.9780,0.9910,0.9938,0.9791,0.9870,0.9952,1.0446,1.0439,1.0732,1.0287,1.0061,0.9932
|
23
|
-
INT2032,1.0079,1.1010,0.9920,0.9811,0.9867,0.9849,0.9881,0.9740,0.9732,0.9791,0.9659,0.9835,0.9898,1.0786,1.0904,1.1373,1.0482,1.0099,0.9984
|
24
|
-
INT2033,0.9352,0.8345,0.9707,0.9751,0.9896,0.9848,0.9879,1.0383,1.0312,1.0351,1.1159,1.0745,1.0375,0.8504,0.8247,0.7425,0.8974,1.0566,1.0930
|
25
|
-
INT2034,1.0278,0.9998,0.9801,0.9801,0.9905,0.9881,0.9984,0.9804,0.9885,0.9931,0.9775,0.9842,1.0026,1.0381,1.0368,1.0580,1.0409,1.0028,0.9939
|
26
|
-
INT2035,1.0241,1.0200,0.9891,0.9840,0.9837,0.9859,0.9885,0.9688,0.9850,0.9882,0.9774,0.9926,1.0011,1.0428,1.0542,1.0592,1.0396,0.9982,0.9941
|
taxcalc/puf_weights.csv.gz
DELETED
Binary file
|
taxcalc/reforms/clp.out.csv
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
RECID,c00100,standard,c04800,iitax,payrolltax
|
2
|
-
11,30000.00,12400.00,17600.00,114.50,4590.00
|
3
|
-
12,60000.00,12400.00,47600.00,4462.00,9180.00
|
4
|
-
13,460000.00,12400.00,447600.00,133795.00,30414.80
|
5
|
-
21,60000.00,24800.00,35200.00,-3771.00,9180.00
|
6
|
-
22,120000.00,24800.00,95200.00,4924.00,18360.00
|
7
|
-
23,240000.00,24800.00,215200.00,35807.00,36720.00
|
8
|
-
31,30000.00,18650.00,11350.00,-4543.93,4590.00
|
9
|
-
32,60000.00,18650.00,41350.00,880.00,9180.00
|
10
|
-
33,120000.00,18650.00,101350.00,13537.00,18360.00
|
taxcalc/tests/test_compare.py
DELETED
@@ -1,330 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Compares Tax-Calculator PUF and CPS results with historical information.
|
3
|
-
"""
|
4
|
-
# CODING-STYLE CHECKS:
|
5
|
-
# pycodestyle test_compare.py
|
6
|
-
# pylint --disable=locally-disabled test_compare.py
|
7
|
-
|
8
|
-
import os
|
9
|
-
import pytest
|
10
|
-
import numpy as np
|
11
|
-
from taxcalc.policy import Policy
|
12
|
-
from taxcalc.records import Records
|
13
|
-
from taxcalc.calculator import Calculator
|
14
|
-
from taxcalc.utils import add_income_table_row_variable, SOI_AGI_BINS
|
15
|
-
|
16
|
-
|
17
|
-
# 2015 IRS-SOI amounts by AGI category are from "Table 3.3 All Returns: Tax
|
18
|
-
# Liability, Tax Credits, and Tax Payments by Size of Adjusted Gross Income,
|
19
|
-
# Tax Year 2015" which is available as a spreadsheet at this URL:
|
20
|
-
# <https://www.irs.gov/statistics/soi-tax-stats-individual-
|
21
|
-
# statistical-tables-by-size-of-adjusted-gross-income>
|
22
|
-
# The IRS-SOI amounts are from 19 rows in the spreadsheet numbered from
|
23
|
-
# 11 (AGI under one dollar) through 29 (AGI $10M or more).
|
24
|
-
# Dollar IRS-SOI amounts are expressed in billions of dollars and rounded
|
25
|
-
# to the nearest one-tenth of a million dollars.
|
26
|
-
ITAX = {
|
27
|
-
'0:EITC': {
|
28
|
-
# Full earned income credit
|
29
|
-
# in 2015 using the IRS-SOI information described above.
|
30
|
-
# EITC is column (37) in the Table 3.3 spreadsheet,
|
31
|
-
# which is the sum of columns (47), (75) and (97).
|
32
|
-
'SOI': [0.2104,
|
33
|
-
1.1843,
|
34
|
-
7.1562,
|
35
|
-
16.5927,
|
36
|
-
15.8799,
|
37
|
-
11.1025,
|
38
|
-
7.5150,
|
39
|
-
7.4528,
|
40
|
-
1.3936,
|
41
|
-
0.0375,
|
42
|
-
0.0000,
|
43
|
-
0.0000,
|
44
|
-
0.0000,
|
45
|
-
0.0000,
|
46
|
-
0.0000,
|
47
|
-
0.0000,
|
48
|
-
0.0000,
|
49
|
-
0.0000,
|
50
|
-
0.0000],
|
51
|
-
'TC': ['eitc']
|
52
|
-
},
|
53
|
-
|
54
|
-
'1:FCTC': {
|
55
|
-
# Full (basic and additional, refundable and nonrefundable) child tax
|
56
|
-
# credit in 2015 using the IRS-SOI information described above.
|
57
|
-
# FCTC is sum of columns (13) and (39) in the Table 3.3 spreadsheet.
|
58
|
-
'SOI': [0.1301,
|
59
|
-
0.0793,
|
60
|
-
1.4740,
|
61
|
-
4.2580,
|
62
|
-
5.2104,
|
63
|
-
4.6582,
|
64
|
-
4.3166,
|
65
|
-
7.2320,
|
66
|
-
5.2848,
|
67
|
-
9.4151,
|
68
|
-
6.4075,
|
69
|
-
5.2222,
|
70
|
-
0.0018,
|
71
|
-
0.0000,
|
72
|
-
0.0000,
|
73
|
-
0.0000,
|
74
|
-
0.0000,
|
75
|
-
0.0000,
|
76
|
-
0.0000],
|
77
|
-
'TC': ['c07220', # FCTC that is nonrefundable
|
78
|
-
'c11070'] # FCTC that isrefundable
|
79
|
-
},
|
80
|
-
|
81
|
-
'2:NIIT': {
|
82
|
-
# Net investment income tax
|
83
|
-
# in 2015 using the IRS-SOI information described above.
|
84
|
-
# NIIT is column (53) in the Table 3.3 spreadsheet.
|
85
|
-
# NIIT is included in Tax-Calculator individual income tax liability.
|
86
|
-
'SOI': [0.0004,
|
87
|
-
0.0000,
|
88
|
-
0.0000,
|
89
|
-
0.0000,
|
90
|
-
0.0000,
|
91
|
-
0.0000,
|
92
|
-
0.0001,
|
93
|
-
0.0000,
|
94
|
-
0.0000,
|
95
|
-
0.0014,
|
96
|
-
0.0005,
|
97
|
-
0.0213,
|
98
|
-
2.6397,
|
99
|
-
3.1356,
|
100
|
-
1.6715,
|
101
|
-
1.0775,
|
102
|
-
3.1267,
|
103
|
-
2.0949,
|
104
|
-
8.2730],
|
105
|
-
'TC': ['niit']
|
106
|
-
},
|
107
|
-
|
108
|
-
'3:ITAX': {
|
109
|
-
# Total income tax liability
|
110
|
-
# in 2015 using the IRS-SOI information described above.
|
111
|
-
# ITAX is column (55) in the Table 3.3 spreadsheet,
|
112
|
-
# which includes NIIT and is after all credits.
|
113
|
-
'SOI': [0.2425,
|
114
|
-
0.0409,
|
115
|
-
0.3680,
|
116
|
-
1.3813,
|
117
|
-
3.5238,
|
118
|
-
6.1911,
|
119
|
-
8.7526,
|
120
|
-
25.1677,
|
121
|
-
32.5302,
|
122
|
-
99.7918,
|
123
|
-
105.9015,
|
124
|
-
316.3496,
|
125
|
-
299.8322,
|
126
|
-
154.3888,
|
127
|
-
66.3236,
|
128
|
-
39.6716,
|
129
|
-
101.4885,
|
130
|
-
56.3344,
|
131
|
-
139.6113],
|
132
|
-
'TC': ['iitax']
|
133
|
-
},
|
134
|
-
|
135
|
-
'4:SETAX': {
|
136
|
-
# Self-employment tax
|
137
|
-
# in 2015 using the IRS-SOI information described above.
|
138
|
-
# SETAX is column (59) in the Table 3.3 spreadsheet,
|
139
|
-
# which is not part of ITAX but is part of total payroll taxes.
|
140
|
-
'SOI': [0.6557,
|
141
|
-
0.5554,
|
142
|
-
1.8956,
|
143
|
-
3.5143,
|
144
|
-
2.8228,
|
145
|
-
1.9959,
|
146
|
-
1.8020,
|
147
|
-
3.3598,
|
148
|
-
2.8199,
|
149
|
-
5.9579,
|
150
|
-
5.2751,
|
151
|
-
12.1488,
|
152
|
-
9.6864,
|
153
|
-
3.4864,
|
154
|
-
1.1938,
|
155
|
-
0.6432,
|
156
|
-
1.2527,
|
157
|
-
0.4698,
|
158
|
-
0.6383],
|
159
|
-
'TC': ['setax']
|
160
|
-
},
|
161
|
-
|
162
|
-
'5:AMTAX': {
|
163
|
-
# Additional Medicare tax
|
164
|
-
# in 2015 using the IRS-SOI information described above.
|
165
|
-
# AMTAX is column (71) in the Table 3.3 spreadsheet,
|
166
|
-
# which is not part of ITAX but is part of total payroll taxes.
|
167
|
-
'SOI': [0.0225,
|
168
|
-
0.0003,
|
169
|
-
0.0000,
|
170
|
-
0.0002,
|
171
|
-
0.0002,
|
172
|
-
0.0004,
|
173
|
-
0.0002,
|
174
|
-
0.0041,
|
175
|
-
0.0071,
|
176
|
-
0.0057,
|
177
|
-
0.0026,
|
178
|
-
0.0372,
|
179
|
-
1.8356,
|
180
|
-
2.0214,
|
181
|
-
0.8602,
|
182
|
-
0.4898,
|
183
|
-
1.1730,
|
184
|
-
0.5805,
|
185
|
-
0.9787],
|
186
|
-
'TC': ['ptax_amc']
|
187
|
-
}
|
188
|
-
}
|
189
|
-
|
190
|
-
|
191
|
-
def comparison(cname, calc, cmpdata, ofile):
|
192
|
-
"""
|
193
|
-
Write comparison results for cname to ofile.
|
194
|
-
"""
|
195
|
-
# pylint: disable=too-many-locals
|
196
|
-
# generate compare table for cvarname
|
197
|
-
vardf = calc.dataframe(['s006', 'c00100']) # weight and AGI
|
198
|
-
# add compare variable to vardf
|
199
|
-
cvar = np.zeros(calc.array_len)
|
200
|
-
for var in cmpdata[cname]['TC']:
|
201
|
-
cvar += calc.array(var)
|
202
|
-
vardf['cvar'] = cvar
|
203
|
-
# construct AGI table
|
204
|
-
vardf = add_income_table_row_variable(vardf, 'c00100', SOI_AGI_BINS)
|
205
|
-
gbydf = vardf.groupby('table_row', as_index=False, observed=True)
|
206
|
-
# write AGI table with ALL row at bottom of ofile
|
207
|
-
ofile.write(f'TABLE for {cname.split(":")[1]}\n')
|
208
|
-
results = '{:23s}\t{:8.3f}\t{:8.3f}\t{:+6.1f}\n'
|
209
|
-
colhead = f'{"AGIcategory":23s}\t{"T-C":>8s}\t{"SOI":>8s}\t{"%diff":>6s}\n'
|
210
|
-
ofile.write(colhead)
|
211
|
-
# pylint: disable=consider-using-f-string
|
212
|
-
txc_tot = 0.
|
213
|
-
soi_tot = 0.
|
214
|
-
idx = 0
|
215
|
-
for grp_interval, grp in gbydf:
|
216
|
-
txc = (grp['cvar'] * grp['s006']).sum() * 1e-9
|
217
|
-
soi = cmpdata[cname]['SOI'][idx]
|
218
|
-
txc_tot += txc
|
219
|
-
soi_tot += soi
|
220
|
-
if soi > 0:
|
221
|
-
pct_diff = 100. * ((txc / soi) - 1.)
|
222
|
-
else:
|
223
|
-
pct_diff = np.nan
|
224
|
-
glabel = f'[{grp_interval.left:.8g}, {grp_interval.right:.8g})'
|
225
|
-
ofile.write(results.format(glabel, txc, soi, pct_diff))
|
226
|
-
idx += 1
|
227
|
-
pct_diff = 100. * ((txc_tot / soi_tot) - 1.)
|
228
|
-
ofile.write(results.format('ALL', txc_tot, soi_tot, pct_diff))
|
229
|
-
# pylint: enable=consider-using-f-string
|
230
|
-
|
231
|
-
|
232
|
-
def nonsmall_diffs(linelist1, linelist2, small=0.0):
|
233
|
-
"""
|
234
|
-
Return True if line lists differ significantly; otherwise return False.
|
235
|
-
Significant numerical difference means one or more numbers differ (between
|
236
|
-
linelist1 and linelist2) by more than the specified small amount.
|
237
|
-
"""
|
238
|
-
# embedded function used only in nonsmall_diffs function
|
239
|
-
def isfloat(value):
|
240
|
-
"""
|
241
|
-
Return True if value can be cast to float; otherwise return False.
|
242
|
-
"""
|
243
|
-
try:
|
244
|
-
float(value)
|
245
|
-
return True
|
246
|
-
except ValueError:
|
247
|
-
return False
|
248
|
-
# begin nonsmall_diffs logic
|
249
|
-
assert isinstance(linelist1, list)
|
250
|
-
assert isinstance(linelist2, list)
|
251
|
-
if len(linelist1) != len(linelist2):
|
252
|
-
return True
|
253
|
-
assert 0.0 <= small <= 1.0
|
254
|
-
epsilon = 1e-6
|
255
|
-
smallamt = small + epsilon
|
256
|
-
for line1, line2 in zip(linelist1, linelist2):
|
257
|
-
if line1 == line2:
|
258
|
-
continue
|
259
|
-
tokens1 = line1.replace(',', '').split()
|
260
|
-
tokens2 = line2.replace(',', '').split()
|
261
|
-
for tok1, tok2 in zip(tokens1, tokens2):
|
262
|
-
tok1_isfloat = isfloat(tok1)
|
263
|
-
tok2_isfloat = isfloat(tok2)
|
264
|
-
if tok1_isfloat and tok2_isfloat:
|
265
|
-
if abs(float(tok1) - float(tok2)) <= smallamt:
|
266
|
-
continue
|
267
|
-
return True
|
268
|
-
if not tok1_isfloat and not tok2_isfloat:
|
269
|
-
if tok1 == tok2:
|
270
|
-
continue
|
271
|
-
return True
|
272
|
-
return True
|
273
|
-
return False
|
274
|
-
|
275
|
-
|
276
|
-
def differences(afilename, efilename):
|
277
|
-
"""
|
278
|
-
Check for differences between results in afilename and efilename files.
|
279
|
-
"""
|
280
|
-
with open(afilename, 'r', encoding='utf-8') as afile:
|
281
|
-
actres = afile.read()
|
282
|
-
with open(efilename, 'r', encoding='utf-8') as efile:
|
283
|
-
expres = efile.read()
|
284
|
-
diffs = nonsmall_diffs(actres.splitlines(True),
|
285
|
-
expres.splitlines(True), 0.0)
|
286
|
-
if diffs:
|
287
|
-
afname = os.path.basename(afilename)
|
288
|
-
efname = os.path.basename(efilename)
|
289
|
-
msg = 'COMPARE RESULTS DIFFER\n'
|
290
|
-
msg += '-------------------------------------------------\n'
|
291
|
-
msg += f'--- NEW RESULTS IN {afname} FILE ---\n'
|
292
|
-
msg += f'--- if new OK, copy {afname} to ---\n'
|
293
|
-
msg += f'--- {efname} ---\n'
|
294
|
-
msg += '--- and rerun test. ---\n'
|
295
|
-
msg += '-------------------------------------------------\n'
|
296
|
-
raise ValueError(msg)
|
297
|
-
os.remove(afilename)
|
298
|
-
|
299
|
-
|
300
|
-
@pytest.mark.pre_release
|
301
|
-
@pytest.mark.requires_pufcsv
|
302
|
-
@pytest.mark.parametrize('using_puf', [True, False])
|
303
|
-
def test_itax_compare(tests_path, using_puf, puf_fullsample, cps_fullsample):
|
304
|
-
"""
|
305
|
-
Conduct income tax comparisons using ITAX data.
|
306
|
-
"""
|
307
|
-
using_puf_adjust_ratios = True
|
308
|
-
# generate 2015 estimates by AGI category using Tax-Calculator
|
309
|
-
if using_puf:
|
310
|
-
if using_puf_adjust_ratios:
|
311
|
-
recs = Records(data=puf_fullsample)
|
312
|
-
else:
|
313
|
-
recs = Records(data=puf_fullsample, adjust_ratios=None)
|
314
|
-
else:
|
315
|
-
recs = Records.cps_constructor(data=cps_fullsample)
|
316
|
-
calc = Calculator(policy=Policy(), records=recs, verbose=False)
|
317
|
-
calc.advance_to_year(2015)
|
318
|
-
calc.calc_all()
|
319
|
-
# open actual output file
|
320
|
-
if using_puf:
|
321
|
-
afilename = os.path.join(tests_path, 'cmpi_puf_actual.txt')
|
322
|
-
else:
|
323
|
-
afilename = os.path.join(tests_path, 'cmpi_cps_actual.txt')
|
324
|
-
with open(afilename, 'w', encoding='utf-8') as afile:
|
325
|
-
# write compare results to afile
|
326
|
-
for cname in sorted(ITAX.keys()):
|
327
|
-
comparison(cname, calc, ITAX, afile)
|
328
|
-
# check for differences between actual and expect output files
|
329
|
-
efilename = afilename.replace('actual', 'expect')
|
330
|
-
differences(afilename, efilename)
|