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
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ REST_SPM_TESTS := $(TESTS)/core/test_spm_policy_family.py \
# from its dry run and spreads their files over parallel runners by recent
# CI times, splitting a long group into chunks. A process still runs files
# of one group only, in this order, so none holds more than its group here.
REST_PYTHON_GROUPS := cached-arrays heavy-a heavy-b core-heavy ss-calculator-engine ss-calculator-differential ss-history-engine ss-history-differential social-security-inputs core policy-parameters policy remaining-heavy remaining
REST_PYTHON_GROUPS := cached-arrays heavy-a heavy-b core-heavy ss-calculator-engine ss-calculator-differential ss-history-engine ss-history-differential social-security-inputs core policy-parameters policy reform-benefit-lists remaining-heavy remaining
REST_CACHED_ARRAY_TESTS := $(TESTS)/test_formulas_do_not_write_into_cached_arrays.py
REST_HEAVY_A_TESTS := $(TESTS)/test_md_poverty_line_credit_invariants.py \
$(TESTS)/core/test_ald_determinism.py \
Expand Down Expand Up @@ -96,6 +96,11 @@ REST_SOCIAL_SECURITY_PIA_RATIO_INPUT_TESTS := $(TESTS)/core/test_ss_pia_ratio_in
# a default Microsimulation only to read parameters. Release their heap before
# the remaining policy tests, rather than stacking both in the 13.9 GB group.
REST_POLICY_PARAMETER_TESTS := $(TESTS)/policy/baseline/parameters
# test_reform_benefit_lists.py builds a full system for each of four reforms,
# one at a time. Local macOS run on a loaded host: 21 passed in 23.5 minutes
# with 5.7 GiB peak RSS. Its own process keeps that heap apart from the systems
# remaining-heavy retains (10.5 GiB peak RSS in release run 42082143005).
REST_REFORM_BENEFIT_LIST_TESTS := $(TESTS)/test_reform_benefit_lists.py
# The first four files retain three independent full systems (the two CTC
# files share one). The last two use transient TX simulations and balance
# elapsed time without warming the NY/AL pinned-system cache.
Expand All @@ -109,7 +114,7 @@ REST_LISTED_TESTS := $(REST_CACHED_ARRAY_TESTS) $(REST_HEAVY_A_TESTS) $(REST_HEA
$(REST_CORE_HEAVY_TESTS) $(REST_SS_CALCULATOR_ENGINE_TESTS) $(REST_SS_CALCULATOR_DIFFERENTIAL_TESTS) \
$(REST_SS_HISTORY_ENGINE_TESTS) $(REST_SS_HISTORY_DIFFERENTIAL_TESTS) \
$(REST_SOCIAL_SECURITY_INPUT_TESTS) $(REST_SOCIAL_SECURITY_PIA_RATIO_INPUT_TESTS) \
$(REST_POLICY_PARAMETER_TESTS) $(REST_REMAINING_HEAVY_TESTS)
$(REST_POLICY_PARAMETER_TESTS) $(REST_REFORM_BENEFIT_LIST_TESTS) $(REST_REMAINING_HEAVY_TESTS)
REST_IGNORES := $(addprefix --ignore=,$(TESTS)/policy/contrib $(TESTS)/microsimulation $(REST_SPM_TESTS))
# $(call rest_pytest,<group>,<paths>,<more paths to ignore>) is the pytest
# command for one group. With REST_REPORT_DIR set, each group writes its own
Expand Down Expand Up @@ -362,6 +367,8 @@ test-other-python-rest-policy-parameters:
$(call rest_pytest,policy-parameters,$(REST_POLICY_PARAMETER_TESTS))
test-other-python-rest-policy:
$(call rest_pytest,policy,$(TESTS)/policy,$(REST_LISTED_TESTS))
test-other-python-rest-reform-benefit-lists:
$(call rest_pytest,reform-benefit-lists,$(REST_REFORM_BENEFIT_LIST_TESTS))
test-other-python-rest-remaining-heavy:
$(call rest_pytest,remaining-heavy,$(REST_REMAINING_HEAVY_TESTS))
test-other-python-rest-remaining:
Expand Down
1 change: 1 addition & 0 deletions changelog.d/spm-benefits-parameter.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Keep every baseline benefit in SPM resources under the Texas rebate, the End Child Poverty Act, its Economic Dignity for All Agenda version and the BOOST Act. Each reform copied the `spm_unit_benefits` program list, and the copies had fallen behind: Texas dropped 19 state SSI supplements, and the three Tlaib reforms dropped 42 supplements, Washington's State Family Assistance and Refugee Cash Assistance and the Washington and West Virginia child care subsidies, and counted ACP and EBB twice. The list now lives in the `gov.household.spm_unit_benefits` parameter, and each reform adds its own benefit there and to `gov.household.household_benefits` with the new `add_to_list_parameter` helper. The End Child Poverty Act and BOOST Act household totals now count CSFP and household health benefits too. A new `boost_middle_class_tax_credit_paid_through_ssa` variable holds the BOOST credit when the Social Security Administration pays it.
109 changes: 109 additions & 0 deletions policyengine_us/parameters/gov/household/spm_unit_benefits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
description: PolicyEngine counts these sources as SPM unit benefits.
# Reforms add their own benefits here with add_to_list_parameter
# (policyengine_us/tools/parameters.py) and leave spm_unit_benefits alone.
# spm_unit_net_income adds acp and ebb itself, so they are not listed. The
# spm_unit_benefits formula adds the SPM's capped housing subsidy, and the flat
# tax reform's assigned_aca_ptc under its deduct_ptc switch.
values:
0000-01-01:
- social_security
- ssi
- in_ssp
- ct_ssp
- ga_ssp
- al_ssp
- ak_ssp
- dc_ossp # DC benefits
- id_aabd # Idaho benefits
- vt_aabd # Vermont benefits
- ky_ssp # Kentucky benefits
- de_ssp # Delaware benefits
- fl_oss
- nj_ssp # New Jersey benefits
- nh_ssp # New Hampshire benefits
- pa_ssp # Pennsylvania benefits
- wy_ssp # Wyoming benefits
- or_ssp # Oregon benefits
- nc_sa # North Carolina benefits
- mt_ssp # Montana benefits
- ok_ssp # Oklahoma benefits
- oh_rss # Ohio benefits
- ny_ssp # New York benefits
- ri_ssp # Rhode Island benefits
- ut_ssp # Utah benefits
- sd_ssp # South Dakota benefits
- va_ag # Virginia benefits
- ia_ssa # Iowa benefits
- ks_sspp # Kansas benefits
- hi_oss
- la_oss # Louisiana benefits
- ma_state_supplement # Massachusetts benefits
- md_paa # Maryland benefits
- wa_ssp # Washington benefits
- wi_ssp # Wisconsin benefits
- mi_ssp # Michigan benefits
- me_ssp # Maine benefits
- mo_ssp # Missouri benefits
- mn_msa # Minnesota benefits
- ne_aabd # Nebraska benefits
- nv_oss # Nevada benefits
# California programs.
- ca_cvrp # California Clean Vehicle Rebate Project.
# California SSI state supplement (SSP). The formula nets federal SSI and
# countable income out of the state payment standard, so summing it with
# ssi does not double-count.
- ca_state_supplement
# Colorado programs.
- co_ccap_subsidy
- co_state_supplement
- co_oap
# Washington programs.
- wa_child_care_subsidies
# New Mexico programs.
- nm_ssi_state_supplement
# South Carolina programs.
- sc_ssi_state_supplement
# Texas programs.
- tx_ssi_state_supplement
# West Virginia programs.
- wv_child_care_subsidies
- snap
- wic
- free_school_meals
- reduced_price_school_meals
- child_support_received
- workers_compensation
- educational_assistance
- financial_assistance
- survivor_benefits
- spm_unit_energy_subsidy
- tanf
# Washington (WA) cash-assistance programs. wa_sfa and wa_rca sit
# alongside the federal TANF aggregator entry; under default rules these
# three are mutually exclusive at the SPM-unit level so summing them does
# not double-count.
- wa_sfa
- wa_rca
- high_efficiency_electric_home_rebate
- residential_efficiency_electrification_rebate
- total_unemployment_compensation
# One-time energy relief payments.
# Paid at the same time as the Alaska Permanent Fund Dividend, which is
# part of IRS gross income.
- ak_energy_relief
# Contributed.
- basic_income
- trump_dividend
# Cash programs that household_benefits also counts.
- ca_capi # California Cash Assistance Program for Immigrants.
- ca_la_expectant_parent_payment # Los Angeles County.
- ca_la_infant_supplement # Los Angeles County.
- co_denver_property_tax_relief # Denver.
- ma_eaedc # Massachusetts.
- nj_property_tax_relief # ANCHOR, Senior Freeze and Stay NJ.
- ny_drive_clean_rebate

metadata:
unit: list
period: year
label: SPM unit benefits
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from policyengine_us.model_api import *
from policyengine_us.tools.parameters import add_to_list_parameter


def create_boost_middle_class_tax_credit() -> Reform:
Expand Down Expand Up @@ -43,127 +44,39 @@ def formula(tax_unit, period, parameters):
return previous_credits
return middle_class_credit + previous_credits

class household_benefits(Variable):
class boost_middle_class_tax_credit_paid_through_ssa(Variable):
value_type = float
entity = Household
label = "benefits"
entity = TaxUnit
label = "BOOST Middle Class Tax Credit paid through SSA"
unit = USD
definition_period = YEAR
documentation = (
"The credit as a benefit when the Social Security Administration "
"pays it, and zero when it is a refundable income tax credit."
)

def formula(household, period, parameters):
BENEFITS = [
"social_security",
"ssi",
"snap",
"wic",
"free_school_meals",
"reduced_price_school_meals",
"child_support_received",
"workers_compensation",
"educational_assistance",
"financial_assistance",
"survivor_benefits",
# Broadband subsidies.
"acp",
"ebb",
"tanf",
"high_efficiency_electric_home_rebate",
"residential_efficiency_electrification_rebate",
"total_unemployment_compensation",
# Contributed.
"basic_income",
"trump_dividend",
"housing_assistance",
"household_state_benefits",
"household_local_benefits",
"household_head_start_benefits",
"ak_energy_relief",
"ny_drive_clean_rebate",
]
if parameters(period).gov.hud.abolition:
BENEFITS = [
benefit for benefit in BENEFITS if benefit != "housing_assistance"
]
previous_benefits = add(household, period, BENEFITS)
middle_class_credit = add(
household, period, ["boost_middle_class_tax_credit"]
)
p = parameters(
period
).gov.contrib.congress.tlaib.boost.middle_class_tax_credit
if p.administered_through_ssa is False:
return previous_benefits
return middle_class_credit + previous_benefits

class spm_unit_benefits(Variable):
value_type = float
entity = SPMUnit
label = "Benefits"
definition_period = YEAR
unit = USD

def formula(spm_unit, period, parameters):
BENEFITS = [
"social_security",
"ssi",
"ma_state_supplement", # Massachusetts benefits
# California programs.
"ca_cvrp", # California Clean Vehicle Rebate Project.
# Colorado programs.
"co_ccap_subsidy",
"co_state_supplement",
"co_oap",
"snap",
"wic",
"free_school_meals",
"reduced_price_school_meals",
"child_support_received",
"workers_compensation",
"educational_assistance",
"financial_assistance",
"survivor_benefits",
# Broadband subsidies.
"acp",
"ebb",
"spm_unit_energy_subsidy",
"tanf",
"high_efficiency_electric_home_rebate",
"residential_efficiency_electrification_rebate",
"total_unemployment_compensation",
# Contributed.
"basic_income",
"trump_dividend",
# Cash programs that household_benefits also counts.
"ca_capi", # California Cash Assistance Program for Immigrants.
"ca_la_expectant_parent_payment", # Los Angeles County.
"ca_la_infant_supplement", # Los Angeles County.
"co_denver_property_tax_relief", # Denver.
"ma_eaedc", # Massachusetts.
"ak_energy_relief",
"nj_property_tax_relief", # ANCHOR, Senior Freeze and Stay NJ.
"ny_drive_clean_rebate",
]
if parameters(period).gov.contrib.ubi_center.flat_tax.deduct_ptc:
BENEFITS.append("aca_ptc")
if not parameters(period).gov.hud.abolition:
BENEFITS.append("spm_unit_capped_housing_subsidy")
def formula(tax_unit, period, parameters):
p = parameters(
period
).gov.contrib.congress.tlaib.boost.middle_class_tax_credit
middle_class_tax_credit = add(
spm_unit, period, ["boost_middle_class_tax_credit"]
)
previous_benefits = add(spm_unit, period, BENEFITS)
if p.administered_through_ssa is False:
return previous_benefits
return add(spm_unit, period, BENEFITS) + middle_class_tax_credit
credit = tax_unit("boost_middle_class_tax_credit", period)
return credit * p.administered_through_ssa

def modify_parameters(parameters):
# Paid through SSA, the credit is a benefit in both income totals;
# otherwise income_tax_refundable_credits counts it.
household = parameters.gov.household
paid_through_ssa = ["boost_middle_class_tax_credit_paid_through_ssa"]
add_to_list_parameter(household.household_benefits, paid_through_ssa)
add_to_list_parameter(household.spm_unit_benefits, paid_through_ssa)
return parameters

class reform(Reform):
def apply(self):
self.update_variable(boost_middle_class_tax_credit)
self.update_variable(boost_middle_class_tax_credit_paid_through_ssa)
self.update_variable(income_tax_refundable_credits)
self.update_variable(household_benefits)
self.update_variable(spm_unit_benefits)
self.modify_parameters(modify_parameters)

return reform

Expand Down
Loading
Loading