taxcalc 3.4.1__py3-none-any.whl → 3.5.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 CHANGED
@@ -14,4 +14,4 @@ from taxcalc.taxcalcio import *
14
14
  from taxcalc.utils import *
15
15
  from taxcalc.cli import *
16
16
 
17
- __version__ = '3.4.1'
17
+ __version__ = '3.5.1'
taxcalc/calcfunctions.py CHANGED
@@ -408,8 +408,8 @@ def Adj(e03150, e03210, c03260,
408
408
 
409
409
  @iterate_jit(nopython=True)
410
410
  def ALD_InvInc_ec_base(p22250, p23250, sep,
411
- e00300, e00600, e01100, e01200,
412
- invinc_ec_base):
411
+ e00300, e00600, e01100, e01200, MARS,
412
+ invinc_ec_base, Capital_loss_limitation):
413
413
  """
414
414
  Computes invinc_ec_base.
415
415
 
@@ -429,8 +429,12 @@ def ALD_InvInc_ec_base(p22250, p23250, sep,
429
429
  Capital gains distributions not reported on Schedule D
430
430
  e01200: float
431
431
  Other net gain/loss from Form 4797
432
+ MARS: int
433
+ Filing marital status (1=single, 2=joint, 3=separate, 4=household-head, 5=widow(er))
432
434
  invinc_ec_base: float
433
435
  Exclusion of investment income from AGI
436
+ Capital_loss_limitation: float
437
+ Limitation on capital losses that are deductible
434
438
 
435
439
  Returns
436
440
  -------
@@ -438,7 +442,7 @@ def ALD_InvInc_ec_base(p22250, p23250, sep,
438
442
  Exclusion of investment income from AGI
439
443
  """
440
444
  # limitation on net short-term and long-term capital losses
441
- cgain = max((-3000. / sep), p22250 + p23250)
445
+ cgain = max((-1 * Capital_loss_limitation[MARS - 1] / sep), p22250 + p23250)
442
446
  # compute exclusion of investment income from AGI
443
447
  invinc_ec_base = e00300 + e00600 + cgain + e01100 + e01200
444
448
  return invinc_ec_base
@@ -448,7 +452,7 @@ def ALD_InvInc_ec_base(p22250, p23250, sep,
448
452
  def CapGains(p23250, p22250, sep, ALD_StudentLoan_hc,
449
453
  ALD_InvInc_ec_rt, invinc_ec_base,
450
454
  e00200, e00300, e00600, e00650, e00700, e00800,
451
- CG_nodiff, CG_ec, CG_reinvest_ec_rt,
455
+ CG_nodiff, CG_ec, CG_reinvest_ec_rt, Capital_loss_limitation,
452
456
  ALD_BusinessLosses_c, MARS,
453
457
  e00900, e01100, e01200, e01400, e01700, e02000, e02100,
454
458
  e02300, e00400, e02400, c02900, e03210, e03230, e03240,
@@ -488,6 +492,8 @@ def CapGains(p23250, p22250, sep, ALD_StudentLoan_hc,
488
492
  Dollar amount of all capital gains and qualified dividends that are excluded from AGI
489
493
  CG_reinvest_ec_rt: float
490
494
  Fraction of all capital gains and qualified dividends in excess of the dollar exclusion that are excluded from AGI
495
+ Capital_loss_limitation: float
496
+ Limitation on capital losses that are deductible
491
497
  ALD_BusinessLosses_c: list
492
498
  Maximm amount of business losses deductible
493
499
  MARS: int
@@ -547,7 +553,7 @@ def CapGains(p23250, p22250, sep, ALD_StudentLoan_hc,
547
553
  # net capital gain (long term + short term) before exclusion
548
554
  c23650 = p23250 + p22250
549
555
  # limitation on capital losses
550
- c01000 = max((-3000. / sep), c23650)
556
+ c01000 = max((-1 * Capital_loss_limitation[MARS - 1] / sep), c23650)
551
557
  # compute total investment income
552
558
  invinc = e00300 + e00600 + c01000 + e01100 + e01200
553
559
  # compute exclusion of investment income from AGI
@@ -571,7 +577,7 @@ def CapGains(p23250, p22250, sep, ALD_StudentLoan_hc,
571
577
 
572
578
 
573
579
  @iterate_jit(nopython=True)
574
- def SSBenefits(MARS, ymod, e02400, SS_thd50, SS_thd85,
580
+ def SSBenefits(MARS, ymod, e02400, SS_all_in_agi, SS_thd50, SS_thd85,
575
581
  SS_percentage1, SS_percentage2, c02500):
576
582
  """
577
583
  Calculates OASDI benefits included in AGI, c02500.
@@ -584,6 +590,8 @@ def SSBenefits(MARS, ymod, e02400, SS_thd50, SS_thd85,
584
590
  Variable that is used in OASDI benefit taxation logic
585
591
  e02400: float
586
592
  Total social security (OASDI) benefits
593
+ SS_all_in_agi: bool
594
+ Whether all social security benefits are included in AGI
587
595
  SS_thd50: list
588
596
  Threshold for social security benefit taxability (1)
589
597
  SS_thd85: list
@@ -609,6 +617,8 @@ def SSBenefits(MARS, ymod, e02400, SS_thd50, SS_thd85,
609
617
  SS_percentage1 *
610
618
  min(e02400, SS_thd85[MARS - 1] -
611
619
  SS_thd50[MARS - 1]), SS_percentage2 * e02400)
620
+ if SS_all_in_agi:
621
+ c02500 = e02400
612
622
  return c02500
613
623
 
614
624
 
@@ -1589,7 +1599,7 @@ def GainsTax(e00650, c01000, c23650, p23250, e01100, e58990, e00200,
1589
1599
  CG_nodiff, PT_EligibleRate_active, PT_EligibleRate_passive,
1590
1600
  PT_wages_active_income, PT_top_stacking,
1591
1601
  CG_rt1, CG_rt2, CG_rt3, CG_rt4, CG_brk1, CG_brk2, CG_brk3,
1592
- dwks10, dwks13, dwks14, dwks19, c05700, taxbc):
1602
+ dwks10, dwks13, dwks14, dwks19, dwks43, c05700, taxbc):
1593
1603
  """
1594
1604
  GainsTax function implements (2015) Schedule D Tax Worksheet logic for
1595
1605
  the special taxation of long-term capital gains and qualified dividends
@@ -1719,6 +1729,8 @@ def GainsTax(e00650, c01000, c23650, p23250, e01100, e58990, e00200,
1719
1729
  Maximum of 0 and dwks1 - dwks13
1720
1730
  dwks19: float
1721
1731
  Maximum of dwks17 and dwks16
1732
+ dwks43: float
1733
+ separate tax on long-term capital gains and qualified dividends
1722
1734
  c05700: float
1723
1735
  Lump sum distributions
1724
1736
  taxbc: float
@@ -1734,6 +1746,8 @@ def GainsTax(e00650, c01000, c23650, p23250, e01100, e58990, e00200,
1734
1746
  Maximum of 0 and dwks1 - dwks13
1735
1747
  dwks19: float
1736
1748
  Maximum of dwks17 and dwks16
1749
+ dwks43: float
1750
+ separate tax on long-term capital gains and qualified dividends
1737
1751
  c05700: float
1738
1752
  Lump sum distributions
1739
1753
  taxbc: float
@@ -1828,12 +1842,13 @@ def GainsTax(e00650, c01000, c23650, p23250, e01100, e58990, e00200,
1828
1842
  dwks13 = 0.
1829
1843
  dwks14 = 0.
1830
1844
  dwks19 = 0.
1845
+ dwks43 = 0.
1831
1846
 
1832
1847
  # final calculations done no matter what the value of hasqdivltcg
1833
1848
  c05100 = c24580 # because foreign earned income exclusion is assumed zero
1834
1849
  c05700 = 0. # no Form 4972, Lump Sum Distributions
1835
1850
  taxbc = c05700 + c05100
1836
- return (dwks10, dwks13, dwks14, dwks19, c05700, taxbc)
1851
+ return (dwks10, dwks13, dwks14, dwks19, dwks43, c05700, taxbc)
1837
1852
 
1838
1853
 
1839
1854
  @iterate_jit(nopython=True)
@@ -3108,7 +3123,7 @@ def AdditionalCTC(codtc_limited, ACTC_c, n24, earned, ACTC_Income_thd,
3108
3123
  def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3109
3124
  c07400, c07600, c08000, e09700, e09800, e09900, niit, othertaxes,
3110
3125
  c07100, c09200, odc, charity_credit,
3111
- personal_nonrefundable_credit, CTC_refundable):
3126
+ personal_nonrefundable_credit, CTC_refundable, ODC_refundable):
3112
3127
  """
3113
3128
  Computes total used nonrefundable credits, c07100, othertaxes, and
3114
3129
  income tax before refundable credits, c09200.
@@ -3170,7 +3185,7 @@ def C1040(c05800, c07180, c07200, c07220, c07230, c07240, c07260, c07300,
3170
3185
  # total used nonrefundable credits (as computed in NonrefundableCredits)
3171
3186
  c07100 = (c07180 + c07200 + c07600 + c07300 + c07400 +
3172
3187
  c07220 * (1. - CTC_refundable) + c08000 +
3173
- c07230 + c07240 + c07260 + odc + charity_credit +
3188
+ c07230 + c07240 + c07260 + odc * (1. - ODC_refundable) + charity_credit +
3174
3189
  personal_nonrefundable_credit)
3175
3190
  # tax after credits (2016 Form 1040, line 56)
3176
3191
  tax_net_nonrefundable_credits = max(0., c05800 - c07100)
@@ -3265,7 +3280,7 @@ def CTC_new(CTC_new_c, CTC_new_rt, CTC_new_c_under6_bonus,
3265
3280
  @iterate_jit(nopython=True)
3266
3281
  def IITAX(c59660, c11070, c10960, personal_refundable_credit, ctc_new, rptc,
3267
3282
  c09200, payrolltax, CDCC_refund, recovery_rebate_credit,
3268
- eitc, c07220, CTC_refundable, refund, iitax, combined):
3283
+ eitc, c07220, odc, CTC_refundable, ODC_refundable, refund, iitax, combined):
3269
3284
  """
3270
3285
  Computes final taxes.
3271
3286
 
@@ -3313,8 +3328,12 @@ def IITAX(c59660, c11070, c10960, personal_refundable_credit, ctc_new, rptc,
3313
3328
  ctc_refund = c07220
3314
3329
  else:
3315
3330
  ctc_refund = 0.
3331
+ if ODC_refundable:
3332
+ odc_refund = odc
3333
+ else:
3334
+ odc_refund = 0.
3316
3335
  refund = (eitc + c11070 + c10960 + CDCC_refund + recovery_rebate_credit +
3317
- personal_refundable_credit + ctc_new + rptc + ctc_refund)
3336
+ personal_refundable_credit + ctc_new + rptc + ctc_refund + odc_refund)
3318
3337
  iitax = c09200 - refund
3319
3338
  combined = iitax + payrolltax
3320
3339
  return (eitc, refund, iitax, combined)
taxcalc/cli/tc.py CHANGED
@@ -109,7 +109,8 @@ def cli_tc_main():
109
109
  default=None)
110
110
  parser.add_argument('--sqldb',
111
111
  help=('optional flag that writes SQLite database '
112
- 'with dump table containing same output as '
112
+ 'with two tables (baseline and reform) each '
113
+ 'containing same output variables as '
113
114
  'produced by --dump option.'),
114
115
  default=False,
115
116
  action="store_true")
@@ -221,8 +222,8 @@ def _compare_test_output_files():
221
222
  Private function that compares expected and actual tc --test output files;
222
223
  returns 0 if pass test, otherwise returns 1.
223
224
  """
224
- explines = open(EXPECTED_TEST_OUTPUT_FILENAME, 'U').readlines()
225
- actlines = open(ACTUAL_TEST_OUTPUT_FILENAME, 'U').readlines()
225
+ explines = open(EXPECTED_TEST_OUTPUT_FILENAME, 'r').readlines()
226
+ actlines = open(ACTUAL_TEST_OUTPUT_FILENAME, 'r').readlines()
226
227
  if ''.join(explines) == ''.join(actlines):
227
228
  sys.stdout.write('PASSED TEST\n')
228
229
  retcode = 0
@@ -356,6 +356,32 @@
356
356
  "cps": true
357
357
  }
358
358
  },
359
+ "SS_all_in_agi": {
360
+ "title": "Include all social security benefits in AGI",
361
+ "description": "All social security benefits will be included in AGI.",
362
+ "notes": "",
363
+ "section_1": "Social Security Taxability",
364
+ "section_2": "Social Security Benefit Taxability",
365
+ "indexable": false,
366
+ "indexed": false,
367
+ "type": "bool",
368
+ "value": [
369
+ {
370
+ "year": 2013,
371
+ "value": false
372
+ }
373
+ ],
374
+ "validators": {
375
+ "range": {
376
+ "min": false,
377
+ "max": true
378
+ }
379
+ },
380
+ "compatible_data": {
381
+ "puf": true,
382
+ "cps": true
383
+ }
384
+ },
359
385
  "SS_thd50": {
360
386
  "title": "Threshold for Social Security benefit taxability 1",
361
387
  "description": "The first threshold for Social Security benefit taxability: if taxpayers have provisional income greater than this threshold, up to rate 1 of their Social Security benefit will be subject to tax under current law.",
@@ -7042,6 +7068,53 @@
7042
7068
  "cps": true
7043
7069
  }
7044
7070
  },
7071
+ "Capital_loss_limitation": {
7072
+ "title": "Limitation on the amount of capital losses deductible ",
7073
+ "description": "The amount of capital loss deductions is limited to this dollar amount.",
7074
+ "notes": "Note that some datasets may limit the usefulness of this parameter. For example the IRS Public Use File (PUF) does not report capital losses in excess of the current law limitation (e.g., $,3000) and therefore setting a higher limit will not affect results.",
7075
+ "section_1": "Capital Gains And Dividends",
7076
+ "section_2": "Regular - Long Term Capital Gains And Qualified Dividends",
7077
+ "indexable": true,
7078
+ "indexed": false,
7079
+ "type": "float",
7080
+ "value": [
7081
+ {
7082
+ "year": 2013,
7083
+ "MARS": "single",
7084
+ "value": 3000
7085
+ },
7086
+ {
7087
+ "year": 2013,
7088
+ "MARS": "mjoint",
7089
+ "value": 3000
7090
+ },
7091
+ {
7092
+ "year": 2013,
7093
+ "MARS": "mseparate",
7094
+ "value": 3000
7095
+ },
7096
+ {
7097
+ "year": 2013,
7098
+ "MARS": "headhh",
7099
+ "value": 3000
7100
+ },
7101
+ {
7102
+ "year": 2013,
7103
+ "MARS": "widow",
7104
+ "value": 3000
7105
+ }
7106
+ ],
7107
+ "validators": {
7108
+ "range": {
7109
+ "min": 0,
7110
+ "max": 9e+99
7111
+ }
7112
+ },
7113
+ "compatible_data": {
7114
+ "puf": true,
7115
+ "cps": true
7116
+ }
7117
+ },
7045
7118
  "CG_rt1": {
7046
7119
  "title": "Long term capital gain and qualified dividends (regular/non-AMT) rate 1",
7047
7120
  "description": "The capital gain and dividends (stacked on top of regular income) that are below threshold 1 are taxed at this rate.",
@@ -16556,6 +16629,40 @@
16556
16629
  "cps": true
16557
16630
  }
16558
16631
  },
16632
+ "ODC_refundable": {
16633
+ "title": "Whether the other dependents tax credit is fully refundable",
16634
+ "description": "If true, the other dependents tax credit is made fully refundable.",
16635
+ "notes": "",
16636
+ "section_1": "Child/Dependent Credits",
16637
+ "section_2": "Other Dependent Tax Credit",
16638
+ "indexable": false,
16639
+ "indexed": false,
16640
+ "type": "bool",
16641
+ "value": [
16642
+ {
16643
+ "year": 2013,
16644
+ "value": false
16645
+ },
16646
+ {
16647
+ "year": 2021,
16648
+ "value": true
16649
+ },
16650
+ {
16651
+ "year": 2022,
16652
+ "value": false
16653
+ }
16654
+ ],
16655
+ "validators": {
16656
+ "range": {
16657
+ "min": false,
16658
+ "max": true
16659
+ }
16660
+ },
16661
+ "compatible_data": {
16662
+ "puf": true,
16663
+ "cps": true
16664
+ }
16665
+ },
16559
16666
  "CTC_ps": {
16560
16667
  "title": "Child tax credit phaseout MAGI start",
16561
16668
  "description": "Child tax credit begins to decrease when MAGI is above this level; read descriptions of the dependent credit amounts for how they phase out when MAGI is above this level.",
@@ -16931,11 +17038,11 @@
16931
17038
  },
16932
17039
  {
16933
17040
  "year": 2023,
16934
- "value": 1500.0
17041
+ "value": 1600.0
16935
17042
  },
16936
17043
  {
16937
17044
  "year": 2024,
16938
- "value": 1500.0
17045
+ "value": 1600.0
16939
17046
  },
16940
17047
  {
16941
17048
  "year": 2025,
@@ -17968,7 +18075,7 @@
17968
18075
  {
17969
18076
  "year": 2020,
17970
18077
  "EIC": "3+kids",
17971
- "value": 6250.0
18078
+ "value": 5890.0
17972
18079
  },
17973
18080
  {
17974
18081
  "year": 2021,
@@ -20585,4 +20692,4 @@
20585
20692
  "cps": true
20586
20693
  }
20587
20694
  }
20588
- }
20695
+ }
taxcalc/records.py CHANGED
@@ -350,7 +350,7 @@ class Records(Data):
350
350
  # pylint: disable=no-member
351
351
  if self.ADJ.size > 0:
352
352
  # Interest income
353
- self.e00300 *= self.ADJ['INT{}'.format(year)][self.agi_bin].values
353
+ self.e00300 *= self.ADJ[f'INT{year}'].iloc[self.agi_bin].values
354
354
 
355
355
  def _read_ratios(self, ratios):
356
356
  """
@@ -1081,6 +1081,11 @@
1081
1081
  "desc": "search taxcalc/calcfunctions.py for how calculated and used",
1082
1082
  "form": {"2013-20??": "calculated variable"}
1083
1083
  },
1084
+ "dwks43": {
1085
+ "type": "float",
1086
+ "desc": "separate tax on long-term capital gains and qualified dividends",
1087
+ "form": {"2013-20??": "calculated variable"}
1088
+ },
1084
1089
  "fstax": {
1085
1090
  "type": "float",
1086
1091
  "desc": "search taxcalc/calcfunctions.py for how calculated and used",
taxcalc/taxcalcio.py CHANGED
@@ -427,8 +427,9 @@ class TaxCalcIO():
427
427
  calculated variables using their Tax-Calculator names
428
428
 
429
429
  output_sqldb: boolean
430
- whether or not to write SQLite3 database with dump table
431
- containing same output as written by output_dump to a csv file
430
+ whether or not to write SQLite3 database with two tables
431
+ (baseline and reform) each containing same output as written
432
+ by output_dump to a csv file
432
433
 
433
434
  Returns
434
435
  -------
@@ -449,10 +450,17 @@ class TaxCalcIO():
449
450
  (mtr_paytax, mtr_inctax,
450
451
  _) = self.calc.mtr(wrt_full_compensation=False,
451
452
  calc_all_already_called=True)
453
+ self.calc_base.calc_all()
454
+ calc_base_calculated = True
455
+ (mtr_paytax_base, mtr_inctax_base,
456
+ _) = self.calc_base.mtr(wrt_full_compensation=False,
457
+ calc_all_already_called=True)
452
458
  else:
453
459
  # definitely do not need marginal tax rates
454
460
  mtr_paytax = None
455
461
  mtr_inctax = None
462
+ mtr_paytax_base = None
463
+ mtr_inctax_base = None
456
464
  # extract output if writing_output_file
457
465
  if writing_output_file:
458
466
  self.write_output_file(output_dump, dump_varset,
@@ -460,7 +468,10 @@ class TaxCalcIO():
460
468
  self.write_doc_file()
461
469
  # optionally write --sqldb output to SQLite3 database
462
470
  if output_sqldb:
463
- self.write_sqldb_file(dump_varset, mtr_paytax, mtr_inctax)
471
+ self.write_sqldb_file(
472
+ dump_varset, mtr_paytax, mtr_inctax,
473
+ mtr_paytax_base, mtr_inctax_base
474
+ )
464
475
  # optionally write --tables output to text file
465
476
  if output_tables:
466
477
  if not calc_base_calculated:
@@ -480,7 +491,9 @@ class TaxCalcIO():
480
491
  Write output to CSV-formatted file.
481
492
  """
482
493
  if output_dump:
483
- outdf = self.dump_output(dump_varset, mtr_inctax, mtr_paytax)
494
+ outdf = self.dump_output(
495
+ self.calc, dump_varset, mtr_inctax, mtr_paytax
496
+ )
484
497
  column_order = sorted(outdf.columns)
485
498
  else:
486
499
  outdf = self.minimal_output()
@@ -504,15 +517,25 @@ class TaxCalcIO():
504
517
  with open(doc_fname, 'w') as dfile:
505
518
  dfile.write(doc)
506
519
 
507
- def write_sqldb_file(self, dump_varset, mtr_paytax, mtr_inctax):
520
+ def write_sqldb_file(self, dump_varset, mtr_paytax, mtr_inctax,
521
+ mtr_paytax_base, mtr_inctax_base):
508
522
  """
509
523
  Write dump output to SQLite3 database table dump.
510
524
  """
511
- outdf = self.dump_output(dump_varset, mtr_inctax, mtr_paytax)
512
- assert len(outdf.index) == self.calc.array_len
513
525
  db_fname = self._output_filename.replace('.csv', '.db')
514
526
  dbcon = sqlite3.connect(db_fname)
515
- outdf.to_sql('dump', dbcon, if_exists='replace', index=False)
527
+ # write baseline table
528
+ outdf = self.dump_output(
529
+ self.calc_base, dump_varset, mtr_inctax_base, mtr_paytax_base
530
+ )
531
+ assert len(outdf.index) == self.calc.array_len
532
+ outdf.to_sql('baseline', dbcon, if_exists='replace', index=False)
533
+ # write reform table
534
+ outdf = self.dump_output(
535
+ self.calc, dump_varset, mtr_inctax, mtr_paytax
536
+ )
537
+ assert len(outdf.index) == self.calc.array_len
538
+ outdf.to_sql('reform', dbcon, if_exists='replace', index=False)
516
539
  dbcon.close()
517
540
  del outdf
518
541
  gc.collect()
@@ -565,7 +588,7 @@ class TaxCalcIO():
565
588
  decile_details=False,
566
589
  pop_quantiles=False,
567
590
  weight_by_income_measure=False)
568
- gdfx = dfx.groupby('table_row', as_index=False)
591
+ gdfx = dfx.groupby('table_row', as_index=False, observed=True)
569
592
  rtns_series = gdfx.apply(unweighted_sum, 's006').values[:, 1]
570
593
  xinc_series = gdfx.apply(weighted_sum, 'expanded_income').values[:, 1]
571
594
  itax_series = gdfx.apply(weighted_sum, 'iitax').values[:, 1]
@@ -687,7 +710,7 @@ class TaxCalcIO():
687
710
  odf = pd.DataFrame(data=odict, columns=varlist)
688
711
  return odf
689
712
 
690
- def dump_output(self, dump_varset, mtr_inctax, mtr_paytax):
713
+ def dump_output(self, calcx, dump_varset, mtr_inctax, mtr_paytax):
691
714
  """
692
715
  Extract dump output and return it as Pandas DataFrame.
693
716
  """
@@ -699,7 +722,7 @@ class TaxCalcIO():
699
722
  # create and return dump output DataFrame
700
723
  odf = pd.DataFrame()
701
724
  for varname in varset:
702
- vardata = self.calc.array(varname)
725
+ vardata = calcx.array(varname)
703
726
  if varname in recs_vinfo.INTEGER_VARS:
704
727
  odf[varname] = vardata
705
728
  else:
taxcalc/utils.py CHANGED
@@ -261,6 +261,7 @@ def add_income_table_row_variable(dframe, income_measure, bin_edges):
261
261
  assert isinstance(bin_edges, list)
262
262
  dframe['table_row'] = pd.cut(dframe[income_measure],
263
263
  bin_edges, right=False)
264
+
264
265
  return dframe
265
266
 
266
267
 
@@ -360,7 +361,7 @@ def create_distribution_table(vdf, groupby, income_measure,
360
361
  dframe = add_income_table_row_variable(vdf, income_measure,
361
362
  SOI_AGI_BINS)
362
363
  # construct grouped DataFrame
363
- gdf = dframe.groupby('table_row', as_index=False)
364
+ gdf = dframe.groupby('table_row', observed=False, as_index=False)
364
365
  dist_table = stat_dataframe(gdf)
365
366
  del dframe['table_row']
366
367
  # compute sum row
@@ -539,8 +540,7 @@ def create_difference_table(vdf1, vdf2, groupby, tax_to_diff,
539
540
  df2, baseline_expanded_income, SOI_AGI_BINS)
540
541
  del df2
541
542
  # create grouped Pandas DataFrame
542
- gdf = dframe.groupby('table_row', as_index=False)
543
- del dframe['table_row']
543
+ gdf = dframe.groupby('table_row', as_index=False, observed=False)
544
544
  # create additive difference table statistics from gdf
545
545
  diff_table = additive_stats_dataframe(gdf)
546
546
  # calculate additive statistics on sums row
@@ -586,7 +586,7 @@ def create_difference_table(vdf1, vdf2, groupby, tax_to_diff,
586
586
  quotient = np.divide(
587
587
  diff_table['atinc2'].values, diff_table['atinc1'].values,
588
588
  out=np.zeros_like(diff_table['atinc2'].values),
589
- where=diff_table['atinc1'] != 0)
589
+ where=diff_table['atinc1'].values != 0)
590
590
  diff_table['pc_aftertaxinc'] = np.where(
591
591
  diff_table['atinc1'].values == 0., np.nan, 100 * (quotient - 1))
592
592
  # delete intermediate Pandas DataFrame objects
@@ -901,7 +901,7 @@ def mtr_graph_data(vdf, year,
901
901
  weight_by_income_measure=dollar_weighting
902
902
  )
903
903
  # split dfx into groups specified by 'table_row' column
904
- gdfx = dfx.groupby('table_row', as_index=False)
904
+ gdfx = dfx.groupby('table_row', observed=False, as_index=False)
905
905
  # apply the weighting_function to percentile-grouped mtr values
906
906
  mtr1_series = gdfx.apply(weighting_function, 'mtr1').values[:, 1]
907
907
  mtr2_series = gdfx.apply(weighting_function, 'mtr2').values[:, 1]
@@ -1018,7 +1018,7 @@ def atr_graph_data(vdf, year,
1018
1018
  include = [0] * num_bins_with_nonpos + [1] * (100 - num_bins_with_nonpos)
1019
1019
  included = np.array(include, dtype=bool)
1020
1020
  # split dfx into groups specified by 'table_row' column
1021
- gdfx = dfx.groupby('table_row', as_index=False)
1021
+ gdfx = dfx.groupby('table_row', observed=False, as_index=False)
1022
1022
  # apply weighted_mean function to percentile-grouped values
1023
1023
  avginc_series = gdfx.apply(weighted_mean, 'expanded_income').values[:, 1]
1024
1024
  avgtax1_series = gdfx.apply(weighted_mean, 'tax1').values[:, 1]
@@ -1192,7 +1192,7 @@ def pch_graph_data(vdf, year, pop_quantiles=False):
1192
1192
  include = [0] * num_bins_with_nonpos + [1] * (100 - num_bins_with_nonpos)
1193
1193
  included = np.array(include, dtype=bool)
1194
1194
  # split dfx into groups specified by 'table_row' column
1195
- gdfx = dfx.groupby('table_row', as_index=False)
1195
+ gdfx = dfx.groupby('table_row', observed=False, as_index=False)
1196
1196
  # apply weighted_mean function to percentile-grouped values
1197
1197
  avginc_series = gdfx.apply(weighted_mean, 'expanded_income').values[:, 1]
1198
1198
  change_series = gdfx.apply(weighted_mean, 'chg_aftinc').values[:, 1]
@@ -0,0 +1,22 @@
1
+ License
2
+ =======
3
+
4
+ The Tax-Calculator project is in the public domain within the United States.
5
+
6
+ Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication.
7
+
8
+ ## CC0 1.0 Universal Summary
9
+
10
+ The text below is a human-readable summary of the [Legal Code](https://creativecommons.org/publicdomain/zero/1.0/legalcode):
11
+
12
+ _No Copyright_
13
+
14
+ The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
15
+
16
+ You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
17
+
18
+ _Other Information_
19
+
20
+ In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights.
21
+
22
+ Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. When using or citing the work, you should not imply endorsement by the author or the affirmer.
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.1
2
+ Name: taxcalc
3
+ Version: 3.5.1
4
+ Summary: taxcalc
5
+ Home-page: https://github.com/PSLmodels/Tax-Calculator
6
+ Download-URL: https://github.com/PSLmodels/Tax-Calculator
7
+ License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Natural Language :: English
11
+ Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: setuptools
22
+ Requires-Dist: numpy
23
+ Requires-Dist: pandas
24
+ Requires-Dist: bokeh
25
+ Requires-Dist: numba
26
+ Requires-Dist: requests
27
+ Requires-Dist: paramtools
28
+
29
+ | | |
30
+ | --- | --- |
31
+ | Org | [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org) [![OS License: CCO-1.0](https://img.shields.io/badge/OS%20License-CCO%201.0-yellow)](https://github.com/PSLmodels/Tax-Calculator/blob/master/LICENSE) [![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://pslmodels.github.io/Tax-Calculator/) |
32
+ | Package | [![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-3916/) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3108/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3118/) [![PyPI Latest Release](https://img.shields.io/pypi/v/taxcalc.svg)](https://pypi.org/project/taxcalc/) [![PyPI Downloads](https://img.shields.io/pypi/dm/taxcalc.svg?label=PyPI%20downloads)](https://pypi.org/project/taxcalc/) [![Anaconda](https://img.shields.io/conda/dn/conda-forge/taxcalc?color=brightgreen&label=downloads&logo=conda-forge)](https://anaconda.org/conda-forge/taxcalc)|
33
+ | Testing | ![example event parameter](https://github.com/PSLmodels/Tax-Calculator/actions/workflows/build_and_test.yml/badge.svg?branch=master) ![example event parameter](https://github.com/PSLmodels/Tax-Calculator/actions/workflows/deploy_jupyterbook.yml/badge.svg?branch=master) [![Codecov](https://codecov.io/gh/PSLmodels/Tax-Calculator/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/Tax-Calculator) |
34
+
35
+
36
+ Tax-Calculator
37
+ ==============
38
+
39
+ Tax-Calculator is an open-source microsimulation model for static
40
+ analysis of USA federal income and payroll taxes.
41
+
42
+ We are seeking contributors and maintainers. If you are interested in joining the project as a contributor or maintainer,
43
+ open a new [issue](https://github.com/PSLmodels/Tax-Calculator/issues) and ping [@MattHJensen](https://github.com/MattHJensen/) or [@jdebacker](https://github.com/jdebacker/) -- or just jump right in.
44
+
45
+ Complete documentation is available
46
+ [here](https://PSLmodels.github.io/Tax-Calculator/).
@@ -1,5 +1,5 @@
1
- taxcalc/__init__.py,sha256=omPpOLeH5J_lhVHDRy6l802DzXPx3kvhG2hykRisFwc,478
2
- taxcalc/calcfunctions.py,sha256=07NRlF8m9W1352T4uyh4LvVkjdOu9-84GG12p4YPljM,142977
1
+ taxcalc/__init__.py,sha256=Wu6kY8rP0mJJbNsqu1UUCkQ_33aMgFjLCe2KZZrxqtA,478
2
+ taxcalc/calcfunctions.py,sha256=pmaIRH6zohN3uzUaEunk5-21kXipNUL3nKr8dXlD-jo,143910
3
3
  taxcalc/calculator.py,sha256=41eg3EG9m1wZjQnY7WTeQ-uCTTrLyYjCPIw2cJzYHRI,63465
4
4
  taxcalc/conftest.py,sha256=nO4J7qu1sTHgjqrzhpRMvfMJUrNm6GP_IsSuuDt_MeQ,141
5
5
  taxcalc/consumption.json,sha256=_lfFtw4wySEHMvF84gbqd9PkHc6bI4ws_oi8aAhXYUs,8101
@@ -14,18 +14,19 @@ taxcalc/growfactors.csv,sha256=XISZeWfSpnKr9uDKY5KHKB5QMWWViDrVlOvZ5mSxA-k,4502
14
14
  taxcalc/growfactors.py,sha256=JyuYVq1G1ZIjKmURH58p_-gaKuWI8x6BpeoRrTscfAo,5912
15
15
  taxcalc/parameters.py,sha256=slxBId996ciRN28eVTkKMZsdsu-99VNIXJCR9904vAo,31166
16
16
  taxcalc/policy.py,sha256=cn7fBXL8F4uYfA6OiEx4G6MR1AYFFEHfotZx6Ai0Xb8,6341
17
- taxcalc/policy_current_law.json,sha256=V5XnTTnqmsygn71S5CDIhi8N-B5L4WdNgZM50nYlIqU,547397
17
+ taxcalc/policy_current_law.json,sha256=79FRl7U3-t9jqSUvfBeTBwWorig_frG_vWa3fyCb4Qg,550601
18
18
  taxcalc/puf_ratios.csv,sha256=WnvPoUshrT_efG238w_8uO3B9mvK2zp6SA-bVkrA1Bw,3298
19
19
  taxcalc/puf_weights.csv.gz,sha256=Ff4lpP5ojG7J-PYVhwisiRI0dN25KCvVzkWW_48DVwY,12376957
20
- taxcalc/records.py,sha256=OxA9wPnIIyJWqCQv2S1NjTVtvDN6KgRN26Qd-uT5f9A,16243
21
- taxcalc/records_variables.json,sha256=OAVd6AFF9U2emcXtgHxZ0tIHTYagL_46fB5ubiSYt2E,42213
22
- taxcalc/taxcalcio.py,sha256=b_8wJdn56MpYCE9Pwm8ZQ2graRvtA9rOQ1KUKo-7sWI,30667
23
- taxcalc/utils.py,sha256=F0z189tx3MJX98X2gNOOb_SiAmo4KT5vpH-XbwMCsW8,61978
20
+ taxcalc/records.py,sha256=OGk5HPZo3NZyxmyCD2J0EeQvPLAbeF4k5T_kMZIJEec,16240
21
+ taxcalc/records_variables.json,sha256=JB7qZBLHhuUaP1UiH7Esw3vULFDeVrJZ0WeKWtyHgRY,42391
22
+ taxcalc/taxcalcio.py,sha256=jFfl1Nc5YCqZgxj69B5M1NdIvHyAyymnLvtxiU66scs,31573
23
+ taxcalc/utils.py,sha256=X82SRxqBuTlg3uFRzTFrvYHMRnzn71t3w9ZPj5x5pho,62038
24
24
  taxcalc/utilsprvt.py,sha256=iIyWp9-N3_XWjQj2jV2CWnJy7vrNlKB2_vIMwYjgbWY,1323
25
25
  taxcalc/cli/__init__.py,sha256=cyZ0tdx41j_vV_B6GAkqJmNKKG-B0wUC0ThC75lJlk4,104
26
- taxcalc/cli/tc.py,sha256=GYEHQf7-HYImgMkBIkCa0eY2SDW3R77Uj9LEJ9jAwZA,10711
27
- taxcalc-3.4.1.dist-info/METADATA,sha256=Iuf0tud7-qF7_eo4jOycaeZB0A55OZ_UUu8Vg_bCJ8Y,1884
28
- taxcalc-3.4.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
29
- taxcalc-3.4.1.dist-info/entry_points.txt,sha256=a3ZE1piRv683p27fOLdWZvVJXESkoslTOp5iXV7uVco,50
30
- taxcalc-3.4.1.dist-info/top_level.txt,sha256=Wh8wTDHkA_cm4dn8IoUCviDyGgVQqwEQKPJnl8z6d4c,8
31
- taxcalc-3.4.1.dist-info/RECORD,,
26
+ taxcalc/cli/tc.py,sha256=WtieQ4hc8xdctdmIwe7Ro52_7DQgX1k8zzdns6JrbDw,10781
27
+ taxcalc-3.5.1.dist-info/LICENSE,sha256=m5epLdB-_NXiY7NsEDgcHP4jDtJ4vOlRf5S3Jb-jraY,1299
28
+ taxcalc-3.5.1.dist-info/METADATA,sha256=fEQOrnQfoE5xwdznxZ2j_-oto4ZNQn6m75Fgm3jmn1o,3170
29
+ taxcalc-3.5.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
30
+ taxcalc-3.5.1.dist-info/entry_points.txt,sha256=a3ZE1piRv683p27fOLdWZvVJXESkoslTOp5iXV7uVco,50
31
+ taxcalc-3.5.1.dist-info/top_level.txt,sha256=Wh8wTDHkA_cm4dn8IoUCviDyGgVQqwEQKPJnl8z6d4c,8
32
+ taxcalc-3.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,40 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: taxcalc
3
- Version: 3.4.1
4
- Summary: taxcalc
5
- Home-page: https://github.com/PSLmodels/Tax-Calculator
6
- Download-URL: https://github.com/PSLmodels/Tax-Calculator
7
- License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
8
- Classifier: Development Status :: 4 - Beta
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Natural Language :: English
11
- Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
12
- Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
- Requires-Dist: numpy
20
- Requires-Dist: pandas
21
- Requires-Dist: bokeh
22
- Requires-Dist: numba
23
-
24
- [![PSL cataloged](https://img.shields.io/badge/PSL-cataloged-a0a0a0.svg)](https://www.PSLmodels.org)
25
- [![Python 3.6+](https://img.shields.io/badge/python-3.6%2B-blue.svg)](https://www.python.org/downloads/release/python-360/)
26
- [![Build Status](https://travis-ci.org/PSLmodels/Tax-Calculator.svg?branch=master)](https://travis-ci.org/PSLmodels/Tax-Calculator)
27
- [![Codecov](https://codecov.io/gh/PSLmodels/Tax-Calculator/branch/master/graph/badge.svg)](https://codecov.io/gh/PSLmodels/Tax-Calculator)
28
-
29
-
30
- Tax-Calculator
31
- ==============
32
-
33
- Tax-Calculator is an open-source microsimulation model for static
34
- analysis of USA federal income and payroll taxes.
35
-
36
- We are seeking contributors and maintainers. If you are interested in joining the project as a contributor or maintainer,
37
- open a new [issue](https://github.com/PSLmodels/Tax-Calculator/issues) and ping @MattHJensen or @jdebacker -- or just jump right in.
38
-
39
- Complete documentation is available
40
- [here](https://PSLmodels.github.io/Tax-Calculator/).