Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish elimination of taxcalc-related variables #3226

Merged
merged 18 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
10 changes: 10 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- bump: minor
changes:
added:
- The `net_capital_gains` variable (formerly `c23650`).
- The `gov/irs/capital_gains/loss_limit.yaml` parameter file.
- The `loss_limited_net_capital_gains` variable (formerly `c01000`) that uses the `loss_limit` parameter.
removed:
- Formula code that avoids `sep` variable that had no formula, and therefore, was likely to cause bugs.
MaxGhenis marked this conversation as resolved.
Show resolved Hide resolved
changed:
- Rename taxcalc variables to be consistent with this project's coding style and to be in more sensible directory locations.
16 changes: 16 additions & 0 deletions policyengine_us/parameters/gov/irs/capital_gains/loss_limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: Capital gains loss limit
metadata:
unit: currency-USD
reference:
- title: IRS Topic No. 409, Capital Gains and Losses
href: https://www.irs.gov/taxtopics/tc409
HEAD_OF_HOUSEHOLD:
2013-01-01: 3_000
JOINT:
2013-01-01: 3_000
SEPARATE:
2013-01-01: 1_500
SINGLE:
2013-01-01: 3_000
WIDOW:
2013-01-01: 3_000
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Personal exemption phase-out step size
metadata:
unit: /1
unit: currency-USD
reference:
- title: 26 U.S. Code § 151 - Allowance of deductions for personal exemptions (d)(3)(B)
href: https://www.law.cornell.edu/uscode/text/26/151#d_3_B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ values:
- taxable_interest_income
- dividend_income
- rental_income
- c01000 # Loss-limited capital gains.
- loss_limited_net_capital_gains
metadata:
unit: currency-USD
label: net investment income sources
Expand Down
16 changes: 8 additions & 8 deletions policyengine_us/reforms/winship.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ def create_eitc_winship_reform(parameters, period, bypass=False):
):
return None

# Compute EITC under filer_earned = tax_unit_head_earned
# Then compute EITC under filer_earned = tax_unit_spouse_earned
# Compute EITC under filer_adj_earnings = filer head adj earnings
# Then compute EITC under filer_adj_earnings = filer spouse adj earnings
# Then set EITC = sum of the two

class original_eitc(Variable):
Expand Down Expand Up @@ -40,26 +40,26 @@ def formula(tax_unit, period, parameters):
person = tax_unit.members
simulation = tax_unit.simulation
agi = tax_unit("adjusted_gross_income", period)
earned_income = person("earned", period)
adj_earnings = person("adjusted_earnings", period)
is_head = person("is_tax_unit_head", period)
is_spouse = person("is_tax_unit_spouse", period)

filer_earned_head_only = tax_unit.sum(earned_income * is_head)
filer_earned_spouse_only = tax_unit.sum(earned_income * is_spouse)
filer_earned_head_only = tax_unit.sum(adj_earnings * is_head)
filer_earned_spouse_only = tax_unit.sum(adj_earnings * is_spouse)

head_only_branch = simulation.get_branch("head_only")
head_only_branch.set_input(
"filer_earned", period, filer_earned_head_only
"filer_adjusted_earnings", period, filer_earned_head_only
)
# Phase out with respect to individual earned income, instead of AGI.
# Phase out with respect to individual earnings instead of AGI
head_only_branch.set_input(
"adjusted_gross_income", period, filer_earned_head_only
)
head_eitc = head_only_branch.calculate("original_eitc", period)

spouse_only_branch = simulation.get_branch("spouse_only")
spouse_only_branch.set_input(
"filer_earned", period, filer_earned_spouse_only
"filer_adjusted_earnings", period, filer_earned_spouse_only
)
spouse_only_branch.set_input(
"adjusted_gross_income", period, filer_earned_spouse_only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
period: 2018
input:
is_tax_unit_head: true
earned: 1
adjusted_earnings: 1
output:
head_earned: 1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
people:
head:
is_tax_unit_head: true
earned: 1
adjusted_earnings: 1
spouse:
is_tax_unit_spouse: true
earned: 2
adjusted_earnings: 2
tax_units:
tax_unit:
members: [head, spouse]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
- name: Negatives also produce zero.
period: 2022
input:
sey: -1
self_employment_income: -1
output:
taxable_self_employment_income: 0

- name: Otherwise, half of self-employment taxes are deducted.
period: 2022
input:
sey: 100_000
self_employment_income: 100_000
output:
taxable_self_employment_income: 92_350

- name: Zero if less than $400.
period: 2022
input:
sey: 399
self_employment_income: 399
output:
taxable_self_employment_income: 0
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
input:
taxable_interest_income: 0
dividend_income: 0
c01000: 0
loss_limited_net_capital_gains: 0
rental_income: 0
filing_status: SINGLE
output:
Expand All @@ -14,7 +14,7 @@
input:
taxable_interest_income: 0
dividend_income: 0
c01000: 0
loss_limited_net_capital_gains: 0
rental_income: 199_000
filing_status: SINGLE
output:
Expand All @@ -25,7 +25,7 @@
input:
taxable_interest_income: 0
dividend_income: 0
c01000: 0
loss_limited_net_capital_gains: 0
adjusted_gross_income: 205_000
rental_income: 205_000
filing_status: SINGLE
Expand All @@ -37,7 +37,7 @@
input:
taxable_interest_income: 0
dividend_income: 0
c01000: 0
loss_limited_net_capital_gains: 0
adjusted_gross_income: 900_000
rental_income: 900_000
filing_status: SINGLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
tax_units:
tax_unit:
members: [parent, child]
filer_earned: 25_000
filer_adjusted_earnings: 25_000
ca_eitc: 1
households:
household:
Expand All @@ -29,7 +29,7 @@
tax_units:
tax_unit:
members: [parent, child]
filer_earned: 25_100
filer_adjusted_earnings: 25_100
ca_eitc: 1
households:
household:
Expand All @@ -49,7 +49,7 @@
tax_units:
tax_unit:
members: [parent, child]
filer_earned: 25_100
filer_adjusted_earnings: 25_100
ca_eitc: 1
households:
household:
Expand Down Expand Up @@ -90,7 +90,7 @@
tax_units:
tax_unit:
members: [parent, child]
filer_earned: 30_000
filer_adjusted_earnings: 30_000
ca_eitc: 1
households:
household:
Expand All @@ -113,7 +113,7 @@
tax_units:
tax_unit:
members: [parent, child1, child2]
filer_earned: 25_100
filer_adjusted_earnings: 25_100
ca_eitc: 1
households:
household:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
adjusted_gross_income: 4_000
filing_status: SINGLE
exemptions_count: 3
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2, person3]
Expand Down Expand Up @@ -50,7 +50,7 @@
adjusted_gross_income: 4_000
filing_status: SINGLE
exemptions_count: 3
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2, person3]
Expand Down Expand Up @@ -81,7 +81,7 @@
adjusted_gross_income: 4_000
filing_status: SINGLE
exemptions_count: 2
dsi: true
head_is_dependent_elsewhere: true
households:
household:
members: [person1, person2]
Expand Down Expand Up @@ -111,7 +111,7 @@
adjusted_gross_income: 35_000
filing_status: SINGLE
exemptions_count: 3
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2, person3]
Expand Down Expand Up @@ -141,7 +141,7 @@
adjusted_gross_income: 35_000
filing_status: JOINT
exemptions_count: 3
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2, person3]
Expand Down Expand Up @@ -171,7 +171,7 @@
adjusted_gross_income: 55_000
filing_status: JOINT
exemptions_count: 3
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2, person3]
Expand All @@ -197,7 +197,7 @@
members: [person1, person2]
adjusted_gross_income: 6_000
filing_status: SINGLE
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2]
Expand All @@ -223,7 +223,7 @@
members: [person1, person2]
adjusted_gross_income: 6_000
filing_status: SINGLE
dsi: false
head_is_dependent_elsewhere: false
households:
household:
members: [person1, person2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
period: 2021
input:
state_code: HI
dsi: false
head_is_dependent_elsewhere: false
adjusted_gross_income: 29_000
rent: 1_100
output:
Expand All @@ -12,7 +12,7 @@
period: 2021
input:
state_code: HI
dsi: false
head_is_dependent_elsewhere: false
adjusted_gross_income: 31_000
rent: 1_100
output:
Expand All @@ -22,7 +22,7 @@
period: 2021
input:
state_code: HI
dsi: false
head_is_dependent_elsewhere: false
adjusted_gross_income: 29_000
rent: 900
output:
Expand All @@ -32,7 +32,7 @@
period: 2021
input:
state_code: HI
dsi: false
head_is_dependent_elsewhere: false
adjusted_gross_income: 32_000
rent: 900
output:
Expand Down
Loading