taxcalc 3.5.3__tar.gz → 3.6.0__tar.gz
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-3.5.3 → taxcalc-3.6.0}/MANIFEST.in +1 -1
- {taxcalc-3.5.3/taxcalc.egg-info → taxcalc-3.6.0}/PKG-INFO +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/setup.py +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/__init__.py +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/cli/tc.py +5 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/consumption.json +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/data.py +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/growdiff.json +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/growdiff.py +9 -3
- taxcalc-3.6.0/taxcalc/growfactors.csv +65 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/growfactors.py +6 -6
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/policy_current_law.json +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/records.py +29 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/taxcalcio.py +41 -16
- taxcalc-3.6.0/taxcalc/tmd_weights.csv.gz +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/utils.py +72 -48
- {taxcalc-3.5.3 → taxcalc-3.6.0/taxcalc.egg-info}/PKG-INFO +1 -1
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc.egg-info/SOURCES.txt +1 -0
- taxcalc-3.5.3/taxcalc/growfactors.csv +0 -25
- {taxcalc-3.5.3 → taxcalc-3.6.0}/LICENSE +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/README.md +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/setup.cfg +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/calcfunctions.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/calculator.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/cli/__init__.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/conftest.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/consumption.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/cps.csv.gz +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/cps_weights.csv.gz +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/decorators.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/parameters.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/policy.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/puf_ratios.csv +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/puf_weights.csv.gz +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/records_variables.json +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc/utilsprvt.py +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc.egg-info/dependency_links.txt +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc.egg-info/entry_points.txt +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc.egg-info/requires.txt +0 -0
- {taxcalc-3.5.3 → taxcalc-3.6.0}/taxcalc.egg-info/top_level.txt +0 -0
@@ -153,7 +153,11 @@ def cli_tc_main():
|
|
153
153
|
sys.stderr.write(tcio.errmsg)
|
154
154
|
sys.stderr.write('USAGE: tc --help\n')
|
155
155
|
return 1
|
156
|
-
aging =
|
156
|
+
aging = (
|
157
|
+
inputfn.endswith('puf.csv') or
|
158
|
+
inputfn.endswith('cps.csv') or
|
159
|
+
inputfn.endswith('tmd.csv')
|
160
|
+
)
|
157
161
|
tcio.init(input_data=inputfn, tax_year=taxyear,
|
158
162
|
baseline=args.baseline,
|
159
163
|
reform=args.reform, assump=args.assump,
|
@@ -276,6 +276,6 @@ class Data():
|
|
276
276
|
|
277
277
|
def _extrapolate(self, year):
|
278
278
|
"""
|
279
|
-
Apply to
|
279
|
+
Apply to data variables the growth factor values for specified year.
|
280
280
|
"""
|
281
281
|
# Override this empty method in subclass
|
@@ -7,6 +7,7 @@ Tax-Calculator GrowDiff class that is used to modify GrowFactors.
|
|
7
7
|
import os
|
8
8
|
import numpy as np
|
9
9
|
from taxcalc.parameters import Parameters
|
10
|
+
from taxcalc.policy import Policy
|
10
11
|
from taxcalc.growfactors import GrowFactors
|
11
12
|
|
12
13
|
|
@@ -26,8 +27,8 @@ class GrowDiff(Parameters):
|
|
26
27
|
class instance: GrowDiff
|
27
28
|
"""
|
28
29
|
|
29
|
-
JSON_START_YEAR =
|
30
|
-
DEFAULT_NUM_YEARS =
|
30
|
+
JSON_START_YEAR = Policy.JSON_START_YEAR
|
31
|
+
DEFAULT_NUM_YEARS = Policy.DEFAULT_NUM_YEARS
|
31
32
|
DEFAULTS_FILE_NAME = 'growdiff.json'
|
32
33
|
DEFAULTS_FILE_PATH = os.path.abspath(os.path.dirname(__file__))
|
33
34
|
|
@@ -75,8 +76,13 @@ class GrowDiff(Parameters):
|
|
75
76
|
"""
|
76
77
|
assert isinstance(growfactors, GrowFactors)
|
77
78
|
for gfvn in GrowFactors.VALID_NAMES:
|
78
|
-
_gfvn = '_{}'
|
79
|
+
_gfvn = f'_{gfvn}'
|
79
80
|
for i in range(0, self.num_years):
|
80
81
|
cyr = i + self.start_year
|
81
82
|
diff_array = getattr(self, _gfvn)
|
82
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
|
+
"""
|
@@ -0,0 +1,65 @@
|
|
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
|
@@ -33,7 +33,7 @@ class GrowFactors():
|
|
33
33
|
Notes
|
34
34
|
-----
|
35
35
|
Typical usage is "gfactor = GrowFactors()", which produces an object
|
36
|
-
containing
|
36
|
+
containing growth factors in the GrowFactors.FILE_NAME file.
|
37
37
|
"""
|
38
38
|
|
39
39
|
FILE_NAME = 'growfactors.csv'
|
@@ -56,7 +56,7 @@ class GrowFactors():
|
|
56
56
|
growfactors_filename)
|
57
57
|
if os.path.isfile(full_filename):
|
58
58
|
gfdf = pd.read_csv(full_filename, index_col='YEAR')
|
59
|
-
else: # find file in
|
59
|
+
else: # find file in package
|
60
60
|
gfdf = read_egg_csv(os.path.basename(growfactors_filename),
|
61
61
|
index_col='YEAR') # pragma: no cover
|
62
62
|
else:
|
@@ -65,7 +65,7 @@ class GrowFactors():
|
|
65
65
|
# check validity of gfdf column names
|
66
66
|
gfdf_names = set(list(gfdf))
|
67
67
|
if gfdf_names != GrowFactors.VALID_NAMES:
|
68
|
-
msg =
|
68
|
+
msg = 'missing names are: {} and invalid names are: {}'
|
69
69
|
missing = GrowFactors.VALID_NAMES - gfdf_names
|
70
70
|
invalid = gfdf_names - GrowFactors.VALID_NAMES
|
71
71
|
raise ValueError(msg.format(missing, invalid))
|
@@ -143,11 +143,11 @@ class GrowFactors():
|
|
143
143
|
if year > self.last_year:
|
144
144
|
msg = 'year={} > GrowFactors.last_year={}'
|
145
145
|
raise ValueError(msg.format(year, self.last_year))
|
146
|
-
return self.gfdf[name]
|
146
|
+
return self.gfdf.loc[year,name]
|
147
147
|
|
148
148
|
def update(self, name, year, diff):
|
149
149
|
"""
|
150
|
-
Add to self.gfdf
|
150
|
+
Add to self.gfdf (for name and year) the specified diff amount.
|
151
151
|
"""
|
152
152
|
if self.used:
|
153
153
|
msg = 'cannot update growfactors after they have been used'
|
@@ -156,4 +156,4 @@ class GrowFactors():
|
|
156
156
|
assert year >= self.first_year
|
157
157
|
assert year <= self.last_year
|
158
158
|
assert isinstance(diff, float)
|
159
|
-
self.gfdf[name]
|
159
|
+
self.gfdf.loc[year,name] += diff
|
@@ -20692,4 +20692,4 @@
|
|
20692
20692
|
"cps": true
|
20693
20693
|
}
|
20694
20694
|
}
|
20695
|
-
}
|
20695
|
+
}
|
@@ -96,7 +96,10 @@ class Records(Data):
|
|
96
96
|
doing when attempting this.
|
97
97
|
|
98
98
|
Use Records.cps_constructor() to get a Records object instantiated
|
99
|
-
with CPS input data.
|
99
|
+
with CPS input data developed in the taxdata repository.
|
100
|
+
|
101
|
+
Use Records.tmd_constructor() to get a Records object instantiated
|
102
|
+
with TMD input data developed in the tax-microdata repository.
|
100
103
|
"""
|
101
104
|
# suppress pylint warning about constructor having too many arguments:
|
102
105
|
# pylint: disable=too-many-arguments
|
@@ -107,11 +110,14 @@ class Records(Data):
|
|
107
110
|
|
108
111
|
PUFCSV_YEAR = 2011
|
109
112
|
CPSCSV_YEAR = 2014
|
113
|
+
TMDCSV_YEAR = 2021
|
110
114
|
|
111
115
|
PUF_WEIGHTS_FILENAME = 'puf_weights.csv.gz'
|
112
116
|
PUF_RATIOS_FILENAME = 'puf_ratios.csv'
|
113
117
|
CPS_WEIGHTS_FILENAME = 'cps_weights.csv.gz'
|
114
118
|
CPS_RATIOS_FILENAME = None
|
119
|
+
TMD_WEIGHTS_FILENAME = 'tmd_weights.csv.gz'
|
120
|
+
TMD_RATIOS_FILENAME = None
|
115
121
|
CODE_PATH = os.path.abspath(os.path.dirname(__file__))
|
116
122
|
VARINFO_FILE_NAME = 'records_variables.json'
|
117
123
|
VARINFO_FILE_PATH = CODE_PATH
|
@@ -218,6 +224,28 @@ class Records(Data):
|
|
218
224
|
adjust_ratios=Records.CPS_RATIOS_FILENAME,
|
219
225
|
exact_calculations=exact_calculations)
|
220
226
|
|
227
|
+
@staticmethod
|
228
|
+
def tmd_constructor(data, # path to tmd.csv file or dataframe
|
229
|
+
gfactors=GrowFactors(),
|
230
|
+
exact_calculations=False): # pragma: no cover
|
231
|
+
"""
|
232
|
+
Static method returns a Records object instantiated with TMD
|
233
|
+
input data. This works in a analogous way to Records(), which
|
234
|
+
returns a Records object instantiated with PUF input data.
|
235
|
+
This is a convenience method that eliminates the need to
|
236
|
+
specify all the details of the TMD input data just as the
|
237
|
+
default values of the arguments of the Records class constructor
|
238
|
+
eliminate the need to specify all the details of the PUF input
|
239
|
+
data.
|
240
|
+
"""
|
241
|
+
weights = os.path.join(Records.CODE_PATH, Records.TMD_WEIGHTS_FILENAME)
|
242
|
+
return Records(data=data,
|
243
|
+
start_year=Records.TMDCSV_YEAR,
|
244
|
+
gfactors=gfactors,
|
245
|
+
weights=weights,
|
246
|
+
adjust_ratios=Records.TMD_RATIOS_FILENAME,
|
247
|
+
exact_calculations=exact_calculations)
|
248
|
+
|
221
249
|
def increment_year(self):
|
222
250
|
"""
|
223
251
|
Add one to current year, and also does
|
@@ -73,6 +73,7 @@ class TaxCalcIO():
|
|
73
73
|
inp = 'x'
|
74
74
|
self.puf_input_data = False
|
75
75
|
self.cps_input_data = False
|
76
|
+
self.tmd_input_data = False
|
76
77
|
if isinstance(input_data, str):
|
77
78
|
# remove any leading directory path from INPUT filename
|
78
79
|
fname = os.path.basename(input_data)
|
@@ -85,6 +86,7 @@ class TaxCalcIO():
|
|
85
86
|
# check existence of INPUT file
|
86
87
|
self.puf_input_data = input_data.endswith('puf.csv')
|
87
88
|
self.cps_input_data = input_data.endswith('cps.csv')
|
89
|
+
self.tmd_input_data = input_data.endswith('tmd.csv')
|
88
90
|
if not self.cps_input_data and not os.path.isfile(input_data):
|
89
91
|
msg = 'INPUT file could not be found'
|
90
92
|
self.errmsg += 'ERROR: {}\n'.format(msg)
|
@@ -320,7 +322,18 @@ class TaxCalcIO():
|
|
320
322
|
gfactors=gfactors_base,
|
321
323
|
exact_calculations=exact_calculations
|
322
324
|
)
|
323
|
-
|
325
|
+
elif self.tmd_input_data:
|
326
|
+
recs = Records.tmd_constructor(
|
327
|
+
data=input_data,
|
328
|
+
gfactors=gfactors_ref,
|
329
|
+
exact_calculations=exact_calculations
|
330
|
+
) # pragma: no cover
|
331
|
+
recs_base = Records.tmd_constructor(
|
332
|
+
data=input_data,
|
333
|
+
gfactors=gfactors_base,
|
334
|
+
exact_calculations=exact_calculations
|
335
|
+
) # pragma: no cover
|
336
|
+
else: # if not {cps|tmd}_input_data but aging_input_data
|
324
337
|
recs = Records(
|
325
338
|
data=input_data,
|
326
339
|
gfactors=gfactors_ref,
|
@@ -589,12 +602,24 @@ class TaxCalcIO():
|
|
589
602
|
pop_quantiles=False,
|
590
603
|
weight_by_income_measure=False)
|
591
604
|
gdfx = dfx.groupby('table_row', as_index=False, observed=True)
|
592
|
-
rtns_series = gdfx.apply(
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
605
|
+
rtns_series = gdfx.apply(
|
606
|
+
unweighted_sum, 's006', include_groups=False
|
607
|
+
).values[:, 1]
|
608
|
+
xinc_series = gdfx.apply(
|
609
|
+
weighted_sum, 'expanded_income', include_groups=False
|
610
|
+
).values[:, 1]
|
611
|
+
itax_series = gdfx.apply(
|
612
|
+
weighted_sum, 'iitax', include_groups=False
|
613
|
+
).values[:, 1]
|
614
|
+
ptax_series = gdfx.apply(
|
615
|
+
weighted_sum, 'payrolltax', include_groups=False
|
616
|
+
).values[:, 1]
|
617
|
+
htax_series = gdfx.apply(
|
618
|
+
weighted_sum, 'lumpsum_tax', include_groups=False
|
619
|
+
).values[:, 1]
|
620
|
+
ctax_series = gdfx.apply(
|
621
|
+
weighted_sum, 'combined', include_groups=False
|
622
|
+
).values[:, 1]
|
598
623
|
# write decile table to text file
|
599
624
|
row = 'Weighted Tax {} by Baseline Expanded-Income Decile\n'
|
600
625
|
tfile.write(row.format(tkind))
|
@@ -647,6 +672,15 @@ class TaxCalcIO():
|
|
647
672
|
"""
|
648
673
|
pos_wght_sum = self.calc.total_weight() > 0.0
|
649
674
|
fig = None
|
675
|
+
# percentage-aftertax-income-change graph
|
676
|
+
pch_fname = self._output_filename.replace('.csv', '-pch.html')
|
677
|
+
pch_title = 'PCH by Income Percentile'
|
678
|
+
if pos_wght_sum:
|
679
|
+
fig = self.calc_base.pch_graph(self.calc, pop_quantiles=False)
|
680
|
+
write_graph_file(fig, pch_fname, pch_title)
|
681
|
+
else:
|
682
|
+
reason = 'No graph because sum of weights is not positive'
|
683
|
+
TaxCalcIO.write_empty_graph_file(pch_fname, pch_title, reason)
|
650
684
|
# average-tax-rate graph
|
651
685
|
atr_fname = self._output_filename.replace('.csv', '-atr.html')
|
652
686
|
atr_title = 'ATR by Income Percentile'
|
@@ -669,15 +703,6 @@ class TaxCalcIO():
|
|
669
703
|
else:
|
670
704
|
reason = 'No graph because sum of weights is not positive'
|
671
705
|
TaxCalcIO.write_empty_graph_file(mtr_fname, mtr_title, reason)
|
672
|
-
# percentage-aftertax-income-change graph
|
673
|
-
pch_fname = self._output_filename.replace('.csv', '-pch.html')
|
674
|
-
pch_title = 'PCH by Income Percentile'
|
675
|
-
if pos_wght_sum:
|
676
|
-
fig = self.calc_base.pch_graph(self.calc, pop_quantiles=False)
|
677
|
-
write_graph_file(fig, pch_fname, pch_title)
|
678
|
-
else:
|
679
|
-
reason = 'No graph because sum of weights is not positive'
|
680
|
-
TaxCalcIO.write_empty_graph_file(pch_fname, pch_title, reason)
|
681
706
|
if fig:
|
682
707
|
del fig
|
683
708
|
gc.collect()
|
Binary file
|
@@ -12,10 +12,9 @@ import math
|
|
12
12
|
import json
|
13
13
|
import copy
|
14
14
|
import collections
|
15
|
-
import
|
15
|
+
import importlib.resources as implibres
|
16
16
|
import numpy as np
|
17
17
|
import pandas as pd
|
18
|
-
import bokeh.io as bio
|
19
18
|
import bokeh.plotting as bp
|
20
19
|
from bokeh.models import PrintfTickFormatter
|
21
20
|
from taxcalc.utilsprvt import (weighted_mean,
|
@@ -335,9 +334,13 @@ def create_distribution_table(vdf, groupby, income_measure,
|
|
335
334
|
sdf = pd.DataFrame()
|
336
335
|
for col in DIST_TABLE_COLUMNS:
|
337
336
|
if col in unweighted_columns:
|
338
|
-
sdf[col] = gdf.apply(
|
337
|
+
sdf[col] = gdf.apply(
|
338
|
+
unweighted_sum, col, include_groups=False
|
339
|
+
).values[:, 1]
|
339
340
|
else:
|
340
|
-
sdf[col] = gdf.apply(
|
341
|
+
sdf[col] = gdf.apply(
|
342
|
+
weighted_sum, col, include_groups=False
|
343
|
+
).values[:, 1]
|
341
344
|
return sdf
|
342
345
|
# main logic of create_distribution_table
|
343
346
|
assert isinstance(vdf, pd.DataFrame)
|
@@ -484,20 +487,33 @@ def create_difference_table(vdf1, vdf2, groupby, tax_to_diff,
|
|
484
487
|
return dframe[dframe[col_name] > tolerance]['count'].sum()
|
485
488
|
# start of additive_stats_dataframe code
|
486
489
|
sdf = pd.DataFrame()
|
487
|
-
sdf['count'] = gdf.apply(
|
488
|
-
|
489
|
-
|
490
|
-
sdf['
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
490
|
+
sdf['count'] = gdf.apply(
|
491
|
+
unweighted_sum, 'count', include_groups=False
|
492
|
+
).values[:, 1]
|
493
|
+
sdf['tax_cut'] = gdf.apply(
|
494
|
+
count_lt_zero, 'tax_diff', include_groups=False
|
495
|
+
).values[:, 1]
|
496
|
+
sdf['tax_inc'] = gdf.apply(
|
497
|
+
count_gt_zero, 'tax_diff', include_groups=False
|
498
|
+
).values[:, 1]
|
499
|
+
sdf['tot_change'] = gdf.apply(
|
500
|
+
weighted_sum, 'tax_diff', include_groups=False
|
501
|
+
).values[:, 1]
|
502
|
+
sdf['ubi'] = gdf.apply(
|
503
|
+
weighted_sum, 'ubi', include_groups=False
|
504
|
+
).values[:, 1]
|
495
505
|
sdf['benefit_cost_total'] = gdf.apply(
|
496
|
-
weighted_sum, 'benefit_cost_total'
|
506
|
+
weighted_sum, 'benefit_cost_total', include_groups=False
|
507
|
+
).values[:, 1]
|
497
508
|
sdf['benefit_value_total'] = gdf.apply(
|
498
|
-
weighted_sum, 'benefit_value_total'
|
499
|
-
|
500
|
-
sdf['
|
509
|
+
weighted_sum, 'benefit_value_total', include_groups=False
|
510
|
+
).values[:, 1]
|
511
|
+
sdf['atinc1'] = gdf.apply(
|
512
|
+
weighted_sum, 'atinc1', include_groups=False
|
513
|
+
).values[:, 1]
|
514
|
+
sdf['atinc2'] = gdf.apply(
|
515
|
+
weighted_sum, 'atinc2', include_groups=False
|
516
|
+
).values[:, 1]
|
501
517
|
return sdf
|
502
518
|
# main logic of create_difference_table
|
503
519
|
assert groupby in ('weighted_deciles',
|
@@ -903,8 +919,12 @@ def mtr_graph_data(vdf, year,
|
|
903
919
|
# split dfx into groups specified by 'table_row' column
|
904
920
|
gdfx = dfx.groupby('table_row', observed=False, as_index=False)
|
905
921
|
# apply the weighting_function to percentile-grouped mtr values
|
906
|
-
mtr1_series = gdfx.apply(
|
907
|
-
|
922
|
+
mtr1_series = gdfx.apply(
|
923
|
+
weighting_function, 'mtr1', include_groups=False
|
924
|
+
).values[:, 1]
|
925
|
+
mtr2_series = gdfx.apply(
|
926
|
+
weighting_function, 'mtr2', include_groups=False
|
927
|
+
).values[:, 1]
|
908
928
|
# construct DataFrame containing the two mtr?_series
|
909
929
|
lines = pd.DataFrame()
|
910
930
|
lines['base'] = mtr1_series
|
@@ -1020,9 +1040,15 @@ def atr_graph_data(vdf, year,
|
|
1020
1040
|
# split dfx into groups specified by 'table_row' column
|
1021
1041
|
gdfx = dfx.groupby('table_row', observed=False, as_index=False)
|
1022
1042
|
# apply weighted_mean function to percentile-grouped values
|
1023
|
-
avginc_series = gdfx.apply(
|
1024
|
-
|
1025
|
-
|
1043
|
+
avginc_series = gdfx.apply(
|
1044
|
+
weighted_mean, 'expanded_income', include_groups=False
|
1045
|
+
).values[:, 1]
|
1046
|
+
avgtax1_series = gdfx.apply(
|
1047
|
+
weighted_mean, 'tax1', include_groups=False
|
1048
|
+
).values[:, 1]
|
1049
|
+
avgtax2_series = gdfx.apply(
|
1050
|
+
weighted_mean, 'tax2', include_groups=False
|
1051
|
+
).values[:, 1]
|
1026
1052
|
# compute average tax rates for each included income percentile
|
1027
1053
|
atr1_series = np.zeros(avginc_series.shape)
|
1028
1054
|
atr1_series[included] = np.divide(
|
@@ -1107,8 +1133,8 @@ def xtr_graph_plot(data,
|
|
1107
1133
|
|
1108
1134
|
OR when executing script using Python command-line interpreter::
|
1109
1135
|
|
1110
|
-
|
1111
|
-
|
1136
|
+
bp.output_file('graph-name.html', title='?TR by Income Percentile')
|
1137
|
+
bp.show(gplot) [OR bp.save(gplot) WILL JUST WRITE FILE TO DISK]
|
1112
1138
|
|
1113
1139
|
WILL VISUALIZE GRAPH IN BROWSER AND WRITE GRAPH TO SPECIFIED HTML FILE
|
1114
1140
|
|
@@ -1194,8 +1220,12 @@ def pch_graph_data(vdf, year, pop_quantiles=False):
|
|
1194
1220
|
# split dfx into groups specified by 'table_row' column
|
1195
1221
|
gdfx = dfx.groupby('table_row', observed=False, as_index=False)
|
1196
1222
|
# apply weighted_mean function to percentile-grouped values
|
1197
|
-
avginc_series = gdfx.apply(
|
1198
|
-
|
1223
|
+
avginc_series = gdfx.apply(
|
1224
|
+
weighted_mean, 'expanded_income', include_groups=False
|
1225
|
+
).values[:, 1]
|
1226
|
+
change_series = gdfx.apply(
|
1227
|
+
weighted_mean, 'chg_aftinc', include_groups=False
|
1228
|
+
).values[:, 1]
|
1199
1229
|
# compute percentage change statistic each included income percentile
|
1200
1230
|
pch_series = np.zeros(avginc_series.shape)
|
1201
1231
|
pch_series[included] = np.divide(
|
@@ -1261,8 +1291,8 @@ def pch_graph_plot(data,
|
|
1261
1291
|
title = data['title']
|
1262
1292
|
fig = bp.figure(width=width, height=height, title=title)
|
1263
1293
|
fig.title.text_font_size = '12pt'
|
1264
|
-
|
1265
|
-
|
1294
|
+
line = data['line']
|
1295
|
+
fig.line(line.index, line.pch, line_color='blue', line_width=3)
|
1266
1296
|
fig.circle(0, 0, visible=False) # force zero to be included on y axis
|
1267
1297
|
zero_grid_line_range = range(0, 101)
|
1268
1298
|
zero_grid_line_height = [0] * len(zero_grid_line_range)
|
@@ -1278,8 +1308,9 @@ def pch_graph_plot(data,
|
|
1278
1308
|
fig.yaxis.axis_label = ylabel
|
1279
1309
|
fig.yaxis.axis_label_text_font_size = '12pt'
|
1280
1310
|
fig.yaxis.axis_label_text_font_style = 'normal'
|
1281
|
-
fig.yaxis[0].formatter = PrintfTickFormatter(format='
|
1282
|
-
return fig
|
1311
|
+
fig.yaxis[0].formatter = PrintfTickFormatter(format='%.1f')
|
1312
|
+
# return fig # bokeh 3.4.1 cannot save this figure for some unknown reason
|
1313
|
+
return None
|
1283
1314
|
|
1284
1315
|
|
1285
1316
|
def write_graph_file(figure, filename, title):
|
@@ -1301,9 +1332,10 @@ def write_graph_file(figure, filename, title):
|
|
1301
1332
|
-------
|
1302
1333
|
Nothing
|
1303
1334
|
"""
|
1304
|
-
delete_file(filename)
|
1305
|
-
|
1306
|
-
|
1335
|
+
delete_file(filename)
|
1336
|
+
if figure:
|
1337
|
+
bp.output_file(filename=filename, title=title)
|
1338
|
+
bp.save(figure)
|
1307
1339
|
|
1308
1340
|
|
1309
1341
|
def isoelastic_utility_function(consumption, crra, cmin):
|
@@ -1482,15 +1514,11 @@ def read_egg_csv(fname, index_col=None):
|
|
1482
1514
|
return pandas DataFrame containing the data.
|
1483
1515
|
"""
|
1484
1516
|
try:
|
1485
|
-
path_in_egg =
|
1486
|
-
|
1487
|
-
|
1488
|
-
pkg_resources.Requirement.parse('taxcalc'),
|
1489
|
-
path_in_egg),
|
1490
|
-
index_col=index_col
|
1491
|
-
)
|
1517
|
+
path_in_egg = implibres.files('taxcalc').joinpath(fname)
|
1518
|
+
with implibres.as_file(path_in_egg) as rname:
|
1519
|
+
vdf = pd.read_csv(rname, index_col=index_col)
|
1492
1520
|
except Exception:
|
1493
|
-
raise ValueError('could not read {} data from egg'
|
1521
|
+
raise ValueError(f'could not read {fname} data from egg')
|
1494
1522
|
# cannot call read_egg_ function in unit tests
|
1495
1523
|
return vdf # pragma: no cover
|
1496
1524
|
|
@@ -1501,15 +1529,11 @@ def read_egg_json(fname):
|
|
1501
1529
|
return dictionary containing the data.
|
1502
1530
|
"""
|
1503
1531
|
try:
|
1504
|
-
path_in_egg =
|
1505
|
-
|
1506
|
-
|
1507
|
-
pkg_resources.Requirement.parse('taxcalc'),
|
1508
|
-
path_in_egg).read().decode('utf-8'),
|
1509
|
-
object_pairs_hook=collections.OrderedDict
|
1510
|
-
)
|
1532
|
+
path_in_egg = implibres.files('taxcalc').joinpath(fname)
|
1533
|
+
with implibres.as_file(path_in_egg) as rname:
|
1534
|
+
vdf = json.loads(rname)
|
1511
1535
|
except Exception:
|
1512
|
-
raise ValueError('could not read {} data from egg'
|
1536
|
+
raise ValueError(f'could not read {fname} data from egg')
|
1513
1537
|
# cannot call read_egg_ function in unit tests
|
1514
1538
|
return pdict # pragma: no cover
|
1515
1539
|
|
@@ -1,25 +0,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.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.998715,1.063959,1,1
|
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,1.002574,1.034828,1,1
|
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,1.002567,1.034809,1,1
|
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,1.003841,1.034974,1,1
|
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,1.002551,1.034869,1,1
|
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,1.002545,1.034942,1,1
|
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,1.003807,1.034968,1,1
|
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,1.002528,1.034951,1,1
|
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,1.003783,1.034897,1,1
|
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.999552,1,1.002513,1.034808,1,1
|
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,1,1,1,1.002506,1.034863,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
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,1,1,1,1,1,1,1
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|