taxcalc 4.3.3__py3-none-any.whl → 4.3.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. taxcalc/__init__.py +1 -1
  2. taxcalc/assumptions/README.md +1 -1
  3. taxcalc/assumptions/economic_assumptions_template.json +1 -1
  4. taxcalc/calcfunctions.py +18 -21
  5. taxcalc/calculator.py +7 -3
  6. taxcalc/cps_weights.csv.gz +0 -0
  7. taxcalc/growfactors.csv +25 -65
  8. taxcalc/parameters.py +5 -7
  9. taxcalc/policy.py +18 -30
  10. taxcalc/policy_current_law.json +87 -87
  11. taxcalc/puf_ratios.csv +14 -14
  12. taxcalc/puf_weights.csv.gz +0 -0
  13. taxcalc/records.py +6 -3
  14. taxcalc/records_variables.json +5 -6
  15. taxcalc/reforms/2017_law.out.csv +9 -9
  16. taxcalc/reforms/ARPA.out.csv +10 -10
  17. taxcalc/reforms/BrownKhanna.out.csv +9 -9
  18. taxcalc/reforms/CARES.out.csv +10 -10
  19. taxcalc/reforms/ConsolidatedAppropriationsAct2021.out.csv +1 -1
  20. taxcalc/reforms/Larson2019.out.csv +10 -10
  21. taxcalc/reforms/README.md +7 -6
  22. taxcalc/reforms/Renacci.out.csv +9 -9
  23. taxcalc/reforms/SandersDeFazio.out.csv +10 -10
  24. taxcalc/reforms/TCJA.out.csv +9 -9
  25. taxcalc/reforms/Trump2016.out.csv +9 -9
  26. taxcalc/reforms/Trump2017.out.csv +9 -9
  27. taxcalc/reforms/clp.out.csv +10 -10
  28. taxcalc/reforms/ext.json +21 -21
  29. taxcalc/reforms/ptaxes0.out.csv +9 -9
  30. taxcalc/reforms/ptaxes1.out.csv +9 -9
  31. taxcalc/reforms/ptaxes2.out.csv +9 -9
  32. taxcalc/reforms/ptaxes3.out.csv +9 -9
  33. taxcalc/taxcalcio.py +14 -7
  34. taxcalc/tests/cmpi_cps_expect.txt +20 -20
  35. taxcalc/tests/cmpi_puf_expect.txt +20 -20
  36. taxcalc/tests/cpscsv_agg_expect.csv +19 -19
  37. taxcalc/tests/puf_var_correl_coeffs_2016.csv +39 -39
  38. taxcalc/tests/puf_var_wght_means_by_year.csv +39 -39
  39. taxcalc/tests/pufcsv_agg_expect.csv +20 -20
  40. taxcalc/tests/pufcsv_mtr_expect.txt +8 -8
  41. taxcalc/tests/reforms_expect.csv +25 -25
  42. taxcalc/tests/test_calcfunctions.py +11 -10
  43. taxcalc/tests/test_calculator.py +5 -3
  44. taxcalc/tests/test_parameters.py +3 -2
  45. taxcalc/tests/test_pufcsv.py +1 -3
  46. taxcalc/tests/test_reforms.py +1 -1
  47. taxcalc/tests/test_utils.py +24 -24
  48. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/METADATA +2 -2
  49. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/RECORD +53 -53
  50. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/WHEEL +1 -1
  51. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/LICENSE +0 -0
  52. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/entry_points.txt +0 -0
  53. {taxcalc-4.3.3.dist-info → taxcalc-4.3.5.dist-info}/top_level.txt +0 -0
taxcalc/__init__.py CHANGED
@@ -14,6 +14,6 @@ from taxcalc.taxcalcio import *
14
14
  from taxcalc.utils import *
15
15
  from taxcalc.cli import *
16
16
 
17
- __version__ = '4.3.3'
17
+ __version__ = '4.3.5'
18
18
  __min_python3_version__ = 10
19
19
  __max_python3_version__ = 12
@@ -9,7 +9,7 @@ Such an economic assumption file can then be used by the `tc`
9
9
  command-line interface to Tax-Calculator or be read in a Python
10
10
  program that imports the Tax-Calculator `taxcalc` package, as
11
11
  described in the [user
12
- guide](https://PSLmodels.github.io/Tax-Calculator/uguide.html).
12
+ guide](https://taxcalc.pslmodels.org/guide/index.html#user-guide).
13
13
 
14
14
  [This
15
15
  document](https://github.com/PSLmodels/Tax-Calculator/blob/master/taxcalc/assumptions/ASSUMPTIONS.md#how-to-specify-economic-assumptions-in-a-json-assumption-file)
@@ -4,7 +4,7 @@
4
4
  // about how individuals and the overall economy respond to a tax reform.
5
5
  //
6
6
  // Detailed documentation on these parameters can be found at
7
- // <http://PSLmodels.github.io/Tax-Calculator/#params>.
7
+ // <https://taxcalc.pslmodels.org/guide/assumption_params.html>.
8
8
  {
9
9
  "consumption": {
10
10
  "MPC_e17500": {"2017": 0.0},
taxcalc/calcfunctions.py CHANGED
@@ -157,11 +157,11 @@ def EI_PayrollTax(SS_Earnings_c, e00200p, e00200s, pencon_p, pencon_s,
157
157
  Partner self-employment earnings/loss for spouse (included in e26270 total)
158
158
  payrolltax: float
159
159
  Total (employee and employer) payroll tax liability
160
- payrolltax = ptax_was + setax + ptax_amc
160
+ payrolltax = ptax_was
161
161
  ptax_was: float
162
162
  Employee and employer OASDI plus HI FICA tax
163
163
  setax: float
164
- Self-employment tax
164
+ Self-employment tax (included in othertaxes and iitax)
165
165
  c03260: float
166
166
  Deductible part of self-employment tax
167
167
  c03260 = (1 - ALD_SelfEmploymentTax_hc) * 0.5 * setax
@@ -187,11 +187,11 @@ def EI_PayrollTax(SS_Earnings_c, e00200p, e00200s, pencon_p, pencon_s,
187
187
  Total self-employment income for filing unit
188
188
  payrolltax: float
189
189
  Total (employee and employer) payroll tax liability
190
- payrolltax = ptax_was + setax + ptax_amc
190
+ payrolltax = ptax_was
191
191
  ptax_was: float
192
192
  Employee and employer OASDI plus HI FICA tax
193
193
  setax: float
194
- Self-employment tax
194
+ Self-employment tax (included in othertaxes and iitax)
195
195
  c03260: float
196
196
  Deductible part of self-employment tax
197
197
  c03260 = (1 - ALD_SelfEmploymentTax_hc) * 0.5 * setax
@@ -260,9 +260,7 @@ def EI_PayrollTax(SS_Earnings_c, e00200p, e00200s, pencon_p, pencon_s,
260
260
  extra_ss_income_s * (FICA_ss_trt_employer + FICA_ss_trt_employee))
261
261
 
262
262
  # compute part of total payroll taxes for filing unit
263
- # (the ptax_amc part of total payroll taxes for the filing unit is
264
- # computed in the AdditionalMedicareTax function below)
265
- payrolltax = ptax_was + setax + extra_payrolltax
263
+ payrolltax = ptax_was + extra_payrolltax
266
264
 
267
265
  # compute OASDI part of payroll taxes
268
266
  ptax_oasdi = (ptax_ss_was_p + ptax_ss_was_s +
@@ -1088,9 +1086,9 @@ def AdditionalMedicareTax(e00200, MARS,
1088
1086
  AMEDT_ec, sey, AMEDT_rt,
1089
1087
  FICA_mc_trt_employer, FICA_mc_trt_employee,
1090
1088
  FICA_ss_trt_employer, FICA_ss_trt_employee,
1091
- ptax_amc, payrolltax):
1089
+ ptax_amc):
1092
1090
  """
1093
- Computes Additional Medicare Tax (Form 8959) included in payroll taxes.
1091
+ Computes Additional Medicare Tax (Form 8959) included in othertaxes.
1094
1092
 
1095
1093
  Parameters
1096
1094
  -----
@@ -1113,23 +1111,18 @@ def AdditionalMedicareTax(e00200, MARS,
1113
1111
  sey: float
1114
1112
  Self-employment income
1115
1113
  ptax_amc: float
1116
- Additional Medicare Tax
1117
- payrolltax: float
1118
- payroll tax augmented by Additional Medicare Tax
1114
+ Additional Medicare Tax (included in othertaxes and iitax)
1119
1115
 
1120
1116
  Returns
1121
1117
  -------
1122
1118
  ptax_amc: float
1123
- Additional Medicare Tax
1124
- payrolltax: float
1125
- payroll tax augmented by Additional Medicare Tax
1119
+ Additional Medicare Tax (included in othertaxes and iitax)
1126
1120
  """
1127
1121
  line8 = max(0., sey) * (1. - 0.5 * (FICA_mc_trt_employer + FICA_mc_trt_employee + FICA_ss_trt_employer + FICA_ss_trt_employee))
1128
1122
  line11 = max(0., AMEDT_ec[MARS - 1] - e00200)
1129
1123
  ptax_amc = AMEDT_rt * (max(0., e00200 - AMEDT_ec[MARS - 1]) +
1130
1124
  max(0., line8 - line11))
1131
- payrolltax += ptax_amc
1132
- return (ptax_amc, payrolltax)
1125
+ return ptax_amc
1133
1126
 
1134
1127
 
1135
1128
  @iterate_jit(nopython=True)
@@ -3150,8 +3143,8 @@ def AdditionalCTC(codtc_limited, ACTC_c, n24, earned, ACTC_Income_thd,
3150
3143
 
3151
3144
  @iterate_jit(nopython=True)
3152
3145
  def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3153
- c07400, c07600, c08000, e09700, e09800, e09900, niit, othertaxes,
3154
- c07100, c09200, odc, charity_credit,
3146
+ c07400, c07600, c08000, e09700, e09800, e09900, niit, setax,
3147
+ ptax_amc, othertaxes, c07100, c09200, odc, charity_credit,
3155
3148
  personal_nonrefundable_credit,
3156
3149
  CTC_is_refundable, ODC_is_refundable):
3157
3150
  """
@@ -3190,8 +3183,12 @@ def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3190
3183
  Penalty tax on qualified retirement plans
3191
3184
  niit: float
3192
3185
  Net Investment Income Tax from Form 8960
3186
+ setax: float
3187
+ Self-employment tax
3188
+ ptax_amc: float
3189
+ Additional Medicare tax
3193
3190
  othertaxes: float
3194
- Sum of niit, e09700, e09800, and e09900
3191
+ Sum of niit, setax, ptax_amc, e09700, e09800, and e09900
3195
3192
  c07100: float
3196
3193
  Total non-refundable credits used to reduce positive tax liability
3197
3194
  c09200: float
@@ -3221,7 +3218,7 @@ def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3221
3218
  # tax after credits (2016 Form 1040, line 56)
3222
3219
  tax_net_nonrefundable_credits = max(0., c05800 - c07100)
3223
3220
  # tax (including othertaxes) before refundable credits
3224
- othertaxes = e09700 + e09800 + e09900 + niit
3221
+ othertaxes = e09700 + e09800 + e09900 + niit + setax + ptax_amc
3225
3222
  c09200 = othertaxes + tax_net_nonrefundable_credits
3226
3223
  return (c07100, othertaxes, c09200)
3227
3224
 
taxcalc/calculator.py CHANGED
@@ -1110,7 +1110,7 @@ class Calculator():
1110
1110
  return param_dict
1111
1111
 
1112
1112
  @staticmethod
1113
- def reform_documentation(params, policy_dicts=None):
1113
+ def reform_documentation(params, growfactors, policy_dicts=None):
1114
1114
  """
1115
1115
  Generate reform documentation versus current-law policy.
1116
1116
 
@@ -1120,6 +1120,9 @@ class Calculator():
1120
1120
  dictionary is structured like dict returned from
1121
1121
  the static Calculator.read_json_param_objects() method
1122
1122
 
1123
+ growfactors: GrowFactors
1124
+ GrowFactors object used to construct Calculator Policy object
1125
+
1123
1126
  policy_dicts : list of dict or None
1124
1127
  each dictionary in list is a params['policy'] dictionary
1125
1128
  representing second and subsequent elements of a compound
@@ -1255,13 +1258,14 @@ class Calculator():
1255
1258
  # create Policy object with current-law-policy values
1256
1259
  gdiff_base = GrowDiff()
1257
1260
  gdiff_base.update_growdiff(params['growdiff_baseline'])
1258
- gfactors_clp = GrowFactors()
1261
+ assert isinstance(growfactors, GrowFactors)
1262
+ gfactors_clp = copy.deepcopy(growfactors)
1259
1263
  gdiff_base.apply_to(gfactors_clp)
1260
1264
  clp = Policy(gfactors=gfactors_clp)
1261
1265
  # create Policy object with post-reform values
1262
1266
  gdiff_resp = GrowDiff()
1263
1267
  gdiff_resp.update_growdiff(params['growdiff_response'])
1264
- gfactors_ref = GrowFactors()
1268
+ gfactors_ref = copy.deepcopy(growfactors)
1265
1269
  gdiff_base.apply_to(gfactors_ref)
1266
1270
  gdiff_resp.apply_to(gfactors_ref)
1267
1271
  ref = Policy(gfactors=gfactors_ref)
Binary file
taxcalc/growfactors.csv CHANGED
@@ -1,65 +1,25 @@
1
- YEAR,ATXPY,ASCHF,ABOOK,ACPIU,ACPIM,AWAGE,ASCHCI,ASCHCL,ASCHEI,ASCHEL,AINTS,ADIVS,ACGNS,ASOCSEC,AUCOMP,AIPD,ABENOTHER,ABENMCARE,ABENMCAID,ABENSSI,ABENSNAP,ABENWIC,ABENHOUSING,ABENTANF,ABENVET
2
- 2011,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
3
- 2012,1.043862,0.950283,1.104992,1.0209,1.0365,1.032649,1.049023,0.956138,1.165922,0.926962,0.923588,1.327776,1.58966,1.02827,0.7711,0.9231,0.992359,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
4
- 2013,1.012518,1.142179,1.033784,1.014791,1.024602,1.019984,0.99505,1.050098,0.997245,1.013128,0.893658,0.819381,0.776217,1.014786,0.728829,0.896219,0.992515,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
5
- 2014,1.029476,0.931683,0.976566,1.015927,1.023917,1.039999,1.040616,1.030349,1.075978,0.991321,0.925886,1.17606,1.387522,1.004801,0.641103,0.970506,0.99257,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
6
- 2015,1.043858,0.508206,0.999544,1.001235,1.026485,1.024119,1.038052,1.040061,1.04481,1.057257,1.013311,1.013846,1.004308,1.017188,0.81793,0.988666,1.053858,1.023325,1.041528,1.019361,1.102667,1.007792,1.026748,1.132657,1.04693
7
- 2016,1.021978,1.071198,0.984833,1.012621,1.037807,1.006659,0.984484,1.005593,0.982695,0.983807,0.999649,0.968237,0.881651,0.991403,0.933831,1.001764,1.097065,1.011695,1.010367,0.993375,0.989722,1.002577,1.01625,0.828168,1.105413
8
- 2017,1.049373,0.907035,1.018491,1.01677,1.025035,1.040577,1.060677,1.132498,1.093477,1.160123,1.088642,1.102389,1.344721,1.00723,0.94186,1.029301,1.011911,1.030968,1.014601,0.981621,1.0,0.998715,1.063959,1.0,1.0
9
- 2018,1.042394,0.976786,1.074059,1.02,1.019707,1.041821,1.042769,1.042713,1.074048,1.074033,1.031272,1.076804,1.074755,1.018778,0.92284,1.050825,1.103035,1.045097,1.045897,1.005738,1.0,1.002574,1.034828,1.0,1.0
10
- 2019,1.032351,0.979401,1.019085,1.01341,1.028328,1.039292,1.004274,1.004387,1.019131,1.019122,1.014806,1.041751,0.925878,1.031182,0.940635,1.040577,1.054052,1.052158,1.045866,1.000751,1.0,1.002567,1.034809,1.0,1.0
11
- 2020,1.067957,1.167938,0.947032,1.00799,1.041121,1.006381,1.016054,1.015991,0.947016,0.94708,0.989319,1.091767,1.292516,1.023383,1.034222,1.076313,0.996727,1.050763,1.046106,1.00255,1.0,1.003841,1.034974,1.0,1.0
12
- 2021,1.065517,1.126248,1.216697,1.04269,1.012343,1.079707,1.057058,1.05708,1.216716,1.216644,0.999214,1.057982,1.792117,1.011965,8.619252,1.073809,1.03007,1.047248,1.047927,1.001796,1.0,1.002551,1.034869,1.0,1.0
13
- 2022,1.014347,1.742914,1.047552,1.07229,1.040311,1.076282,1.022527,1.022546,1.047553,1.047566,1.049118,1.042358,0.631565,1.04749,0.152665,1.022138,1.030159,1.048769,1.047573,0.999851,1.0,1.002545,1.034942,1.0,1.0
14
- 2023,1.050108,0.653145,1.091056,1.05402,1.004761,1.050035,1.013156,1.013121,1.091037,1.091047,1.026196,1.126711,1.0525,1.085497,0.748857,1.058072,1.030193,1.050822,1.048715,1.000448,1.0,1.003807,1.034968,1.0,1.0
15
- 2024,1.046242,0.895528,1.007166,1.0255,1.01407,1.040377,1.0397,1.03963,1.007187,1.007157,1.156028,1.023049,0.932271,1.052921,1.337549,1.054081,1.030334,1.048426,1.051767,0.99776,1.0,1.002528,1.034951,1.0,1.0
16
- 2025,1.040442,0.963117,1.020457,1.02198,0.958663,1.038977,1.037682,1.037745,1.020415,1.020444,1.091746,1.02538,0.97747,1.031721,1.154874,1.047914,1.030635,1.046248,1.052213,1.002245,1.0,1.003783,1.034897,1.0,1.0
17
- 2026,1.039294,0.987094,1.014705,1.02074,1.014023,1.035978,1.037783,1.037762,1.014711,1.014716,1.098184,1.019802,0.970235,1.030992,1.035291,1.046856,1.030633,1.072236,1.0,0.999552,1.0,1.002513,1.034808,1.0,1.0
18
- 2027,1.037119,0.998822,1.017535,1.01946,1.013312,1.033569,1.03414,1.034138,1.017568,1.017583,1.066606,1.013266,0.993714,1.031791,1.045541,1.044372,1.030788,1.0,1.0,1.0,1.0,1.002506,1.034863,1.0,1.0
19
- 2028,1.036799,1.006582,1.023966,1.01942,1.013356,1.033042,1.031594,1.03158,1.023985,1.02393,1.050716,1.021542,1.009158,1.03344,1.043558,1.043967,1.030942,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
20
- 2029,1.035913,1.010333,1.028149,1.01966,1.013612,1.033365,1.030869,1.030888,1.028085,1.028143,1.03013,1.032091,1.018962,1.033664,1.045739,1.042825,1.031131,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
21
- 2030,1.036423,1.01018,1.024121,1.01977,1.013855,1.03321,1.030563,1.030595,1.02417,1.024128,1.036979,1.032934,1.024538,1.034401,1.043738,1.043174,1.03133,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
22
- 2031,1.036362,1.010259,1.024733,1.01991,1.014016,1.032812,1.031233,1.03124,1.024699,1.024734,1.039197,1.032793,1.027842,1.036645,1.038241,1.042951,1.03151,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
23
- 2032,1.036409,1.009979,1.028,1.01999,1.014306,1.032126,1.032334,1.032295,1.028004,1.027983,1.04014,1.03261,1.029719,1.036435,1.031319,1.042807,1.031644,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
24
- 2033,1.035793,1.008195,1.02813,1.02002,1.014309,1.031481,1.033961,1.033991,1.028128,1.02811,1.031669,1.03246,1.030798,1.037554,1.028443,1.042009,1.031857,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
25
- 2034,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
26
- 2035,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
27
- 2036,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
28
- 2037,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
29
- 2038,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
30
- 2039,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
31
- 2040,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
32
- 2041,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
33
- 2042,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
34
- 2043,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
35
- 2044,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
36
- 2045,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
37
- 2046,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
38
- 2047,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
39
- 2048,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
40
- 2049,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
41
- 2050,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
42
- 2051,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
43
- 2052,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
44
- 2053,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
45
- 2054,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
46
- 2055,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
47
- 2056,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
48
- 2057,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
49
- 2058,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
50
- 2059,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
51
- 2060,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
52
- 2061,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
53
- 2062,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
54
- 2063,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
55
- 2064,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
56
- 2065,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
57
- 2066,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
58
- 2067,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
59
- 2068,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
60
- 2069,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
61
- 2070,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
62
- 2071,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
63
- 2072,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
64
- 2073,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
65
- 2074,1.035385,1.008203,1.02971,1.02,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
1
+ YEAR,ATXPY,ASCHF,ABOOK,ACPIU,ACPIM,AWAGE,ASCHCI,ASCHCL,ASCHEI,ASCHEL,AINTS,ADIVS,ACGNS,ASOCSEC,AUCOMP,AIPD,ABENOTHER,ABENMCARE,ABENMCAID,ABENSSI,ABENSNAP,ABENWIC,ABENHOUSING,ABENTANF,ABENVET
2
+ 2011,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
3
+ 2012,1.043862,0.950283,1.104992,1.0209,1.0365,1.032649,1.049023,0.956138,1.165922,0.926962,0.923588,1.327776,1.58966,1.02827,0.7711,0.9231,0.992359,1,1,1,1,1,1,1,1
4
+ 2013,1.012518,1.142179,1.033784,1.014791,1.024602,1.019984,0.99505,1.050098,0.997245,1.013128,0.893658,0.819381,0.776217,1.014786,0.728829,0.896219,0.992515,1,1,1,1,1,1,1,1
5
+ 2014,1.029476,0.931683,0.976566,1.015927,1.023917,1.039999,1.040616,1.030349,1.075978,0.991321,0.925886,1.17606,1.387522,1.004801,0.641103,0.970506,0.99257,1,1,1,1,1,1,1,1
6
+ 2015,1.043858,0.508206,0.999544,1.001235,1.026485,1.024119,1.038052,1.040061,1.04481,1.057257,1.013311,1.013846,1.004308,1.017188,0.81793,0.988666,1.053858,1.023325,1.041528,1.019361,1.102667,1.007792,1.026748,1.132657,1.04693
7
+ 2016,1.021978,1.071198,0.984833,1.012621,1.037807,1.006659,0.984484,1.005593,0.982695,0.983807,0.999649,0.968237,0.881651,0.991403,0.933831,1.001764,1.097065,1.011695,1.010367,0.993375,0.989722,1.002577,1.01625,0.828168,1.105413
8
+ 2017,1.049373,0.907035,1.018491,1.021273,1.025035,1.040577,1.060677,1.132498,1.093477,1.160123,1.088642,1.102389,1.344721,1.00723,0.94186,1.029301,1.011911,1.030968,1.014601,0.981621,1,0.998715,1.063959,1,1
9
+ 2018,1.042394,0.976786,1.074059,1.0245,1.019707,1.041821,1.042769,1.042713,1.074048,1.074033,1.031272,1.076804,1.074755,1.018778,0.92284,1.050825,1.103035,1.045097,1.045897,1.005738,1,1.002574,1.034828,1,1
10
+ 2019,1.032351,0.979401,1.019085,1.017913,1.028328,1.039292,1.004274,1.004387,1.019131,1.019122,1.014806,1.041751,0.925878,1.031182,0.940635,1.040577,1.054052,1.052158,1.045866,1.000751,1,1.002567,1.034809,1,1
11
+ 2020,1.067957,1.167938,0.947032,1.012495,1.041121,1.006381,1.016054,1.015991,0.947016,0.94708,0.989319,1.091767,1.292516,1.023383,1.034222,1.076313,0.996727,1.050763,1.046106,1.00255,1,1.003841,1.034974,1,1
12
+ 2021,1.065517,1.126248,1.216697,1.047189,1.012343,1.079707,1.057058,1.05708,1.216716,1.216644,0.999214,1.057982,1.792117,1.011965,8.619252,1.073809,1.03007,1.047248,1.047927,1.001796,1,1.002551,1.034869,1,1
13
+ 2022,1.014347,1.742914,1.047552,1.08083,1.040311,1.076282,1.022527,1.022546,1.047553,1.047566,1.049118,1.042358,0.631565,1.04749,0.152665,1.022138,1.030159,1.048769,1.047573,0.999851,1,1.002545,1.034942,1,1
14
+ 2023,1.050108,0.653145,1.091056,1.040233,1.004761,1.050035,1.013156,1.013121,1.091037,1.091047,1.026196,1.126711,1.0525,1.085497,0.748857,1.058072,1.030193,1.050822,1.048715,1.000448,1,1.003807,1.034968,1,1
15
+ 2024,1.046242,0.895528,1.007166,1.025982,1.01407,1.040377,1.0397,1.03963,1.007187,1.007157,1.156028,1.023049,0.932271,1.052921,1.337549,1.054081,1.030334,1.048426,1.051767,0.99776,1,1.002528,1.034951,1,1
16
+ 2025,1.040442,0.963117,1.020457,1.024892,0.958663,1.038977,1.037682,1.037745,1.020415,1.020444,1.091746,1.02538,0.97747,1.031721,1.154874,1.047914,1.030635,1.046248,1.052213,1.002245,1,1.003783,1.034897,1,1
17
+ 2026,1.039294,0.987094,1.014705,1.023445,1.014023,1.035978,1.037783,1.037762,1.014711,1.014716,1.098184,1.019802,0.970235,1.030992,1.035291,1.046856,1.030633,1.072236,1,0.999552,1,1.002513,1.034808,1,1
18
+ 2027,1.037119,0.998822,1.017535,1.021948,1.013312,1.033569,1.03414,1.034138,1.017568,1.017583,1.066606,1.013266,0.993714,1.031791,1.045541,1.044372,1.030788,1,1,1,1,1.002506,1.034863,1,1
19
+ 2028,1.036799,1.006582,1.023966,1.021812,1.013356,1.033042,1.031594,1.03158,1.023985,1.02393,1.050716,1.021542,1.009158,1.03344,1.043558,1.043967,1.030942,1,1,1,1,1,1,1,1
20
+ 2029,1.035913,1.010333,1.028149,1.022135,1.013612,1.033365,1.030869,1.030888,1.028085,1.028143,1.03013,1.032091,1.018962,1.033664,1.045739,1.042825,1.031131,1,1,1,1,1,1,1,1
21
+ 2030,1.036423,1.01018,1.024121,1.022298,1.013855,1.03321,1.030563,1.030595,1.02417,1.024128,1.036979,1.032934,1.024538,1.034401,1.043738,1.043174,1.03133,1,1,1,1,1,1,1,1
22
+ 2031,1.036362,1.010259,1.024733,1.022377,1.014016,1.032812,1.031233,1.03124,1.024699,1.024734,1.039197,1.032793,1.027842,1.036645,1.038241,1.042951,1.03151,1,1,1,1,1,1,1,1
23
+ 2032,1.036409,1.009979,1.028,1.022687,1.014306,1.032126,1.032334,1.032295,1.028004,1.027983,1.04014,1.03261,1.029719,1.036435,1.031319,1.042807,1.031644,1,1,1,1,1,1,1,1
24
+ 2033,1.035793,1.008195,1.02813,1.022484,1.014309,1.031481,1.033961,1.033991,1.028128,1.02811,1.031669,1.03246,1.030798,1.037554,1.028443,1.042009,1.031857,1,1,1,1,1,1,1,1
25
+ 2034,1.035385,1.008203,1.02971,1.02246,1.014443,1.030912,1.033294,1.033253,1.029705,1.029722,1.027096,1.032231,1.031308,1.03748,1.029528,1.041408,1.032059,1,1,1,1,1,1,1,1
taxcalc/parameters.py CHANGED
@@ -1,15 +1,12 @@
1
- import copy
2
1
  import os
3
- import re
2
+ import copy
4
3
  from collections import defaultdict
5
4
  from typing import Union, Mapping, Any, List
6
5
 
7
6
  import marshmallow as ma
8
7
  import paramtools as pt
9
8
  import numpy as np
10
- import requests
11
9
 
12
- import taxcalc
13
10
  from taxcalc.growfactors import GrowFactors
14
11
 
15
12
 
@@ -249,7 +246,6 @@ class Parameters(pt.Parameters):
249
246
  label_to_extend = self.label_to_extend
250
247
  array_first = self.array_first
251
248
  self.array_first = False
252
- self._gfactors = GrowFactors()
253
249
 
254
250
  params = self.read_params(params_or_path)
255
251
 
@@ -508,12 +504,14 @@ class Parameters(pt.Parameters):
508
504
 
509
505
  def wage_growth_rates(self, year=None):
510
506
  if year is not None:
511
- return self._wage_growth_rates[year - self.start_year]
507
+ syr = max(self.start_year, self._gfactors.first_year)
508
+ return self._wage_growth_rates[year - syr]
512
509
  return self._wage_growth_rates or []
513
510
 
514
511
  def inflation_rates(self, year=None):
515
512
  if year is not None:
516
- return self._inflation_rates[year - self.start_year]
513
+ syr = max(self.start_year, self._gfactors.first_year)
514
+ return self._inflation_rates[year - syr]
517
515
  return self._inflation_rates or []
518
516
 
519
517
  # alias methods below
taxcalc/policy.py CHANGED
@@ -8,7 +8,6 @@ Tax-Calculator federal tax policy Policy class.
8
8
  import os
9
9
  import json
10
10
  from pathlib import Path
11
- import numpy as np
12
11
  from taxcalc.parameters import Parameters
13
12
  from taxcalc.growfactors import GrowFactors
14
13
 
@@ -53,7 +52,7 @@ class Policy(Parameters):
53
52
  'DependentCredit_before_CTC': 'is a removed parameter name',
54
53
  'FilerCredit_c': 'is a removed parameter name',
55
54
  'ALD_InvInc_ec_base_RyanBrady': 'is a removed parameter name',
56
- # TODO: following parameter renamed in PR 2292 merged on 2019-04-15
55
+ # following parameter renamed in PR 2292 merged on 2019-04-15
57
56
  "cpi_offset": (
58
57
  "was renamed parameter_indexing_CPI_offset. "
59
58
  "See documentation for change in usage."
@@ -62,7 +61,7 @@ class Policy(Parameters):
62
61
  "was renamed parameter_indexing_CPI_offset. "
63
62
  "See documentation for change in usage."
64
63
  ),
65
- # TODO: following parameters renamed in PR 2345 merged on 2019-06-24
64
+ # following parameters renamed in PR 2345 merged on 2019-06-24
66
65
  'PT_excl_rt':
67
66
  'was renamed PT_qbid_rt in release 2.4.0',
68
67
  'PT_excl_wagelim_thd':
@@ -102,17 +101,18 @@ class Policy(Parameters):
102
101
  Policy.WAGE_INDEXED_PARAMS, **kwargs)
103
102
 
104
103
  @staticmethod
105
- def tmd_constructor(growfactors_path): # pragma: no cover
104
+ def tmd_constructor(growfactors: Path | GrowFactors): # pragma: no cover
106
105
  """
107
106
  Static method returns a Policy object instantiated with TMD
108
107
  input data. This convenience method works in a analogous way
109
108
  to Policy(), which returns a Policy object instantiated with
110
109
  non-TMD input data.
111
110
  """
112
- assert isinstance(growfactors_path, Path)
113
- gf_filename = str(growfactors_path)
114
- tmd_growfactors = GrowFactors(growfactors_filename=gf_filename)
115
- return Policy(gfactors=tmd_growfactors)
111
+ if isinstance(growfactors, Path):
112
+ growfactors = GrowFactors(growfactors_filename=str(growfactors))
113
+ else:
114
+ assert isinstance(growfactors, GrowFactors)
115
+ return Policy(gfactors=growfactors)
116
116
 
117
117
  @staticmethod
118
118
  def read_json_reform(obj):
@@ -147,32 +147,20 @@ class Policy(Parameters):
147
147
  return [k for k in defaults if k != "schema"]
148
148
 
149
149
  def set_rates(self):
150
- """Initialize taxcalc indexing data."""
150
+ """
151
+ Initialize policy parameter indexing rates.
152
+ """
151
153
  cpi_vals = [
152
154
  vo["value"] for
153
155
  vo in self._data["parameter_indexing_CPI_offset"]["value"]
154
156
  ]
155
- # extend parameter_indexing_CPI_offset values through budget window
156
- # if they have not been extended already.
157
- cpi_vals = cpi_vals + cpi_vals[-1:] * (
158
- self.end_year - self.start_year + 1 - len(cpi_vals)
157
+ # policy_current_law.json should not specify any non-zero values
158
+ # for the parameter_indexing_CPI_offset parameter, so check this
159
+ assert any(cpi_vals) is False
160
+ syr = max(self.start_year, self._gfactors.first_year)
161
+ self._inflation_rates = self._gfactors.price_inflation_rates(
162
+ syr, self.end_year
159
163
  )
160
- cpi_offset = {
161
- (self.start_year + ix): val
162
- for ix, val in enumerate(cpi_vals)
163
- }
164
-
165
- self._gfactors = GrowFactors()
166
-
167
- self._inflation_rates = [
168
- np.round(rate + cpi_offset[self.start_year + ix], 4)
169
- for ix, rate in enumerate(
170
- self._gfactors.price_inflation_rates(
171
- self.start_year, self.end_year
172
- )
173
- )
174
- ]
175
-
176
164
  self._wage_growth_rates = self._gfactors.wage_growth_rates(
177
- self.start_year, self.end_year
165
+ syr, self.end_year
178
166
  )