taxcalc 4.5.0__py3-none-any.whl → 4.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- taxcalc/__init__.py +1 -1
- taxcalc/calcfunctions.py +2 -6
- taxcalc/calculator.py +18 -18
- taxcalc/cli/tc.py +251 -118
- taxcalc/data.py +2 -2
- taxcalc/parameters.py +0 -5
- taxcalc/policy.py +3 -12
- taxcalc/policy_current_law.json +7 -3
- taxcalc/reforms/ext.json +5 -2
- taxcalc/taxcalcio.py +350 -325
- taxcalc/tests/test_4package.py +1 -0
- taxcalc/tests/test_calculator.py +3 -3
- taxcalc/tests/test_reforms.py +8 -8
- taxcalc/tests/test_taxcalcio.py +78 -120
- taxcalc/utils.py +4 -10
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info}/METADATA +3 -2
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info}/RECORD +21 -21
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info}/WHEEL +1 -1
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info}/entry_points.txt +0 -0
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info/licenses}/LICENSE +0 -0
- {taxcalc-4.5.0.dist-info → taxcalc-4.6.1.dist-info}/top_level.txt +0 -0
taxcalc/tests/test_4package.py
CHANGED
taxcalc/tests/test_calculator.py
CHANGED
@@ -69,7 +69,7 @@ def test_make_calculator_with_policy_reform(cps_subsample):
|
|
69
69
|
pol.implement_reform(reform)
|
70
70
|
# create a Calculator object using this policy reform
|
71
71
|
calc = Calculator(policy=pol, records=rec)
|
72
|
-
assert calc.
|
72
|
+
assert calc.reform_errors == {}
|
73
73
|
# check that Policy object embedded in Calculator object is correct
|
74
74
|
assert calc.current_year == year
|
75
75
|
assert calc.policy_param('II_em') == 4000
|
@@ -808,10 +808,10 @@ def test_itemded_component_amounts(year, cvname, hcname, puf_fullsample):
|
|
808
808
|
policy2.implement_reform(reform2)
|
809
809
|
assert not policy2.parameter_errors
|
810
810
|
# compute tax liability in specified year
|
811
|
-
calc1 = Calculator(policy=policy1, records=recs, verbose=
|
811
|
+
calc1 = Calculator(policy=policy1, records=recs, verbose=True)
|
812
812
|
calc1.advance_to_year(year)
|
813
813
|
calc1.calc_all()
|
814
|
-
calc2 = Calculator(policy=policy2, records=recs, verbose=
|
814
|
+
calc2 = Calculator(policy=policy2, records=recs, verbose=True)
|
815
815
|
calc2.advance_to_year(year)
|
816
816
|
calc2.calc_all()
|
817
817
|
# confirm that nobody is taking the standard deduction
|
taxcalc/tests/test_reforms.py
CHANGED
@@ -28,7 +28,7 @@ def test_2017_law_reform(tests_path):
|
|
28
28
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
29
29
|
rtext = rfile.read()
|
30
30
|
pol.implement_reform(Policy.read_json_reform(rtext))
|
31
|
-
assert not pol.
|
31
|
+
assert not pol.parameter_errors
|
32
32
|
pol.set_year(2018)
|
33
33
|
pre_mdata = dict(pol.items())
|
34
34
|
# check some policy parameter values against expected values under 2017 law
|
@@ -102,14 +102,14 @@ def test_round_trip_reforms(fyear, tests_path):
|
|
102
102
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
103
103
|
rtext = rfile.read()
|
104
104
|
rtr_pol.implement_reform(Policy.read_json_reform(rtext))
|
105
|
-
assert not rtr_pol.
|
105
|
+
assert not rtr_pol.parameter_errors
|
106
106
|
assert not rtr_pol.errors
|
107
107
|
# Layer on TCJA
|
108
108
|
reform_file = os.path.join(tests_path, '..', 'reforms', 'TCJA.json')
|
109
109
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
110
110
|
rtext = rfile.read()
|
111
111
|
rtr_pol.implement_reform(Policy.read_json_reform(rtext))
|
112
|
-
assert not rtr_pol.
|
112
|
+
assert not rtr_pol.parameter_errors
|
113
113
|
assert not rtr_pol.errors
|
114
114
|
# Layer on the CARES Act
|
115
115
|
reform_file = os.path.join(tests_path, '..', 'reforms', 'CARES.json')
|
@@ -123,21 +123,21 @@ def test_round_trip_reforms(fyear, tests_path):
|
|
123
123
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
124
124
|
rtext = rfile.read()
|
125
125
|
rtr_pol.implement_reform(Policy.read_json_reform(rtext))
|
126
|
-
assert not rtr_pol.
|
126
|
+
assert not rtr_pol.parameter_errors
|
127
127
|
assert not rtr_pol.errors
|
128
128
|
# Layer on ARPA
|
129
129
|
reform_file = os.path.join(tests_path, '..', 'reforms', 'ARPA.json')
|
130
130
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
131
131
|
rtext = rfile.read()
|
132
132
|
rtr_pol.implement_reform(Policy.read_json_reform(rtext))
|
133
|
-
assert not rtr_pol.
|
133
|
+
assert not rtr_pol.parameter_errors
|
134
134
|
assert not rtr_pol.errors
|
135
135
|
# Layer on rounding from IRS through Policy.LAST_KNOWN_YEAR
|
136
136
|
reform_file = os.path.join(tests_path, '..', 'reforms', 'rounding.json')
|
137
137
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
138
138
|
rtext = rfile.read()
|
139
139
|
rtr_pol.implement_reform(Policy.read_json_reform(rtext))
|
140
|
-
assert not rtr_pol.
|
140
|
+
assert not rtr_pol.parameter_errors
|
141
141
|
assert not rtr_pol.errors
|
142
142
|
rtr_pol.set_year(fyear)
|
143
143
|
rtr_mdata = dict(rtr_pol.items())
|
@@ -371,7 +371,7 @@ def test_ext_reform(tests_path):
|
|
371
371
|
with open(reform_file, 'r', encoding='utf-8') as rfile:
|
372
372
|
rtext = rfile.read()
|
373
373
|
ext.implement_reform(Policy.read_json_reform(rtext))
|
374
|
-
assert not ext.
|
374
|
+
assert not ext.parameter_errors
|
375
375
|
ext.set_year(2026)
|
376
376
|
assert ext.II_em < end.II_em
|
377
377
|
# test tax output generated by ext.json reform file using public CPS data
|
@@ -386,4 +386,4 @@ def test_ext_reform(tests_path):
|
|
386
386
|
iitax_ext = calc_ext.array('iitax')
|
387
387
|
rdiff = iitax_ext - iitax_end
|
388
388
|
weighted_sum_rdiff = (rdiff * calc_end.array('s006')).sum() * 1.0e-9
|
389
|
-
assert np.allclose([weighted_sum_rdiff], [-
|
389
|
+
assert np.allclose([weighted_sum_rdiff], [-205.769], rtol=0.0, atol=0.01)
|
taxcalc/tests/test_taxcalcio.py
CHANGED
@@ -243,20 +243,19 @@ def fixture_assumpfile2():
|
|
243
243
|
pass # sometimes we can't remove a generated temporary file
|
244
244
|
|
245
245
|
|
246
|
-
@pytest.mark.parametrize('input_data, baseline, reform, assump
|
246
|
+
@pytest.mark.parametrize('input_data, baseline, reform, assump', [
|
247
247
|
('no-dot-csv-filename', 'no-dot-json-filename',
|
248
248
|
'no-dot-json-filename',
|
249
|
-
'no-dot-json-filename'
|
250
|
-
([], [], [], [],
|
251
|
-
('no-exist.csv', 'no-exist.json', 'no-exist.json', 'no-exist.json'
|
249
|
+
'no-dot-json-filename'),
|
250
|
+
([], [], [], [],),
|
251
|
+
('no-exist.csv', 'no-exist.json', 'no-exist.json', 'no-exist.json'),
|
252
252
|
])
|
253
|
-
def test_ctor_errors(input_data, baseline, reform, assump
|
253
|
+
def test_ctor_errors(input_data, baseline, reform, assump):
|
254
254
|
"""
|
255
255
|
Ensure error messages are generated by TaxCalcIO.__init__.
|
256
256
|
"""
|
257
257
|
tcio = TaxCalcIO(input_data=input_data, tax_year=2013,
|
258
|
-
baseline=baseline, reform=reform, assump=assump
|
259
|
-
outdir=outdir)
|
258
|
+
baseline=baseline, reform=reform, assump=assump)
|
260
259
|
assert tcio.errmsg
|
261
260
|
|
262
261
|
|
@@ -316,7 +315,8 @@ def test_creation_with_aging(reformfile0):
|
|
316
315
|
tax_year=taxyear,
|
317
316
|
baseline=None,
|
318
317
|
reform=reformfile0.name,
|
319
|
-
assump=None
|
318
|
+
assump=None,
|
319
|
+
silent=False)
|
320
320
|
assert not tcio.errmsg
|
321
321
|
tcio.init(input_data=pd.read_csv(StringIO(RAWINPUT)),
|
322
322
|
tax_year=taxyear,
|
@@ -357,6 +357,10 @@ def test_ctor_init_with_cps_files():
|
|
357
357
|
exact_calculations=False)
|
358
358
|
assert not tcio.errmsg
|
359
359
|
assert tcio.tax_year() == txyr
|
360
|
+
# test advance_to_year method
|
361
|
+
tcio.silent = False
|
362
|
+
tcio.advance_to_year(txyr + 1, True)
|
363
|
+
assert tcio.tax_year() == txyr + 1
|
360
364
|
# specify invalid tax_year for cps.csv input data
|
361
365
|
txyr = 2013
|
362
366
|
tcio = TaxCalcIO('cps.csv', txyr, None, None, None)
|
@@ -371,18 +375,18 @@ def test_ctor_init_with_cps_files():
|
|
371
375
|
MARS;iitax payrolltax|combined,
|
372
376
|
c00100
|
373
377
|
surtax
|
374
|
-
""", True,
|
378
|
+
""", True, 6), # these 6 parameters minus MARS plus RECID
|
375
379
|
|
376
380
|
("""
|
377
381
|
MARS;iitax payrolltax|kombined,c00100
|
378
382
|
surtax
|
379
383
|
RECID
|
380
384
|
FLPDYR
|
381
|
-
""", False,
|
385
|
+
""", False, 0)
|
382
386
|
])
|
383
|
-
def
|
387
|
+
def test_dump_variables(dumpvar_str, str_valid, num_vars):
|
384
388
|
"""
|
385
|
-
Test TaxCalcIO
|
389
|
+
Test TaxCalcIO dump_variables method.
|
386
390
|
"""
|
387
391
|
recdict = {'RECID': 1, 'MARS': 1, 'e00300': 100000, 's006': 1e8}
|
388
392
|
recdf = pd.DataFrame(data=recdict, index=[0])
|
@@ -395,17 +399,17 @@ def test_custom_dump_variables(dumpvar_str, str_valid, num_vars):
|
|
395
399
|
aging_input_data=False,
|
396
400
|
exact_calculations=False)
|
397
401
|
assert not tcio.errmsg
|
398
|
-
|
399
|
-
assert isinstance(
|
402
|
+
varlist = tcio.dump_variables(dumpvar_str)
|
403
|
+
assert isinstance(varlist, list)
|
400
404
|
valid = len(tcio.errmsg) == 0
|
401
405
|
assert valid == str_valid
|
402
406
|
if valid:
|
403
|
-
assert len(
|
407
|
+
assert len(varlist) == num_vars
|
404
408
|
|
405
409
|
|
406
|
-
def
|
410
|
+
def test_output_options_min(reformfile1, assumpfile1):
|
407
411
|
"""
|
408
|
-
Test TaxCalcIO output_dump options
|
412
|
+
Test TaxCalcIO output_dump options with minimal dump variables.
|
409
413
|
"""
|
410
414
|
taxyear = 2021
|
411
415
|
tcio = TaxCalcIO(input_data=pd.read_csv(StringIO(RAWINPUT)),
|
@@ -422,114 +426,93 @@ def test_output_options(reformfile1, assumpfile1):
|
|
422
426
|
aging_input_data=False,
|
423
427
|
exact_calculations=False)
|
424
428
|
assert not tcio.errmsg
|
425
|
-
|
426
|
-
# minimal
|
427
|
-
|
428
|
-
tcio.analyze(writing_output_file=True, output_dump=False)
|
429
|
-
except Exception: # pylint: disable=broad-except
|
430
|
-
if os.path.isfile(outfilepath):
|
431
|
-
try:
|
432
|
-
os.remove(outfilepath)
|
433
|
-
except OSError:
|
434
|
-
pass # sometimes we can't remove a generated temporary file
|
435
|
-
assert False, 'TaxCalcIO.analyze(minimal_output) failed'
|
436
|
-
# --dump output with full dump
|
437
|
-
try:
|
438
|
-
tcio.analyze(writing_output_file=True, output_dump=True)
|
439
|
-
except Exception: # pylint: disable=broad-except
|
440
|
-
if os.path.isfile(outfilepath):
|
441
|
-
try:
|
442
|
-
os.remove(outfilepath)
|
443
|
-
except OSError:
|
444
|
-
pass # sometimes we can't remove a generated temporary file
|
445
|
-
assert False, 'TaxCalcIO.analyze(full_dump_output) failed'
|
446
|
-
# --dump output with partial dump
|
429
|
+
dumppath = tcio.output_filepath().replace('.xxx', '.db')
|
430
|
+
# minimal dump output
|
431
|
+
dumpvars = TaxCalcIO.MINIMAL_DUMPVARS
|
447
432
|
try:
|
448
|
-
tcio.analyze(
|
449
|
-
dump_varset=set(['RECID', 'combined']),
|
450
|
-
output_dump=True)
|
433
|
+
tcio.analyze(output_dump=True, dump_varlist=dumpvars)
|
451
434
|
except Exception: # pylint: disable=broad-except
|
452
|
-
if os.path.isfile(
|
435
|
+
if os.path.isfile(dumppath):
|
453
436
|
try:
|
454
|
-
os.remove(
|
437
|
+
os.remove(dumppath)
|
455
438
|
except OSError:
|
456
439
|
pass # sometimes we can't remove a generated temporary file
|
457
|
-
assert False, 'TaxCalcIO.analyze(
|
458
|
-
|
459
|
-
|
460
|
-
if os.path.isfile(docfilepath):
|
461
|
-
os.remove(docfilepath)
|
462
|
-
if os.path.isfile(outfilepath):
|
463
|
-
os.remove(outfilepath)
|
440
|
+
assert False, 'TaxCalcIO.analyze(minimal_dump_output) failed'
|
441
|
+
if os.path.isfile(dumppath):
|
442
|
+
os.remove(dumppath)
|
464
443
|
|
465
444
|
|
466
|
-
def
|
445
|
+
def test_output_options_mtr(reformfile1, assumpfile1):
|
467
446
|
"""
|
468
|
-
Test
|
447
|
+
Test TaxCalcIO output_dump options with mtr_* dump variables.
|
469
448
|
"""
|
470
449
|
taxyear = 2021
|
471
|
-
compound_reform = f'{reformfile1.name}+{reformfile1.name}'
|
472
450
|
tcio = TaxCalcIO(input_data=pd.read_csv(StringIO(RAWINPUT)),
|
473
451
|
tax_year=taxyear,
|
474
452
|
baseline=None,
|
475
|
-
reform=
|
453
|
+
reform=reformfile1.name,
|
476
454
|
assump=assumpfile1.name)
|
477
455
|
assert not tcio.errmsg
|
478
456
|
tcio.init(input_data=pd.read_csv(StringIO(RAWINPUT)),
|
479
457
|
tax_year=taxyear,
|
480
458
|
baseline=None,
|
481
|
-
reform=
|
459
|
+
reform=reformfile1.name,
|
482
460
|
assump=assumpfile1.name,
|
483
461
|
aging_input_data=False,
|
484
462
|
exact_calculations=False)
|
485
463
|
assert not tcio.errmsg
|
486
|
-
tcio.
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
464
|
+
dumppath = tcio.output_filepath().replace('.xxx', '.db')
|
465
|
+
# minimal+mtr_* dump output
|
466
|
+
dumpvars = TaxCalcIO.MINIMAL_DUMPVARS
|
467
|
+
for var in TaxCalcIO.MTR_DUMPVARS:
|
468
|
+
dumpvars.append(var)
|
469
|
+
try:
|
470
|
+
tcio.analyze(output_dump=True, dump_varlist=dumpvars)
|
471
|
+
except Exception: # pylint: disable=broad-except
|
472
|
+
if os.path.isfile(dumppath):
|
473
|
+
try:
|
474
|
+
os.remove(dumppath)
|
475
|
+
except OSError:
|
476
|
+
pass # sometimes we can't remove a generated temporary file
|
477
|
+
assert False, 'TaxCalcIO.analyze(minimal_dump_output) failed'
|
478
|
+
if os.path.isfile(dumppath):
|
479
|
+
os.remove(dumppath)
|
491
480
|
|
492
481
|
|
493
|
-
def
|
482
|
+
def test_write_policy_param_files(reformfile1):
|
494
483
|
"""
|
495
|
-
Test
|
484
|
+
Test write_policy_params_files with compound reform.
|
496
485
|
"""
|
497
486
|
taxyear = 2021
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
487
|
+
compound_reform = f'{reformfile1.name}+{reformfile1.name}'
|
488
|
+
tcio = TaxCalcIO(
|
489
|
+
input_data=pd.read_csv(StringIO(RAWINPUT)),
|
490
|
+
tax_year=taxyear,
|
491
|
+
baseline=compound_reform,
|
492
|
+
reform=compound_reform,
|
493
|
+
assump=None,
|
494
|
+
)
|
503
495
|
assert not tcio.errmsg
|
504
496
|
tcio.init(input_data=pd.read_csv(StringIO(RAWINPUT)),
|
505
497
|
tax_year=taxyear,
|
506
|
-
baseline=
|
507
|
-
reform=
|
508
|
-
assump=
|
498
|
+
baseline=compound_reform,
|
499
|
+
reform=compound_reform,
|
500
|
+
assump=None,
|
509
501
|
aging_input_data=False,
|
510
502
|
exact_calculations=False)
|
511
503
|
assert not tcio.errmsg
|
504
|
+
tcio.write_policy_params_files()
|
512
505
|
outfilepath = tcio.output_filepath()
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
except Exception: # pylint: disable=broad-except
|
518
|
-
if os.path.isfile(dbfilepath):
|
519
|
-
try:
|
520
|
-
os.remove(dbfilepath)
|
521
|
-
except OSError:
|
522
|
-
pass # sometimes we can't remove a generated temporary file
|
523
|
-
assert False, 'ERROR: TaxCalcIO.analyze(sqldb) failed'
|
524
|
-
# if try was successful, remove the db file
|
525
|
-
if os.path.isfile(dbfilepath):
|
526
|
-
os.remove(dbfilepath)
|
506
|
+
for ext in ['-params.bas', '-params.ref']:
|
507
|
+
filepath = outfilepath.replace('.xxx', ext)
|
508
|
+
if os.path.isfile(filepath):
|
509
|
+
os.remove(filepath)
|
527
510
|
|
528
511
|
|
529
512
|
def test_no_tables_or_graphs(reformfile1):
|
530
513
|
"""
|
531
|
-
Test TaxCalcIO with
|
532
|
-
INPUT has zero weights.
|
514
|
+
Test TaxCalcIO with output_params=True and output_tables=True and
|
515
|
+
output_graphs=True but INPUT has zero weights.
|
533
516
|
"""
|
534
517
|
# create input sample that cannot output tables or graphs
|
535
518
|
nobs = 10
|
@@ -555,24 +538,12 @@ def test_no_tables_or_graphs(reformfile1):
|
|
555
538
|
aging_input_data=False,
|
556
539
|
exact_calculations=False)
|
557
540
|
assert not tcio.errmsg
|
558
|
-
# create TaxCalcIO
|
559
|
-
tcio.analyze(
|
541
|
+
# create several TaxCalcIO output files
|
542
|
+
tcio.analyze(output_params=True,
|
560
543
|
output_tables=True,
|
561
544
|
output_graphs=True)
|
562
545
|
# delete tables and graph files
|
563
|
-
|
564
|
-
fname = output_filename.replace('.csv', '-tab.text')
|
565
|
-
if os.path.isfile(fname):
|
566
|
-
os.remove(fname)
|
567
|
-
fname = output_filename.replace('.csv', '-atr.html')
|
568
|
-
if os.path.isfile(fname):
|
569
|
-
os.remove(fname)
|
570
|
-
fname = output_filename.replace('.csv', '-mtr.html')
|
571
|
-
if os.path.isfile(fname):
|
572
|
-
os.remove(fname)
|
573
|
-
fname = output_filename.replace('.csv', '-pch.html')
|
574
|
-
if os.path.isfile(fname):
|
575
|
-
os.remove(fname)
|
546
|
+
tcio.delete_output_files()
|
576
547
|
|
577
548
|
|
578
549
|
def test_tables(reformfile1):
|
@@ -604,12 +575,8 @@ def test_tables(reformfile1):
|
|
604
575
|
exact_calculations=False)
|
605
576
|
assert not tcio.errmsg
|
606
577
|
# create TaxCalcIO tables file
|
607
|
-
tcio.analyze(
|
608
|
-
|
609
|
-
output_filename = tcio.output_filepath()
|
610
|
-
fname = output_filename.replace('.csv', '-tab.text')
|
611
|
-
if os.path.isfile(fname):
|
612
|
-
os.remove(fname)
|
578
|
+
tcio.analyze(output_tables=True)
|
579
|
+
tcio.delete_output_files()
|
613
580
|
|
614
581
|
|
615
582
|
def test_graphs(reformfile1):
|
@@ -641,18 +608,9 @@ def test_graphs(reformfile1):
|
|
641
608
|
aging_input_data=False,
|
642
609
|
exact_calculations=False)
|
643
610
|
assert not tcio.errmsg
|
644
|
-
tcio.analyze(
|
611
|
+
tcio.analyze(output_graphs=True)
|
645
612
|
# delete graph files
|
646
|
-
|
647
|
-
fname = output_filename.replace('.csv', '-atr.html')
|
648
|
-
if os.path.isfile(fname):
|
649
|
-
os.remove(fname)
|
650
|
-
fname = output_filename.replace('.csv', '-mtr.html')
|
651
|
-
if os.path.isfile(fname):
|
652
|
-
os.remove(fname)
|
653
|
-
fname = output_filename.replace('.csv', '-pch.html')
|
654
|
-
if os.path.isfile(fname):
|
655
|
-
os.remove(fname)
|
613
|
+
tcio.delete_output_files()
|
656
614
|
|
657
615
|
|
658
616
|
@pytest.fixture(scope='session', name='warnreformfile')
|
@@ -694,7 +652,7 @@ def test_analyze_warnings_print(warnreformfile):
|
|
694
652
|
aging_input_data=False,
|
695
653
|
exact_calculations=False)
|
696
654
|
assert not tcio.errmsg
|
697
|
-
tcio.analyze(
|
655
|
+
tcio.analyze()
|
698
656
|
assert tcio.tax_year() == taxyear
|
699
657
|
|
700
658
|
|
taxcalc/utils.py
CHANGED
@@ -1160,7 +1160,7 @@ def xtr_graph_plot(data,
|
|
1160
1160
|
line_color='blue', line_width=3, legend_label='Baseline')
|
1161
1161
|
fig.line(lines.index, lines.reform,
|
1162
1162
|
line_color='red', line_width=3, legend_label='Reform')
|
1163
|
-
fig.
|
1163
|
+
fig.scatter(0, 0, visible=False) # force zero to be included on y axis
|
1164
1164
|
if xlabel == '':
|
1165
1165
|
xlabel = data['xlabel']
|
1166
1166
|
fig.xaxis.axis_label = xlabel
|
@@ -1295,8 +1295,8 @@ def pch_graph_plot(data,
|
|
1295
1295
|
fig.title.text_font_size = '12pt'
|
1296
1296
|
line = data['line']
|
1297
1297
|
fig.line(line.index, line.pch, line_color='blue', line_width=3)
|
1298
|
-
fig.
|
1299
|
-
zero_grid_line_range =
|
1298
|
+
fig.scatter(0, 0, visible=False) # force zero to be included on y axis
|
1299
|
+
zero_grid_line_range = line.index
|
1300
1300
|
zero_grid_line_height = [0] * len(zero_grid_line_range)
|
1301
1301
|
fig.line(zero_grid_line_range, zero_grid_line_height,
|
1302
1302
|
line_color='black', line_width=1)
|
@@ -1311,13 +1311,7 @@ def pch_graph_plot(data,
|
|
1311
1311
|
fig.yaxis.axis_label_text_font_size = '12pt'
|
1312
1312
|
fig.yaxis.axis_label_text_font_style = 'normal'
|
1313
1313
|
fig.yaxis[0].formatter = PrintfTickFormatter(format='%.1f')
|
1314
|
-
|
1315
|
-
# bokeh.core.serialization.SerializationError:
|
1316
|
-
# can't serialize <class 'range'>
|
1317
|
-
# so the "return fig" statement is replaced by Python's implicit
|
1318
|
-
# "return None" until the above logic can be made compatible with
|
1319
|
-
# modern bokeh packages
|
1320
|
-
# return fig
|
1314
|
+
return fig
|
1321
1315
|
|
1322
1316
|
|
1323
1317
|
def write_graph_file(figure, filename, title):
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: taxcalc
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.6.1
|
4
4
|
Summary: Tax-Calculator
|
5
5
|
Home-page: https://github.com/PSLmodels/Tax-Calculator
|
6
6
|
Download-URL: https://github.com/PSLmodels/Tax-Calculator
|
@@ -29,6 +29,7 @@ Dynamic: description-content-type
|
|
29
29
|
Dynamic: download-url
|
30
30
|
Dynamic: home-page
|
31
31
|
Dynamic: license
|
32
|
+
Dynamic: license-file
|
32
33
|
Dynamic: requires-dist
|
33
34
|
Dynamic: summary
|
34
35
|
|
@@ -1,32 +1,32 @@
|
|
1
|
-
taxcalc/__init__.py,sha256=
|
2
|
-
taxcalc/calcfunctions.py,sha256=
|
3
|
-
taxcalc/calculator.py,sha256=
|
1
|
+
taxcalc/__init__.py,sha256=_SNXt6U2NMWDx1hqcUw-N6_SVHp4pydp4-U1VFEPldY,536
|
2
|
+
taxcalc/calcfunctions.py,sha256=G62sQeW-YHJ2gvqOfidRKPBpufSHzXYIdI2PGcApOuU,148423
|
3
|
+
taxcalc/calculator.py,sha256=cCsis9yQSyw4eXvYppk7Z70JEaPH8Kd1AADlIqnJhVw,63930
|
4
4
|
taxcalc/conftest.py,sha256=nO4J7qu1sTHgjqrzhpRMvfMJUrNm6GP_IsSuuDt_MeQ,141
|
5
5
|
taxcalc/consumption.json,sha256=FBgDd72AZnviQRhGz5rPgpGpOmaOzNYfGB9GdTCeKPI,8102
|
6
6
|
taxcalc/consumption.py,sha256=pkXhFGpFqu7hW62KaTctfRSzR-pXzMB1ai8XCQRAgXk,3480
|
7
7
|
taxcalc/cps.csv.gz,sha256=SS6tSduU_Eu0EJwzpslnmqMsQQQucVMzzITfH-SeV40,9851074
|
8
8
|
taxcalc/cps_weights.csv.gz,sha256=-k31Swqss0WEGA3Zo8AoReLR_C7BRUk4PDmfh-oVVyo,13657706
|
9
|
-
taxcalc/data.py,sha256=
|
9
|
+
taxcalc/data.py,sha256=QRyLsq250OsxUIjsuCFtREJsVyEOGaivwcON3teivMI,11698
|
10
10
|
taxcalc/decorators.py,sha256=EwyVH4fSDf8x_BHzccf4-DRopo6KMVidYSYZFy_dJy0,11307
|
11
11
|
taxcalc/growdiff.json,sha256=ReBAF6We9ZwTb0uDYQwbedPsQKdm6KSOERiddEYZbm0,15037
|
12
12
|
taxcalc/growdiff.py,sha256=Q3St-KPIUN2I_l1S0jwN0yr8O4LuzkNIU-_qbXTkrZw,2977
|
13
13
|
taxcalc/growfactors.csv,sha256=URIGSKApCY4McvdILkCaIm8EhCGEME2Du-ef5Q9c0uE,5134
|
14
14
|
taxcalc/growfactors.py,sha256=dW71yYKhFDbFtGpBT-kZBqY4MV7IswKcNI3_c-X_Nfg,6525
|
15
|
-
taxcalc/parameters.py,sha256=
|
16
|
-
taxcalc/policy.py,sha256=
|
17
|
-
taxcalc/policy_current_law.json,sha256=
|
15
|
+
taxcalc/parameters.py,sha256=pxW53fOJkW7yM7XxN04RDNs-f7CwKOjE4vMmMvPtZ8E,33121
|
16
|
+
taxcalc/policy.py,sha256=4bY3beSYhLKk_X4CTgG7LGnVnILM0D4Invt7uCp8dlA,6725
|
17
|
+
taxcalc/policy_current_law.json,sha256=enemNPLg0ZlwNQVVK51XJru_YzDzPnV7ClNhdJHlhJQ,689915
|
18
18
|
taxcalc/puf_ratios.csv,sha256=USMM79UEX8PnSKY_LYLxvACER_9NHyj4ipNEk2iyykQ,3580
|
19
19
|
taxcalc/puf_weights.csv.gz,sha256=35iZhzFO0dHUI2zf4_liyk60E-3Sgr_AbxszGxw7LfM,13522484
|
20
20
|
taxcalc/records.py,sha256=K5QgP6Pm9PtEVDVzM7tpHYPu554Wio0KnrU7YTTBKgQ,18264
|
21
21
|
taxcalc/records_variables.json,sha256=_YKJiZQ1czp0VH9bkr5ZXmp9Mm1roHoHrt2XnLXAtfw,42975
|
22
|
-
taxcalc/taxcalcio.py,sha256=
|
23
|
-
taxcalc/utils.py,sha256=
|
22
|
+
taxcalc/taxcalcio.py,sha256=1xZ17wZ0yqZeDDa5glEQpCG6xvXJ4wGxbUQPkmTLTD0,34752
|
23
|
+
taxcalc/utils.py,sha256=noHnQ-tw0AXhEH-OgdTUiPedH8luVOJ5NdfpKI3_obw,62401
|
24
24
|
taxcalc/utilsprvt.py,sha256=iIyWp9-N3_XWjQj2jV2CWnJy7vrNlKB2_vIMwYjgbWY,1323
|
25
25
|
taxcalc/assumptions/ASSUMPTIONS.md,sha256=cFQqWn1nScaladVaQ7xNm1jDY8CsGdLmqZEzUZeRrb8,1917
|
26
26
|
taxcalc/assumptions/README.md,sha256=Ww55r2zH1neoRSl_MawrPmX-ugaztIZ7_ALrquuatdQ,809
|
27
27
|
taxcalc/assumptions/economic_assumptions_template.json,sha256=utMk38GwSQFrkOAtRrDVhMQLpfaZH3JmtTznKX7IouM,2610
|
28
28
|
taxcalc/cli/__init__.py,sha256=cyZ0tdx41j_vV_B6GAkqJmNKKG-B0wUC0ThC75lJlk4,104
|
29
|
-
taxcalc/cli/tc.py,sha256=
|
29
|
+
taxcalc/cli/tc.py,sha256=StZo-46v1c3ozP-64wQWz0uyHOEVqZPAzgTr1JuoFjU,16614
|
30
30
|
taxcalc/reforms/2017_law.json,sha256=u-xaPSvt5ubfZw1Nb-jNhTNcOPBUJeAX2kJVoEyMgC4,5860
|
31
31
|
taxcalc/reforms/2017_law.out.csv,sha256=nnNKXqY2kof8HC1nnU8srPsvNNepi6ISXQ9OJpQnT7M,473
|
32
32
|
taxcalc/reforms/ARPA.json,sha256=1H9LuJ_QitXRO9e8R3PWizajJgdioIzbGFdvdlt9FVg,3119
|
@@ -54,7 +54,7 @@ taxcalc/reforms/Trump2017.json,sha256=DZjCJQZYe98Skyss7z_Jhj8HJld_FPZeQGxwzGgQIn
|
|
54
54
|
taxcalc/reforms/Trump2017.out.csv,sha256=By1quzZONFLQGK5E76mbNNFuORZ8aCGHpD1BR5iwTS8,474
|
55
55
|
taxcalc/reforms/cases.csv,sha256=JQ0LSnNeyl6xSgW5mimGUJMr7xwCWTOpiOpfwx2ETsg,570
|
56
56
|
taxcalc/reforms/clp.out.csv,sha256=qSUdI0LoQFGG6h24eT-249pLEqmxmt7TvLrv1HX_y3Y,475
|
57
|
-
taxcalc/reforms/ext.json,sha256=
|
57
|
+
taxcalc/reforms/ext.json,sha256=578ckWd4bTbH_XnTR-smMKtE7Auu9seGn7de_hsGIos,3130
|
58
58
|
taxcalc/reforms/growfactors_ext.csv,sha256=E0szWXtgV5jcpiyvREOz1yXw_poPIBC77bBQI1rlFxM,17733
|
59
59
|
taxcalc/reforms/ptaxes0.json,sha256=QkvqCVkI23sF7FvTHqaUYNpEJYuHNChbKwH0mH7Otp4,1718
|
60
60
|
taxcalc/reforms/ptaxes0.out.csv,sha256=DKGsyNWqo-ABUnjFjEGMpqqhmT2WDRGuU6sKTgH_obc,476
|
@@ -83,10 +83,10 @@ taxcalc/tests/pufcsv_agg_expect.csv,sha256=h0r6MtsFEBa1u5zwpRT4fDx2T__ZAkdx4oeLx
|
|
83
83
|
taxcalc/tests/pufcsv_mtr_expect.txt,sha256=xGsUfafzsZ04fFQw162ys-1Mf1CDC_PQ0QZNigS07VY,4265
|
84
84
|
taxcalc/tests/reforms.json,sha256=vGJrvfKJ7h5iAWF-vV9NmY8Z9HP_iereiYiYNcfhBMo,19212
|
85
85
|
taxcalc/tests/reforms_expect.csv,sha256=6m0bSH8S6ReMYdHoQC9iWYuJAof5sZ0OONVBi7zX8JE,1464
|
86
|
-
taxcalc/tests/test_4package.py,sha256=
|
86
|
+
taxcalc/tests/test_4package.py,sha256=I9i5rWFsg-VCtTLmUWIi9dnusieTZeodrgH8ba_Fbng,3681
|
87
87
|
taxcalc/tests/test_benefits.py,sha256=oaui5mO0TuW8Ht-uxvUCBL5zM3iTENq3Whyf_gEpY1U,3392
|
88
88
|
taxcalc/tests/test_calcfunctions.py,sha256=QtMgQg_WpCU8PZM3Hs8Pml4q6LnlLWV_blCzbpGN2sw,31939
|
89
|
-
taxcalc/tests/test_calculator.py,sha256=
|
89
|
+
taxcalc/tests/test_calculator.py,sha256=lcnBli5giNFxqgCLW-MF4J_wsV3gSFqCjzJdCJkihek,36085
|
90
90
|
taxcalc/tests/test_compare.py,sha256=WglH4ZJOEQnav_mAmnGjpb7dooXcQsB1m04hgQeoBUQ,10873
|
91
91
|
taxcalc/tests/test_compatible_data.py,sha256=XpfnE96HDvlgJM_8KEasgufxeiePTFfNMBBVlfzHP9Y,13477
|
92
92
|
taxcalc/tests/test_consumption.py,sha256=c6zi9GqNK54cgfzxiWmY10UxOMJZ9vd9fOTwUKU1zMk,6318
|
@@ -100,9 +100,9 @@ taxcalc/tests/test_policy.py,sha256=hJrFqqptMoUWk3abIJ2sdADQtCqvGaUeW5as1aNwhR8,
|
|
100
100
|
taxcalc/tests/test_puf_var_stats.py,sha256=TG-sQtOkR6cBOw0am7MUsMSwjPxVdkvt0Xov342oii8,7786
|
101
101
|
taxcalc/tests/test_pufcsv.py,sha256=kQPwpMcLNPwQDiO-23xvvZggtHYvRz-UYEDn6JjNfbw,16352
|
102
102
|
taxcalc/tests/test_records.py,sha256=ncswnbCY7vZgJ_h6xwql4oFw-jZG2gWOMWvEJC2_jdc,8827
|
103
|
-
taxcalc/tests/test_reforms.py,sha256=
|
103
|
+
taxcalc/tests/test_reforms.py,sha256=djVxMOE2RytmDDYvzS55AnThRRBcVc_calPbfHuvQ-k,16033
|
104
104
|
taxcalc/tests/test_responses.py,sha256=2CkVVdaDNCSALMoUcGgweRlS2tfsK3kXogHtDkZMqJU,1663
|
105
|
-
taxcalc/tests/test_taxcalcio.py,sha256=
|
105
|
+
taxcalc/tests/test_taxcalcio.py,sha256=PV7hCntwp_1LHQYlft7WelbzKSoi5aWzUZqhJAcC5AE,23135
|
106
106
|
taxcalc/tests/test_utils.py,sha256=aUHVNxfSMdyyLAz3w98KLQa5D872rZxXqKbPkIqwLLA,29403
|
107
107
|
taxcalc/validation/CSV_INPUT_VARS.md,sha256=MqlZZGt_a1n8JAU-nY5MjnTmjz1pMOuhtpVYIGUgl38,1433
|
108
108
|
taxcalc/validation/CSV_OUTPUT_VARS.md,sha256=wr8oyCJDXcxl4Lu0H_wMofUQYhEIyHDif6vkbas1FGE,3000
|
@@ -131,9 +131,9 @@ taxcalc/validation/taxsim35/expected_differences/b21-taxdiffs-expect.csv,sha256=
|
|
131
131
|
taxcalc/validation/taxsim35/expected_differences/c17-taxdiffs-expect.csv,sha256=YhgojbLowH3yujdYu7SGkdvBZmTgpugu4wYc1Be069M,1125
|
132
132
|
taxcalc/validation/taxsim35/expected_differences/c18-taxdiffs-expect.csv,sha256=g9J4BPbTySV-h-RcLvReJq9v1jscgiRSSZzi0taEA-k,1225
|
133
133
|
taxcalc/validation/taxsim35/expected_differences/c19-taxdiffs-expect.csv,sha256=Ceh15N_Xr3L7cpYjzGa-8NLCV3obc8PNHEhE5ZxSPhI,1238
|
134
|
-
taxcalc-4.
|
135
|
-
taxcalc-4.
|
136
|
-
taxcalc-4.
|
137
|
-
taxcalc-4.
|
138
|
-
taxcalc-4.
|
139
|
-
taxcalc-4.
|
134
|
+
taxcalc-4.6.1.dist-info/licenses/LICENSE,sha256=m5epLdB-_NXiY7NsEDgcHP4jDtJ4vOlRf5S3Jb-jraY,1299
|
135
|
+
taxcalc-4.6.1.dist-info/METADATA,sha256=wvnDftJBQ7SKgJAF-hCYRKf_RJX3RNSPj2LLe-nL59s,3509
|
136
|
+
taxcalc-4.6.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
137
|
+
taxcalc-4.6.1.dist-info/entry_points.txt,sha256=a3ZE1piRv683p27fOLdWZvVJXESkoslTOp5iXV7uVco,50
|
138
|
+
taxcalc-4.6.1.dist-info/top_level.txt,sha256=Wh8wTDHkA_cm4dn8IoUCviDyGgVQqwEQKPJnl8z6d4c,8
|
139
|
+
taxcalc-4.6.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|