Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions changelog.d/codex-remove-reported-value-shortcuts.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove reported-value fallback shortcuts from modeled SNAP, broadband subsidy, and state income tax calculations.

This file was deleted.

6 changes: 0 additions & 6 deletions policyengine_us/parameters/gov/simulation/reported_snap.yaml

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion policyengine_us/reforms/federal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
create_abolish_federal_income_tax_reform,
)
from .abolish_payroll_tax import create_abolish_payroll_tax_reform
from .reported_state_income_tax import create_reported_state_income_tax_reform
69 changes: 0 additions & 69 deletions policyengine_us/reforms/federal/reported_state_income_tax.py

This file was deleted.

5 changes: 0 additions & 5 deletions policyengine_us/reforms/reforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from .congress.wyden_smith import create_ctc_expansion_reform
from .federal import create_abolish_federal_income_tax_reform
from .federal import create_abolish_payroll_tax_reform
from .federal import create_reported_state_income_tax_reform
from .biden.budget_2025 import (
create_medicare_and_investment_tax_increase_reform,
)
Expand Down Expand Up @@ -227,9 +226,6 @@ def create_structural_reforms_from_parameters(parameters, period):
parameters, period
)
abolish_payroll_tax = create_abolish_payroll_tax_reform(parameters, period)
reported_state_income_tax = create_reported_state_income_tax_reform(
parameters, period
)
capital_gains_tax_increase = create_capital_gains_tax_increase_reform(
parameters, period
)
Expand Down Expand Up @@ -387,7 +383,6 @@ def create_structural_reforms_from_parameters(parameters, period):
ctc_expansion,
abolish_federal_income_tax,
abolish_payroll_tax,
reported_state_income_tax,
medicare_and_investment_tax_increase,
capital_gains_tax_increase,
halve_joint_eitc_phase_out_rate,
Expand Down
20 changes: 20 additions & 0 deletions policyengine_us/tests/microsimulation/test_microsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,23 @@ def test_county_persists_across_periods():
assert not np.any(county_2025 == County.ALBANY_COUNTY_NY.index), (
"Should not fall back to Albany county"
)


def test_microsim_snap_uses_modeled_amount_times_takeup():
import numpy as np
from policyengine_us import Microsimulation

sim = Microsimulation(
dataset="hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5"
)
sim.subsample(500)

snap = sim.calc("snap", period=2024).values
takes_up = sim.calc("takes_up_snap_if_eligible", period=2024).values.astype(float)
modeled_amount = (
sim.calc("snap_normal_allotment", period=2024).values
+ sim.calc("snap_emergency_allotment", period=2024).values
+ sim.calc("dc_snap_temporary_local_benefit", period=2024).values
)

np.testing.assert_allclose(snap, modeled_amount * takes_up)
Original file line number Diff line number Diff line change
@@ -1,47 +1,24 @@
- name: Reported state income tax sim false
- name: State income tax uses modeled liability
period: 2021
input:
simulation.reported_state_income_tax: false
state_income_tax_before_refundable_credits: 1_000
state_refundable_credits: 300
output:
state_income_tax: 700

- name: Reported state income tax sim false, negative amount
- name: State income tax can be negative after refundable credits
period: 2021
input:
simulation.reported_state_income_tax: false
state_income_tax_before_refundable_credits: 0
state_refundable_credits: 300
output:
state_income_tax: -300

- name: Reported state income tax sim, one head
- name: State income tax ignores reported SPM totals
period: 2021
input:
simulation.reported_state_income_tax: true
people:
person1:
is_tax_unit_head: true
spm_units:
spm_unit:
members: [person1]
spm_unit_state_tax_reported: 1_000
output:
state_income_tax: 1_000

- name: Reported state income tax sim, one head
period: 2021
input:
simulation.reported_state_income_tax: true
people:
person1:
is_tax_unit_head: true
person2:
is_tax_unit_head: true
spm_units:
spm_unit:
members: [person1, person2]
spm_unit_state_tax_reported: 1_000
state_income_tax_before_refundable_credits: 1_000
state_refundable_credits: 300
spm_unit_state_tax_reported: 1_000
output:
state_income_tax: 500
state_income_tax: 700
42 changes: 42 additions & 0 deletions policyengine_us/tests/policy/baseline/gov/usda/snap/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,48 @@
output:
snap: 6

- name: SNAP ignores reported values when computing modeled benefits.
period: 2024
input:
snap_reported: 99
snap_normal_allotment: 1
snap_emergency_allotment:
2024-01: 2
2024-02: 0
2024-03: 0
2024-04: 0
2024-05: 0
2024-06: 0
2024-07: 0
2024-08: 0
2024-09: 0
2024-10: 0
2024-11: 0
2024-12: 0
output:
snap: 3

- name: SNAP is zero when abolished.
period: 2024
input:
gov.usda.snap.abolish_snap: true
snap_normal_allotment: 1
snap_emergency_allotment:
2024-01: 2
2024-02: 0
2024-03: 0
2024-04: 0
2024-05: 0
2024-06: 0
2024-07: 0
2024-08: 0
2024-09: 0
2024-10: 0
2024-11: 0
2024-12: 0
output:
snap: 0

- name: North Carolina 2025, yearly integration test
period: 2025
absolute_error_margin: 0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
output:
household_state_income_tax: 100

- name: Household state income tax with switch
- name: Household state income tax ignores reported toggle inputs
period: 2022
input:
dc_income_tax: 100
simulation.reported_state_income_tax: true
dc_income_tax_before_refundable_credits: 100
spm_unit_state_tax_reported: 999
output:
household_state_income_tax: 0
household_state_income_tax: 100
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
- name: Reported state income tax sim false
- name: Household state income tax uses modeled components
period: 2021
input:
simulation.reported_state_income_tax: false
co_income_tax_before_refundable_credits: 3_000
ne_income_tax_before_refundable_credits: 2_000
pa_income_tax: 100
Expand All @@ -11,32 +10,15 @@
output:
household_state_income_tax: 3_900

- name: Reported state income tax sim, one head
- name: Household state income tax ignores reported SPM totals
period: 2021
input:
simulation.reported_state_income_tax: true
people:
person1:
is_tax_unit_head: true
spm_units:
spm_unit:
members: [person1]
spm_unit_state_tax_reported: 1_000
output:
household_state_income_tax: 1_000

- name: Reported state income tax sim, one head
period: 2021
input:
simulation.reported_state_income_tax: true
people:
person1:
is_tax_unit_head: true
person2:
is_tax_unit_head: true
spm_units:
spm_unit:
members: [person1, person2]
spm_unit_state_tax_reported: 1_000
co_income_tax_before_refundable_credits: 3_000
ne_income_tax_before_refundable_credits: 2_000
pa_income_tax: 100
hi_refundable_credits: 300
ok_refundable_credits: 500
ut_refundable_credits: 400
spm_unit_state_tax_reported: 1_000
output:
household_state_income_tax: 500
household_state_income_tax: 3_900
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
- name: By default only use reported amount.
- name: Broadband subsidy ignores reported amount
period: 2023
input:
spm_unit_broadband_subsidy_reported: 1
acp: 2
ebb: 3
output:
spm_unit_broadband_subsidy: 1
spm_unit_broadband_subsidy: 5

- name: Otherwise sum ACP, EBB, and Lifeline.
- name: Broadband subsidy sums ACP and EBB
period: 2023
input:
gov.simulation.reported_broadband_subsidy: false
lifeline: 1
acp: 2
ebb: 3
output:
Expand All @@ -18,9 +18,7 @@
- name: Baseline subsidy test with relevant inputs
period: 2023
input:
gov.simulation.reported_broadband_subsidy: false
acp: 1
ebb: 2
output:
spm_unit_broadband_subsidy: 3

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion policyengine_us/tests/test_batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def split_into_batches(
"dc_single_joint_threshold_ratio.yaml",
"reconciliation",
"dc_kccatc.yaml",
"reported_state_income_tax.yaml",
]
BATCH_6 = ["crfb"] # ~8.9 GB, always alone
BATCH_7 = ["congress"] # ~6.3 GB
Expand Down
Loading
Loading