Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0becdc4
qbid income definition
baogorek May 22, 2025
04e3c02
new formulas
baogorek May 22, 2025
2728f39
Split input income variables into separate files
baogorek May 26, 2025
2ab3fd8
Merge pull request #6047 from PolicyEngine/codex/separate-variable-cl…
baogorek May 26, 2025
956077e
renaming. new qbid formulas
baogorek May 26, 2025
2d64d19
Merge branch 'master' of github.com:PolicyEngine/policyengine-us into…
baogorek May 26, 2025
6680a82
adding one unit test
PavelMakarchuk May 26, 2025
c319360
Refine QBI deduction references
baogorek May 27, 2025
5960e75
Merge pull request #6050 from PolicyEngine/codex/add-tax-code-referen…
baogorek May 27, 2025
1383eb3
Document tax form references for QBID
baogorek May 27, 2025
57edd94
Merge pull request #6052 from PolicyEngine/codex/add-comments-to-map-…
baogorek May 27, 2025
fc197c8
adding a test
baogorek May 27, 2025
912b6e4
tests for qbid_amount
baogorek May 27, 2025
d1953f3
Add QBI qualification flags and update QBI formula
baogorek May 27, 2025
81e7edc
Merge pull request #6058 from PolicyEngine/codex/add-new-qualified-bu…
baogorek May 27, 2025
6e99bb5
Fix uprating for QBI income variables
baogorek May 27, 2025
47fbb1d
Merge pull request #6059 from PolicyEngine/codex/fix-uprating-logic-f…
baogorek May 27, 2025
dfbe13b
Format files with black
baogorek May 28, 2025
62dc758
Merge pull request #6065 from PolicyEngine/codex/run-black-linter-on-…
baogorek May 28, 2025
ddc36bc
Merge branch 'master' of github.com:PolicyEngine/policyengine-us into…
baogorek May 28, 2025
a297757
responding to reviewer requests
baogorek May 28, 2025
4b0ddc0
adding references
baogorek May 28, 2025
e792429
reverting qbid logic files
baogorek May 29, 2025
58c1fcd
Removing new files added as they are part of the new branch now
baogorek May 29, 2025
c38872f
Split income variables into separate files
baogorek May 29, 2025
fe2cce3
Merge pull request #6069 from PolicyEngine/codex/refactor-income.py-i…
baogorek May 29, 2025
8725c53
linting
baogorek May 29, 2025
df06bed
cleaning up the emp_self_emp_ratio situation
baogorek May 30, 2025
65ae818
linter
baogorek May 30, 2025
23f3803
Update changelog for QBID preparation variables
baogorek May 30, 2025
02e258a
Merge pull request #6075 from PolicyEngine/codex/update-changelog_ent…
baogorek May 30, 2025
aa58dd3
adding one more thing to the changelog
baogorek May 30, 2025
c2e157f
yet another changelog mod
baogorek May 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- bump: minor
changes:
added:
- Qualified BDC dividend income variable
- Qualified REIT and PTP income variable
- Farm operations income variable
- Variables showing whether income types would be qualified business income (estate, farm operations, farm rent, partnership/S corp, rental, self employment)
- Parameter for sources of QBI deductions (deduction_definition.yaml)
- QBID reconciliation parameters (in_effect, phase_out_rate, use_bdc_income)
- Marginal tax rate including health benefits variable
- Tax code references to income variables where they were missing
changed:
- marginal_tax_rate and marginal_tax_rate_including_health_benefits now use emp_self_emp_ratio with no logic change
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: The Qualified Business Income Deduction (QBID) under reconciliation includes business development company (BDC) dividend income if this is true.

values:
0000-01-01: false

metadata:
unit: bool
period: year
label: Whether qualified business income (QBI) under reconciliation includes business development company (BDC) dividend income at the same rate as QBI (23% as initially proposed)
reference:
- title: Providing for reconciliation pursuant to H.Con.Res. 14, the Concurrent Resolution on the Budget for Fiscal Year 2025
href: "https://docs.house.gov/meetings/WM/WM00/20250513/118260/BILLS-119CommitteePrintih.pdf#page=9"
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ values:
metadata:
unit: list
label: Qualified business income deductions
reference:
- title: 26 U.S. Code § 199A(c)(1) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#c_1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Alternative QBID cap rate on pass-through business property owned
metadata:
unit: /1
label: Alternative QBID rate on business property
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(ii) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_ii
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Pass-through qualified business income deduction rate.
metadata:
label: Qualified business income deduction rate
unit: /1
reference:
- title: 26 U.S. Code § 199A(a)(2) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#a_2
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Alternative QBID cap rate on pass-through business W-2 wages paid.
metadata:
label: Alternative QBID rate on W-2 wages
unit: /1
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(ii) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_ii
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: QBID cap rate on pass-through business W-2 wages paid.
metadata:
label: QBID rate on W-2 wages
unit: /1
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(i) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_i
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
description: Dollar gap between upper and lower threshold of pre-QBID taxable income
metadata:
unit: currency-USD
reference:
- title: 26 U.S. Code § 199A(b)(3)(B) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_3_B
HEAD_OF_HOUSEHOLD:
2013-01-01: 1.0
2018-01-01: 50_000.0
Expand Down
19 changes: 19 additions & 0 deletions policyengine_us/variables/household/emp_self_emp_ratio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from policyengine_us.model_api import *


class emp_self_emp_ratio(Variable):
value_type = float
entity = Person
label = "Share of earnings from wages and salaries"
unit = "/1"
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/1402"

def formula(person, period, parameters):
employment_income = person("employment_income", period)
self_employment_income = person("self_employment_income", period)
earnings = employment_income + self_employment_income
res = np.ones_like(earnings)
mask = earnings > 0
res[mask] = employment_income[mask] / earnings[mask]
return res
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from policyengine_us.model_api import *


class qualified_bdc_income(Variable):
value_type = float
entity = Person
label = "Business Development Company dividend income"
unit = USD
documentation = "Business Development Company Dividend Income. Part of the QBID calculation."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/1#h_11"
uprating = "calibration.gov.irs.soi.qualified_dividend_income"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from policyengine_us.model_api import *


class qualified_reit_and_ptp_income(Variable):
value_type = float
entity = Person
label = "REIT and PTP Income"
unit = USD
documentation = "REIT and Publically Traded Partnership Income. Part of the QBID calclulation."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/1#h_11"
uprating = "calibration.gov.irs.soi.qualified_dividend_income"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class estate_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Estate income would be qualified"
documentation = "Whether income from estates would be considered qualified business income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from policyengine_us.model_api import *


class farm_operations_income(Variable):
value_type = float
entity = Person
label = "farm operations income"
unit = USD
documentation = "Income from active farming operations. Schedule F. Do not include this income in self-employment income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
uprating = "calibration.gov.irs.soi.farm_income"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class farm_operations_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Farm operations income would be qualified"
documentation = "Whether farm operations income would be considered qualified business income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ class farm_rent_income(Variable):
label = "farm rental income"
unit = USD
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/1402"
uprating = "calibration.gov.irs.soi.farm_rent_income"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class farm_rent_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Farm rent income would be qualified"
documentation = "Whether farm rental income would be considered qualified business income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from policyengine_us.model_api import *


class rental_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Rental income would be qualified"
documentation = (
"Whether rental income would be considered qualified business income."
)
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class partnership_s_corp_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Partnership and S-corp income would be qualified"
documentation = "Whether income from partnerships and S corporations would be considered qualified business income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class self_employment_income_would_be_qualified(Variable):
value_type = bool
entity = Person
label = "Self-employment income would be qualified"
documentation = "Whether self-employment income would be considered qualified business income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/199A#c_3_A"
default_value = True
9 changes: 1 addition & 8 deletions policyengine_us/variables/household/marginal_tax_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ def formula(person, period, parameters):
adult_indexes = person("adult_earnings_index", period)
employment_income = person("employment_income", period)
self_employment_income = person("self_employment_income", period)
total_earnings = employment_income + self_employment_income

emp_self_emp_ratio = np.divide(
employment_income,
total_earnings,
out=np.ones_like(total_earnings, dtype=np.float32),
where=total_earnings > 0,
)
emp_self_emp_ratio = person("emp_self_emp_ratio", period)

for adult_index in range(1, 1 + adult_count):
alt_sim = sim.get_branch(f"mtr_for_adult_{adult_index}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ def formula(person, period, parameters):
adult_indexes = person("adult_earnings_index", period)
employment_income = person("employment_income", period)
self_employment_income = person("self_employment_income", period)
total_earnings = employment_income + self_employment_income

emp_self_emp_ratio = np.divide(
employment_income,
total_earnings,
out=np.ones_like(total_earnings, dtype=np.float32),
where=total_earnings > 0,
)
emp_self_emp_ratio = person("emp_self_emp_ratio", period)

for adult_index in range(1, 1 + adult_count):
alt_sim = sim.get_branch(f"mtr_for_adult_{adult_index}")
Expand Down
16 changes: 16 additions & 0 deletions policyengine_us/variables/input/employment_income.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from policyengine_us.model_api import *


class employment_income(Variable):
value_type = float
entity = Person
label = "employment income"
documentation = "Wages and salaries, including tips and commissions."
unit = USD
definition_period = YEAR
adds = [
"employment_income_before_lsr",
"employment_income_behavioral_response",
]
reference = "https://www.law.cornell.edu/uscode/text/26/3401#a"
uprating = "calibration.gov.irs.soi.employment_income"
11 changes: 11 additions & 0 deletions policyengine_us/variables/input/employment_income_before_lsr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class employment_income_before_lsr(Variable):
value_type = float
entity = Person
label = "employment income before labor supply responses"
unit = USD
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/3401#a"
uprating = "calibration.gov.irs.soi.employment_income"
12 changes: 12 additions & 0 deletions policyengine_us/variables/input/farm_income.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from policyengine_us.model_api import *


class farm_income(Variable):
value_type = float
entity = Person
label = "farm income"
unit = USD
documentation = "Income averaging for farmers and fishermen. Schedule J. Seperate from QBI and self-employment income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/1301"
uprating = "calibration.gov.irs.soi.farm_income"
77 changes: 0 additions & 77 deletions policyengine_us/variables/input/income.py

This file was deleted.

16 changes: 16 additions & 0 deletions policyengine_us/variables/input/self_employment_income.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from policyengine_us.model_api import *


class self_employment_income(Variable):
value_type = float
entity = Person
label = "self-employment income"
unit = USD
documentation = "Self-employment non-farm income."
definition_period = YEAR
adds = [
"self_employment_income_before_lsr",
"self_employment_income_behavioral_response",
]
reference = "https://www.law.cornell.edu/uscode/text/26/1402#a"
uprating = "calibration.gov.irs.soi.self_employment_income"
Loading
Loading