taxcalc 4.6.3__py3-none-any.whl → 5.0.4__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/calcfunctions.py +295 -684
- taxcalc/calculator.py +12 -9
- taxcalc/consumption.json +0 -16
- taxcalc/growdiff.json +2 -18
- taxcalc/parameters.py +1 -4
- taxcalc/policy.py +45 -30
- taxcalc/policy_current_law.json +4416 -7535
- taxcalc/records.py +3 -0
- taxcalc/records_variables.json +34 -40
- taxcalc/reforms/2017_law.json +1 -15
- taxcalc/reforms/ARPA.json +6 -6
- taxcalc/reforms/Larson2019.json +3 -3
- taxcalc/reforms/TCJA.json +2 -30
- taxcalc/reforms/Trump2016.json +1 -16
- taxcalc/reforms/Trump2017.json +1 -10
- taxcalc/reforms/ext.json +1 -15
- taxcalc/tests/conftest.py +2 -2
- taxcalc/tests/pufcsv_agg_expect.csv +2 -2
- taxcalc/tests/reforms.json +37 -89
- taxcalc/tests/reforms_expect.csv +32 -35
- taxcalc/tests/test_calcfunctions.py +94 -17
- taxcalc/tests/test_calculator.py +9 -81
- taxcalc/tests/test_compatible_data.py +0 -6
- taxcalc/tests/test_parameters.py +31 -19
- taxcalc/tests/test_policy.py +5 -31
- taxcalc/tests/test_pufcsv.py +0 -56
- taxcalc/tests/test_reforms.py +2 -2
- taxcalc/tests/test_utils.py +59 -59
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/METADATA +1 -1
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/RECORD +35 -35
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/WHEEL +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/entry_points.txt +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/licenses/LICENSE +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.4.dist-info}/top_level.txt +0 -0
taxcalc/calculator.py
CHANGED
@@ -14,15 +14,14 @@ import paramtools
|
|
14
14
|
from taxcalc.calcfunctions import (TaxInc, SchXYZTax, GainsTax, AGIsurtax,
|
15
15
|
NetInvIncTax, AMT, EI_PayrollTax, Adj,
|
16
16
|
DependentCare, ALD_InvInc_ec_base, CapGains,
|
17
|
-
SSBenefits, UBI, AGI,
|
18
|
-
StdDed, AdditionalMedicareTax,
|
19
|
-
RefundablePayrollTaxCredit,
|
17
|
+
SSBenefits, UBI, AGI, AutoLoanInterestDed,
|
18
|
+
ItemDed, StdDed, AdditionalMedicareTax,
|
19
|
+
F2441, EITC, RefundablePayrollTaxCredit,
|
20
20
|
ChildDepTaxCredit, AdditionalCTC, CTC_new,
|
21
21
|
PersonalTaxCredit, SchR,
|
22
22
|
AmOppCreditParts, EducationTaxCredit,
|
23
23
|
CharityCredit,
|
24
24
|
NonrefundableCredits, C1040, IITAX,
|
25
|
-
BenefitSurtax, BenefitLimitation,
|
26
25
|
FairShareTax, LumpSumTax, BenefitPrograms,
|
27
26
|
ExpandIncome, AfterTaxIncome)
|
28
27
|
from taxcalc.policy import Policy
|
@@ -171,8 +170,6 @@ class Calculator():
|
|
171
170
|
UBI(self.__policy, self.__records)
|
172
171
|
BenefitPrograms(self)
|
173
172
|
self._calc_one_year(zero_out_calc_vars)
|
174
|
-
BenefitSurtax(self)
|
175
|
-
BenefitLimitation(self)
|
176
173
|
FairShareTax(self.__policy, self.__records)
|
177
174
|
LumpSumTax(self.__policy, self.__records)
|
178
175
|
ExpandIncome(self.__policy, self.__records)
|
@@ -1207,7 +1204,10 @@ class Calculator():
|
|
1207
1204
|
pval = getattr(updated, pname).tolist()[0]
|
1208
1205
|
if mdata_base[pname]['type'] == 'bool':
|
1209
1206
|
if isinstance(pval, list):
|
1210
|
-
pval =
|
1207
|
+
pval = ( # pragma: no cover
|
1208
|
+
# there are no bool list parameters
|
1209
|
+
[bool(item) for item in pval]
|
1210
|
+
)
|
1211
1211
|
else:
|
1212
1212
|
pval = bool(pval)
|
1213
1213
|
doc += f' {pname} : {pval}\n'
|
@@ -1245,7 +1245,10 @@ class Calculator():
|
|
1245
1245
|
ptype = mdata_base[pname]['type']
|
1246
1246
|
if isinstance(pval, list):
|
1247
1247
|
if ptype == 'bool':
|
1248
|
-
pval =
|
1248
|
+
pval = ( # pragma: no cover
|
1249
|
+
# there are no bool list parameters
|
1250
|
+
[bool(item) for item in pval]
|
1251
|
+
)
|
1249
1252
|
elif ptype == 'bool':
|
1250
1253
|
pval = bool(pval)
|
1251
1254
|
doc += f' baseline_value: {pval}\n'
|
@@ -1388,7 +1391,7 @@ class Calculator():
|
|
1388
1391
|
CapGains(self.__policy, self.__records)
|
1389
1392
|
SSBenefits(self.__policy, self.__records)
|
1390
1393
|
AGI(self.__policy, self.__records)
|
1391
|
-
|
1394
|
+
AutoLoanInterestDed(self.__policy, self.__records)
|
1392
1395
|
ItemDed(self.__policy, self.__records)
|
1393
1396
|
AdditionalMedicareTax(self.__policy, self.__records)
|
1394
1397
|
StdDed(self.__policy, self.__records)
|
taxcalc/consumption.json
CHANGED
@@ -24,22 +24,6 @@
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
},
|
27
|
-
"idedtype": {
|
28
|
-
"type": "str",
|
29
|
-
"validators": {
|
30
|
-
"choice": {
|
31
|
-
"choices": [
|
32
|
-
"med",
|
33
|
-
"sltx",
|
34
|
-
"retx",
|
35
|
-
"cas",
|
36
|
-
"misc",
|
37
|
-
"int",
|
38
|
-
"char"
|
39
|
-
]
|
40
|
-
}
|
41
|
-
}
|
42
|
-
},
|
43
27
|
"EIC": {
|
44
28
|
"type": "str",
|
45
29
|
"validators": {
|
taxcalc/growdiff.json
CHANGED
@@ -24,22 +24,6 @@
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
},
|
27
|
-
"idedtype": {
|
28
|
-
"type": "str",
|
29
|
-
"validators": {
|
30
|
-
"choice": {
|
31
|
-
"choices": [
|
32
|
-
"med",
|
33
|
-
"sltx",
|
34
|
-
"retx",
|
35
|
-
"cas",
|
36
|
-
"misc",
|
37
|
-
"int",
|
38
|
-
"char"
|
39
|
-
]
|
40
|
-
}
|
41
|
-
}
|
42
|
-
},
|
43
27
|
"EIC": {
|
44
28
|
"type": "str",
|
45
29
|
"validators": {
|
@@ -298,7 +282,7 @@
|
|
298
282
|
},
|
299
283
|
"ATXPY": {
|
300
284
|
"title": "ATXPY additive difference from default projection",
|
301
|
-
"description": "Default projection is in growfactors.csv file. ATXPY extrapolates input variables: e00700, e00800, e01400, e01500, e01700, e03150, e03210, e03220, e03230, e03300, e03400, e03500, e07240, e07260, p08000, e09700, e09800, e09900, e11200, e18400, e18500, e19800, e20100, e20400, g20500, e07600, e32800, e58990, e62900, e87530, e87521 and
|
285
|
+
"description": "Default projection is in growfactors.csv file. ATXPY extrapolates input variables: e00700, e00800, e01400, e01500, e01700, e03150, e03210, e03220, e03230, e03300, e03400, e03500, e07240, e07260, p08000, e09700, e09800, e09900, e11200, e18400, e18500, e19800, e20100, e20400, g20500, e07600, e32800, e58990, e62900, e87530, e87521, cmbtp, and auto_loan_interest.",
|
302
286
|
"type": "float",
|
303
287
|
"value": [
|
304
288
|
{
|
@@ -332,7 +316,7 @@
|
|
332
316
|
},
|
333
317
|
"AWAGE": {
|
334
318
|
"title": "AWAGE additive difference from default projection",
|
335
|
-
"description": "Default projection is in growfactors.csv file. AWAGE extrapolates input variables: e00200, e00200p and
|
319
|
+
"description": "Default projection is in growfactors.csv file. AWAGE extrapolates input variables: e00200, e00200p, e00200s, overtime_income, and tip_income. Also, AWAGE is the wage growth rate used to inflate the OASDI maximum taxable earnings policy parameter, _SS_Earnings_c. Note that non-zero values of this parameter will not affect historically known values of _SS_Earnings_c.",
|
336
320
|
"type": "float",
|
337
321
|
"value": [
|
338
322
|
{
|
taxcalc/parameters.py
CHANGED
@@ -327,8 +327,6 @@ class Parameters(paramtools.Parameters):
|
|
327
327
|
# that revert to their pre-TCJA values.
|
328
328
|
long_params = ['II_brk7', 'II_brk6', 'II_brk5', 'II_brk4',
|
329
329
|
'II_brk3', 'II_brk2', 'II_brk1',
|
330
|
-
'PT_brk7', 'PT_brk6', 'PT_brk5', 'PT_brk4',
|
331
|
-
'PT_brk3', 'PT_brk2', 'PT_brk1',
|
332
330
|
'PT_qbid_taxinc_thd',
|
333
331
|
'ALD_BusinessLosses_c',
|
334
332
|
'STD', 'II_em', 'II_em_ps',
|
@@ -837,13 +835,12 @@ class Parameters(paramtools.Parameters):
|
|
837
835
|
# params_to_trace = ['II_em']
|
838
836
|
# params_to_trace = ['II_brk3']
|
839
837
|
params_to_trace = ['EITC_c']
|
840
|
-
# params_to_trace = ['ID_AmountCap_Switch']
|
841
838
|
if trace and param in params_to_trace: # pragma: no cover
|
842
839
|
vlabel = None
|
843
840
|
vvalue = None
|
844
841
|
if len(extend_vo) > 2:
|
845
842
|
extend_vo_keys = extend_vo.keys()
|
846
|
-
vo_labels = ['MARS', 'EIC'
|
843
|
+
vo_labels = ['MARS', 'EIC']
|
847
844
|
for vo_label in vo_labels:
|
848
845
|
if vo_label in extend_vo_keys:
|
849
846
|
vlabel = vo_label
|
taxcalc/policy.py
CHANGED
@@ -55,29 +55,52 @@ class Policy(Parameters):
|
|
55
55
|
return last_budget_year - Policy.JSON_START_YEAR + 1
|
56
56
|
|
57
57
|
# NOTE: the following three data structures use internal parameter names:
|
58
|
-
# (1) specify which Policy parameters have been removed or renamed
|
58
|
+
# (1) specify which Policy parameters have been removed or renamed recently
|
59
|
+
# where "recently" means in the last major release
|
59
60
|
REMOVED_PARAMS = {
|
60
|
-
# following
|
61
|
-
'
|
62
|
-
'
|
63
|
-
|
64
|
-
'
|
65
|
-
'
|
66
|
-
|
67
|
-
'
|
68
|
-
'was
|
69
|
-
'
|
70
|
-
'was
|
71
|
-
'
|
72
|
-
'was
|
73
|
-
'
|
74
|
-
'was
|
75
|
-
'
|
76
|
-
'
|
77
|
-
'was
|
78
|
-
'
|
61
|
+
# following parameters were renamed in PR 2918
|
62
|
+
'SS_thd50': 'was renamed SS_thd1 in Tax-Calculator 5.0.0',
|
63
|
+
'SS_thd85': 'was renamed SS_thd2 in Tax-Calculator 5.0.0',
|
64
|
+
# following parameters were removed in PR 2619
|
65
|
+
'PT_rt1': 'was removed in Tax-Calculator 5.0.0',
|
66
|
+
'PT_rt2': 'was removed in Tax-Calculator 5.0.0',
|
67
|
+
'PT_rt3': 'was removed in Tax-Calculator 5.0.0',
|
68
|
+
'PT_rt4': 'was removed in Tax-Calculator 5.0.0',
|
69
|
+
'PT_rt5': 'was removed in Tax-Calculator 5.0.0',
|
70
|
+
'PT_rt6': 'was removed in Tax-Calculator 5.0.0',
|
71
|
+
'PT_rt7': 'was removed in Tax-Calculator 5.0.0',
|
72
|
+
'PT_rt8': 'was removed in Tax-Calculator 5.0.0',
|
73
|
+
'PT_brk1': 'was removed in Tax-Calculator 5.0.0',
|
74
|
+
'PT_brk2': 'was removed in Tax-Calculator 5.0.0',
|
75
|
+
'PT_brk3': 'was removed in Tax-Calculator 5.0.0',
|
76
|
+
'PT_brk4': 'was removed in Tax-Calculator 5.0.0',
|
77
|
+
'PT_brk5': 'was removed in Tax-Calculator 5.0.0',
|
78
|
+
'PT_brk6': 'was removed in Tax-Calculator 5.0.0',
|
79
|
+
'PT_brk7': 'was removed in Tax-Calculator 5.0.0',
|
80
|
+
'PT_EligibleRate_active': 'was removed in Tax-Calculator 5.0.0',
|
81
|
+
'PT_EligibleRate_passive': 'was removed in Tax-Calculator 5.0.0',
|
82
|
+
'PT_wages_active_income': 'was removed in Tax-Calculator 5.0.0',
|
83
|
+
'PT_top_stacking': 'was removed in Tax-Calculator 5.0.0',
|
84
|
+
# following parameters were removed in PR 2620
|
85
|
+
'ID_AmountCap_Switch': 'was removed in Tax-Calculator 5.0.0',
|
86
|
+
'ID_AmountCap_rt': 'was removed in Tax-Calculator 5.0.0',
|
87
|
+
'ID_BenefitCap_Switch': 'was removed in Tax-Calculator 5.0.0',
|
88
|
+
'ID_BenefitCap_rt': 'was removed in Tax-Calculator 5.0.0',
|
89
|
+
'ID_BenefitSurtax_Switch': 'was removed in Tax-Calculator 5.0.0',
|
90
|
+
'ID_BenefitSurtax_crt': 'was removed in Tax-Calculator 5.0.0',
|
91
|
+
'ID_BenefitSurtax_trt': 'was removed in Tax-Calculator 5.0.0',
|
92
|
+
'ID_BenefitSurtax_em': 'was removed in Tax-Calculator 5.0.0',
|
93
|
+
# following parameters were renamed in PR 2628
|
94
|
+
'CDCC_ps': 'was renamed CDCC_ps1 in Tax-Calculator 5.1.0',
|
95
|
+
'CDCC_crt': 'was renamed CDCC_po1_rate_max in Tax-Calculator 5.1.0',
|
96
|
+
'CDCC_frt': 'was renamed CDCC_po1_rate_min in Tax-Calculator 5.1.0',
|
97
|
+
'CDCC_po_step_size': (
|
98
|
+
'was renamed CDCC_po1_step_size'
|
99
|
+
'in Tax-Calculator 5.1.0'
|
100
|
+
),
|
79
101
|
}
|
80
102
|
# (2) specify which Policy parameters have been redefined recently
|
103
|
+
# where "recently" means in the last major release
|
81
104
|
REDEFINED_PARAMS = {}
|
82
105
|
# (3) specify which Policy parameters are wage (rather than price) indexed
|
83
106
|
WAGE_INDEXED_PARAMS = ['SS_Earnings_c', 'SS_Earnings_thd']
|
@@ -143,20 +166,12 @@ class Policy(Parameters):
|
|
143
166
|
None
|
144
167
|
)
|
145
168
|
deprecated_parameters = [
|
146
|
-
'ID_AmountCap_Switch',
|
147
|
-
'ID_AmountCap_rt',
|
148
|
-
'ID_BenefitCap_Switch',
|
149
|
-
'ID_BenefitCap_rt',
|
150
|
-
'ID_BenefitSurtax_Switch',
|
151
|
-
'ID_BenefitSurtax_crt',
|
152
|
-
'ID_BenefitSurtax_trt',
|
153
|
-
'ID_BenefitSurtax_em',
|
154
169
|
]
|
155
170
|
for param in reform.keys():
|
156
171
|
if param in deprecated_parameters:
|
157
|
-
print(
|
172
|
+
print( # pragma: no cover
|
158
173
|
f'DEPRECATION WARNING: the {param} policy parameter\n'
|
159
|
-
'is scheduled to be removed in Tax-Calculator
|
174
|
+
'is scheduled to be removed in Tax-Calculator 6.0.0;\n'
|
160
175
|
'if you think this removal should not happen, open an\n'
|
161
176
|
'issue on GitHub to make your case for non-removal.'
|
162
177
|
)
|