taxcalc 4.6.3__py3-none-any.whl → 5.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 +1 -1
- taxcalc/calcfunctions.py +54 -459
- taxcalc/calculator.py +9 -7
- taxcalc/parameters.py +0 -3
- taxcalc/policy.py +37 -30
- taxcalc/policy_current_law.json +736 -4554
- taxcalc/records_variables.json +0 -40
- taxcalc/reforms/2017_law.json +1 -15
- 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 +36 -88
- taxcalc/tests/reforms_expect.csv +32 -35
- taxcalc/tests/test_calcfunctions.py +1 -1
- taxcalc/tests/test_calculator.py +9 -81
- taxcalc/tests/test_compatible_data.py +0 -6
- taxcalc/tests/test_parameters.py +4 -0
- taxcalc/tests/test_policy.py +4 -30
- 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.0.dist-info}/METADATA +1 -1
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.0.dist-info}/RECORD +31 -31
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.0.dist-info}/WHEEL +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.0.dist-info}/entry_points.txt +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.0.dist-info}/licenses/LICENSE +0 -0
- {taxcalc-4.6.3.dist-info → taxcalc-5.0.0.dist-info}/top_level.txt +0 -0
taxcalc/calculator.py
CHANGED
@@ -14,7 +14,7 @@ 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,
|
17
|
+
SSBenefits, UBI, AGI, ItemDed,
|
18
18
|
StdDed, AdditionalMedicareTax, F2441, EITC,
|
19
19
|
RefundablePayrollTaxCredit,
|
20
20
|
ChildDepTaxCredit, AdditionalCTC, CTC_new,
|
@@ -22,7 +22,6 @@ from taxcalc.calcfunctions import (TaxInc, SchXYZTax, GainsTax, AGIsurtax,
|
|
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,6 @@ class Calculator():
|
|
1388
1391
|
CapGains(self.__policy, self.__records)
|
1389
1392
|
SSBenefits(self.__policy, self.__records)
|
1390
1393
|
AGI(self.__policy, self.__records)
|
1391
|
-
ItemDedCap(self.__policy, self.__records)
|
1392
1394
|
ItemDed(self.__policy, self.__records)
|
1393
1395
|
AdditionalMedicareTax(self.__policy, self.__records)
|
1394
1396
|
StdDed(self.__policy, self.__records)
|
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,7 +835,6 @@ 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
|
taxcalc/policy.py
CHANGED
@@ -55,29 +55,44 @@ 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',
|
79
93
|
}
|
80
94
|
# (2) specify which Policy parameters have been redefined recently
|
95
|
+
# where "recently" means in the last major release
|
81
96
|
REDEFINED_PARAMS = {}
|
82
97
|
# (3) specify which Policy parameters are wage (rather than price) indexed
|
83
98
|
WAGE_INDEXED_PARAMS = ['SS_Earnings_c', 'SS_Earnings_thd']
|
@@ -143,20 +158,12 @@ class Policy(Parameters):
|
|
143
158
|
None
|
144
159
|
)
|
145
160
|
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
161
|
]
|
155
162
|
for param in reform.keys():
|
156
163
|
if param in deprecated_parameters:
|
157
|
-
print(
|
164
|
+
print( # pragma: no cover
|
158
165
|
f'DEPRECATION WARNING: the {param} policy parameter\n'
|
159
|
-
'is scheduled to be removed in Tax-Calculator
|
166
|
+
'is scheduled to be removed in Tax-Calculator 6.0.0;\n'
|
160
167
|
'if you think this removal should not happen, open an\n'
|
161
168
|
'issue on GitHub to make your case for non-removal.'
|
162
169
|
)
|