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.
Files changed (45) 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/calculator.py +7 -3
  5. taxcalc/consumption.py +5 -5
  6. taxcalc/cps_weights.csv.gz +0 -0
  7. taxcalc/growdiff.py +5 -10
  8. taxcalc/growfactors.csv +25 -65
  9. taxcalc/parameters.py +12 -13
  10. taxcalc/policy.py +38 -34
  11. taxcalc/policy_current_law.json +87 -87
  12. taxcalc/puf_ratios.csv +14 -14
  13. taxcalc/puf_weights.csv.gz +0 -0
  14. taxcalc/records.py +6 -3
  15. taxcalc/reforms/2017_law.out.csv +9 -9
  16. taxcalc/reforms/BrownKhanna.out.csv +9 -9
  17. taxcalc/reforms/README.md +7 -6
  18. taxcalc/reforms/Renacci.out.csv +9 -9
  19. taxcalc/reforms/TCJA.out.csv +9 -9
  20. taxcalc/reforms/Trump2016.out.csv +9 -9
  21. taxcalc/reforms/Trump2017.out.csv +9 -9
  22. taxcalc/reforms/ext.json +21 -21
  23. taxcalc/reforms/ptaxes0.out.csv +9 -9
  24. taxcalc/reforms/ptaxes1.out.csv +9 -9
  25. taxcalc/reforms/ptaxes2.out.csv +9 -9
  26. taxcalc/reforms/ptaxes3.out.csv +9 -9
  27. taxcalc/taxcalcio.py +47 -32
  28. taxcalc/tests/cpscsv_agg_expect.csv +17 -17
  29. taxcalc/tests/puf_var_wght_means_by_year.csv +39 -39
  30. taxcalc/tests/pufcsv_agg_expect.csv +19 -19
  31. taxcalc/tests/reforms_expect.csv +19 -19
  32. taxcalc/tests/test_4package.py +42 -0
  33. taxcalc/tests/test_calculator.py +8 -7
  34. taxcalc/tests/test_consumption.py +5 -6
  35. taxcalc/tests/test_cpscsv.py +49 -1
  36. taxcalc/tests/test_growdiff.py +5 -7
  37. taxcalc/tests/test_parameters.py +3 -2
  38. taxcalc/tests/test_policy.py +2 -2
  39. taxcalc/tests/test_reforms.py +1 -1
  40. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/METADATA +5 -7
  41. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/RECORD +45 -45
  42. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/LICENSE +0 -0
  43. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/WHEEL +0 -0
  44. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.dist-info}/entry_points.txt +0 -0
  45. {taxcalc-4.3.4.dist-info → taxcalc-4.4.0.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.4'
17
+ __version__ = '4.4.0'
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/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)
taxcalc/consumption.py CHANGED
@@ -20,7 +20,8 @@ class Consumption(Parameters):
20
20
 
21
21
  Parameters
22
22
  ----------
23
- none
23
+ last_budget_year: integer
24
+ user-defined last parameter extrapolation year
24
25
 
25
26
  Returns
26
27
  -------
@@ -28,14 +29,13 @@ class Consumption(Parameters):
28
29
  """
29
30
 
30
31
  JSON_START_YEAR = Policy.JSON_START_YEAR
31
- DEFAULT_NUM_YEARS = Policy.DEFAULT_NUM_YEARS
32
32
  DEFAULTS_FILE_NAME = 'consumption.json'
33
33
  DEFAULTS_FILE_PATH = os.path.abspath(os.path.dirname(__file__))
34
34
 
35
- def __init__(self):
35
+ def __init__(self, last_budget_year=Policy.LAST_BUDGET_YEAR):
36
36
  super().__init__()
37
- self.initialize(Consumption.JSON_START_YEAR,
38
- Consumption.DEFAULT_NUM_YEARS)
37
+ nyrs = Policy.number_of_years(last_budget_year)
38
+ self.initialize(Consumption.JSON_START_YEAR, nyrs)
39
39
 
40
40
  @staticmethod
41
41
  def read_json_update(obj):
Binary file
taxcalc/growdiff.py CHANGED
@@ -20,7 +20,8 @@ class GrowDiff(Parameters):
20
20
 
21
21
  Parameters
22
22
  ----------
23
- none
23
+ last_budget_year: integer
24
+ user-defined last parameter extrapolation year
24
25
 
25
26
  Returns
26
27
  -------
@@ -28,14 +29,13 @@ class GrowDiff(Parameters):
28
29
  """
29
30
 
30
31
  JSON_START_YEAR = Policy.JSON_START_YEAR
31
- DEFAULT_NUM_YEARS = Policy.DEFAULT_NUM_YEARS
32
32
  DEFAULTS_FILE_NAME = 'growdiff.json'
33
33
  DEFAULTS_FILE_PATH = os.path.abspath(os.path.dirname(__file__))
34
34
 
35
- def __init__(self):
35
+ def __init__(self, last_budget_year=Policy.LAST_BUDGET_YEAR):
36
36
  super().__init__()
37
- self.initialize(GrowDiff.JSON_START_YEAR,
38
- GrowDiff.DEFAULT_NUM_YEARS)
37
+ nyrs = Policy.number_of_years(last_budget_year)
38
+ self.initialize(GrowDiff.JSON_START_YEAR, nyrs)
39
39
 
40
40
  @staticmethod
41
41
  def read_json_update(obj, topkey):
@@ -81,8 +81,3 @@ class GrowDiff(Parameters):
81
81
  cyr = i + self.start_year
82
82
  diff_array = getattr(self, _gfvn)
83
83
  growfactors.update(gfvn, cyr, diff_array[i])
84
-
85
- def set_rates(self):
86
- """
87
- Unimplemented base class method that is not used here.
88
- """
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
 
@@ -101,19 +98,16 @@ class Parameters(pt.Parameters):
101
98
  self.DEFAULTS_FILE_PATH,
102
99
  self.DEFAULTS_FILE_NAME
103
100
  )
104
-
101
+ last_budget_year = start_year + num_years - 1
105
102
  if last_known_year is None:
106
103
  self._last_known_year = start_year
107
104
  else:
108
105
  assert last_known_year >= start_year
109
- assert last_known_year <= self.LAST_BUDGET_YEAR
106
+ assert last_known_year <= last_budget_year
110
107
  self._last_known_year = last_known_year
111
-
112
108
  self._removed_params = removed or self.REMOVED_PARAMS
113
109
  self._redefined_params = redefined or self.REDEFINED_PARAMS
114
-
115
110
  self._wage_indexed = wage_indexed or self.WAGE_INDEXED_PARAMS
116
-
117
111
  if (
118
112
  (start_year or self.JSON_START_YEAR) and
119
113
  "initial_state" not in kwargs
@@ -121,6 +115,10 @@ class Parameters(pt.Parameters):
121
115
  kwargs["initial_state"] = {
122
116
  "year": start_year or self.JSON_START_YEAR
123
117
  }
118
+ # update defaults to correspond to user-defined parameter years
119
+ self.defaults = super().get_defaults()
120
+ label = self.defaults["schema"]["labels"]["year"]
121
+ label["validators"]["range"]["max"] = last_budget_year
124
122
  super().__init__(**kwargs)
125
123
 
126
124
  def adjust(
@@ -249,7 +247,6 @@ class Parameters(pt.Parameters):
249
247
  label_to_extend = self.label_to_extend
250
248
  array_first = self.array_first
251
249
  self.array_first = False
252
- self._gfactors = GrowFactors()
253
250
 
254
251
  params = self.read_params(params_or_path)
255
252
 
@@ -508,12 +505,14 @@ class Parameters(pt.Parameters):
508
505
 
509
506
  def wage_growth_rates(self, year=None):
510
507
  if year is not None:
511
- return self._wage_growth_rates[year - self.start_year]
508
+ syr = max(self.start_year, self._gfactors.first_year)
509
+ return self._wage_growth_rates[year - syr]
512
510
  return self._wage_growth_rates or []
513
511
 
514
512
  def inflation_rates(self, year=None):
515
513
  if year is not None:
516
- return self._inflation_rates[year - self.start_year]
514
+ syr = max(self.start_year, self._gfactors.first_year)
515
+ return self._inflation_rates[year - syr]
517
516
  return self._inflation_rates or []
518
517
 
519
518
  # alias methods below
@@ -776,7 +775,7 @@ class Parameters(pt.Parameters):
776
775
  attr[1:], year=list(range(self.start_year, self.end_year + 1))
777
776
  )
778
777
  else:
779
- raise AttributeError(f"{attr} not definied.")
778
+ raise AttributeError(f"{attr} is not defined.")
780
779
 
781
780
 
782
781
  TaxcalcReform = Union[str, Mapping[int, Any]]
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
 
@@ -25,6 +24,9 @@ class Policy(Parameters):
25
24
  gfactors: GrowFactors class instance
26
25
  containing price inflation rates and wage growth rates
27
26
 
27
+ last_budget_year: integer
28
+ user-defined last parameter extrapolation year
29
+
28
30
  Raises
29
31
  ------
30
32
  ValueError:
@@ -40,9 +42,16 @@ class Policy(Parameters):
40
42
  JSON_START_YEAR = 2013 # remains the same unless earlier data added
41
43
  LAST_KNOWN_YEAR = 2025 # last year for which indexed param vals are known
42
44
  # should increase LAST_KNOWN_YEAR by one every calendar year
43
- LAST_BUDGET_YEAR = 2034 # last extrapolation year
45
+ LAST_BUDGET_YEAR = 2034 # default value of last extrapolation year
44
46
  # should increase LAST_BUDGET_YEAR by one every calendar year
45
- DEFAULT_NUM_YEARS = LAST_BUDGET_YEAR - JSON_START_YEAR + 1
47
+
48
+ @staticmethod
49
+ def number_of_years(last_budget_year=LAST_BUDGET_YEAR):
50
+ """
51
+ Static method returns number of policy parameters years given
52
+ user-defined last_budget_year.
53
+ """
54
+ return last_budget_year - Policy.JSON_START_YEAR + 1
46
55
 
47
56
  # NOTE: the following three data structures use internal parameter names:
48
57
  # (1) specify which Policy parameters have been removed or renamed
@@ -53,7 +62,7 @@ class Policy(Parameters):
53
62
  'DependentCredit_before_CTC': 'is a removed parameter name',
54
63
  'FilerCredit_c': 'is a removed parameter name',
55
64
  'ALD_InvInc_ec_base_RyanBrady': 'is a removed parameter name',
56
- # TODO: following parameter renamed in PR 2292 merged on 2019-04-15
65
+ # following parameter renamed in PR 2292 merged on 2019-04-15
57
66
  "cpi_offset": (
58
67
  "was renamed parameter_indexing_CPI_offset. "
59
68
  "See documentation for change in usage."
@@ -62,7 +71,7 @@ class Policy(Parameters):
62
71
  "was renamed parameter_indexing_CPI_offset. "
63
72
  "See documentation for change in usage."
64
73
  ),
65
- # TODO: following parameters renamed in PR 2345 merged on 2019-06-24
74
+ # following parameters renamed in PR 2345 merged on 2019-06-24
66
75
  'PT_excl_rt':
67
76
  'was renamed PT_qbid_rt in release 2.4.0',
68
77
  'PT_excl_wagelim_thd':
@@ -81,7 +90,10 @@ class Policy(Parameters):
81
90
  # (3) specify which Policy parameters are wage (rather than price) indexed
82
91
  WAGE_INDEXED_PARAMS = ['SS_Earnings_c', 'SS_Earnings_thd']
83
92
 
84
- def __init__(self, gfactors=None, **kwargs):
93
+ def __init__(self,
94
+ gfactors=None,
95
+ last_budget_year=LAST_BUDGET_YEAR,
96
+ **kwargs):
85
97
  # put JSON contents of DEFAULTS_FILE_NAME into self._vals dictionary
86
98
  super().__init__()
87
99
  # handle gfactors argument
@@ -93,7 +105,7 @@ class Policy(Parameters):
93
105
  raise ValueError('gfactors is not None or a GrowFactors instance')
94
106
  # read default parameters and initialize
95
107
  syr = Policy.JSON_START_YEAR
96
- nyrs = Policy.DEFAULT_NUM_YEARS
108
+ nyrs = Policy.number_of_years(last_budget_year)
97
109
  self._inflation_rates = None
98
110
  self._wage_growth_rates = None
99
111
  self.initialize(syr, nyrs, Policy.LAST_KNOWN_YEAR,
@@ -102,17 +114,21 @@ class Policy(Parameters):
102
114
  Policy.WAGE_INDEXED_PARAMS, **kwargs)
103
115
 
104
116
  @staticmethod
105
- def tmd_constructor(growfactors_path): # pragma: no cover
117
+ def tmd_constructor(
118
+ growfactors: Path | GrowFactors,
119
+ last_budget_year=LAST_BUDGET_YEAR,
120
+ ): # pragma: no cover
106
121
  """
107
122
  Static method returns a Policy object instantiated with TMD
108
123
  input data. This convenience method works in a analogous way
109
124
  to Policy(), which returns a Policy object instantiated with
110
125
  non-TMD input data.
111
126
  """
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)
127
+ if isinstance(growfactors, Path):
128
+ growfactors = GrowFactors(growfactors_filename=str(growfactors))
129
+ else:
130
+ assert isinstance(growfactors, GrowFactors)
131
+ return Policy(gfactors=growfactors, last_budget_year=last_budget_year)
116
132
 
117
133
  @staticmethod
118
134
  def read_json_reform(obj):
@@ -147,32 +163,20 @@ class Policy(Parameters):
147
163
  return [k for k in defaults if k != "schema"]
148
164
 
149
165
  def set_rates(self):
150
- """Initialize taxcalc indexing data."""
166
+ """
167
+ Initialize policy parameter indexing rates.
168
+ """
151
169
  cpi_vals = [
152
170
  vo["value"] for
153
171
  vo in self._data["parameter_indexing_CPI_offset"]["value"]
154
172
  ]
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)
173
+ # policy_current_law.json should not specify any non-zero values
174
+ # for the parameter_indexing_CPI_offset parameter, so check this
175
+ assert any(cpi_vals) is False
176
+ syr = max(self.start_year, self._gfactors.first_year)
177
+ self._inflation_rates = self._gfactors.price_inflation_rates(
178
+ syr, self.end_year
159
179
  )
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
180
  self._wage_growth_rates = self._gfactors.wage_growth_rates(
177
- self.start_year, self.end_year
181
+ syr, self.end_year
178
182
  )