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/fix-county-lookup-guards.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop the Vermont renter credit, Minnesota CCAP provider rate, Wisconsin Shares maximum rates and Maryland CCS payment rate from crashing simulations that include households outside the state, households with an unknown county, or (Vermont) tax units larger than eight people, which now use the eight-person income limits and fair market rent as the Department of Taxes calculator does.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: Vermont applies the renter credit income limits and fair market rents for this household size to larger households.
# The income limit and fair market rent tables run through family size 8. The
# Department of Taxes' renter credit calculators (Calculator sheet, cells
# G11-G12) look up IF(Household_Size>8,8,Household_Size) in the income limit
# tables and accept family sizes 1 through 10. Their credit amount lookup (cell
# G13) caps the size at 4, which the fair market rent table already reflects by
# repeating the 4-person value through size 8.
values:
2021-01-01: 8
metadata:
unit: person
period: year
label: Vermont renter credit maximum household size
reference:
- title: 2025 Renter Credit Website Calculator (Calculator sheet, cells G11-G13)
href: https://tax.vermont.gov/sites/tax/files/documents/2025%20Renter%20Credit%20Website%20Calculator.xlsx
- title: 2024 Renter Credit Website Calculator (Calculator sheet, cells G11-G13)
href: https://tax.vermont.gov/sites/tax/files/documents/2024%20Renter%20Credit%20Website%20Calculator.xlsx
- title: 2023 Renter Credit Website Calculator (Calculator sheet, cells G11-G13)
href: https://web.archive.org/web/20250526044955/https://tax.vermont.gov/sites/tax/files/documents/2023%20Renter%20Credit%20Website%20Calculator_1.xlsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,77 @@
# Negative hours -> 0 units from the bracket -> select default UNIT_1.
# Region X, Center, REGULAR (age 5), UNIT_3 base $381/week x 1/3 = $127/week
md_ccs_payment_rate: [0, 127]

- name: Informal provider, unknown-county and out-of-state households in one simulation with a Montgomery County household.
# defined_for masks the output but the formula still runs over every
# household in the simulation. Before the UNKNOWN guard, the Maryland
# household with an UNKNOWN county reached the county-keyed informal rate
# table and raised ParameterNotFoundError.
period: 2026-01
absolute_error_margin: 0.1
input:
people:
person1:
age: 30
employment_income: 40_000
is_tax_unit_head_or_spouse: true
person2:
age: 3
is_tax_unit_dependent: true
immigration_status: CITIZEN
childcare_hours_per_day: 2
md_ccs_provider_type: INFORMAL
person3:
age: 30
employment_income: 40_000
is_tax_unit_head_or_spouse: true
person4:
age: 3
is_tax_unit_dependent: true
immigration_status: CITIZEN
childcare_hours_per_day: 2
md_ccs_provider_type: INFORMAL
person5:
age: 30
employment_income: 40_000
is_tax_unit_head_or_spouse: true
person6:
age: 3
is_tax_unit_dependent: true
immigration_status: CITIZEN
childcare_hours_per_day: 2
md_ccs_provider_type: INFORMAL
tax_units:
tax_unit1:
members: [person1, person2]
tax_unit2:
members: [person3, person4]
tax_unit3:
members: [person5, person6]
spm_units:
spm_unit1:
members: [person1, person2]
spm_unit2:
members: [person3, person4]
spm_unit3:
members: [person5, person6]
households:
household1:
members: [person1, person2]
state_code: MD
county: MONTGOMERY_COUNTY_MD
household2:
members: [person3, person4]
state_code: MD
county: UNKNOWN
household3:
members: [person5, person6]
state_code: VA
county: FAIRFAX_COUNTY_VA
output:
# person2: informal, Montgomery, REGULAR (age 3), UNIT_1 (2 hours):
# $177 / 3 = $59/week.
# person4: UNKNOWN county falls back to Allegany, informal REGULAR
# UNIT_1: $83 / 3 = $27.67/week.
# person6: Virginia; defined_for zeroes the result.
md_ccs_payment_rate: [0, 59, 0, 27.67, 0, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,44 @@
county: MILWAUKEE_COUNTY_WI
output:
mn_ccap_provider_rate: 0

- name: Case 13, unknown-county and out-of-state households in one simulation with a Becker County household.
# defined_for masks the output but the formula still runs over every
# household in the simulation. Before the UNKNOWN guard, the Minnesota
# household with an UNKNOWN county reached the county-keyed rate tables and
# raised ParameterNotFoundError.
period: 2026-01
absolute_error_margin: 0.01
input:
people:
person1:
age: 0
childcare_hours_per_week: 45
mn_ccap_provider_type: FAMILY_CHILD_CARE
person2:
age: 0
childcare_hours_per_week: 45
mn_ccap_provider_type: FAMILY_CHILD_CARE
person3:
age: 0
childcare_hours_per_week: 45
mn_ccap_provider_type: FAMILY_CHILD_CARE
households:
household1:
members: [person1]
state_code: MN
county: BECKER_COUNTY_MN
household2:
members: [person2]
state_code: MN
county: UNKNOWN
household3:
members: [person3]
state_code: WI
county: MILWAUKEE_COUNTY_WI
output:
# person1: Becker family infant weekly 205 -> 205 * 52 / 12 = 888.33.
# person2: UNKNOWN county falls back to Hennepin, family infant weekly
# 250 -> 250 * 52 / 12 = 1,083.33.
# person3: Wisconsin; defined_for zeroes the result.
mn_ccap_provider_rate: [888.33, 1_083.33, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,134 @@
state_code: VT
output:
vt_renter_credit: 1_692

- name: test 11, out-of-state and unknown-county households in one simulation with a Chittenden County household.
# defined_for masks the output but the formula still runs over every
# household in the simulation. Before the county guard, the New Hampshire
# county and the UNKNOWN county reached the Vermont county-keyed tables and
# raised ParameterNotFoundError.
period: 2025
input:
people:
person1:
age: 40
person2:
age: 40
person3:
age: 40
tax_units:
tax_unit1:
members: [person1]
tax_unit_size: 2
vt_renter_credit_income: 49_370
rent_is_shared_with_another_tax_unit: false
tax_unit2:
members: [person2]
tax_unit_size: 2
vt_renter_credit_income: 49_370
rent_is_shared_with_another_tax_unit: false
tax_unit3:
members: [person3]
tax_unit_size: 2
vt_renter_credit_income: 44_145
rent_is_shared_with_another_tax_unit: false
spm_units:
spm_unit1:
members: [person1]
housing_assistance: 0
spm_unit2:
members: [person2]
housing_assistance: 0
spm_unit3:
members: [person3]
housing_assistance: 0
households:
household1:
members: [person1]
state_code: VT
county: CHITTENDEN_COUNTY_VT
household2:
members: [person2]
state_code: NH
county: GRAFTON_COUNTY_NH
household3:
members: [person3]
state_code: VT
county: UNKNOWN
output:
# tax_unit1: Chittenden 2025, size 2: full credit limit 31,200, partial
# credit limit 67,540, fair market rent 1,936.
# (67,540 - 49,370) / (67,540 - 31,200) = 0.5;
# 0.5 * 1,936 * 12 * 0.1 = 1,161.6 -> 1,162.
# tax_unit2: New Hampshire; defined_for zeroes the result.
# tax_unit3: UNKNOWN county falls back to Addison 2025, size 2: limits
# 27,900 and 60,390, fair market rent 1,410.
# (60,390 - 44,145) / (60,390 - 27,900) = 0.5;
# 0.5 * 1,410 * 12 * 0.1 = 846. (Chittenden would give 1,496.)
# The Department of Taxes 2025 Renter Credit Website Calculator gives
# 1,162 (Chittenden) and 846 (Addison) for these inputs.
vt_renter_credit: [1_162, 0, 846]

- name: test 12, tax units of nine or more use the eight-person income limits and fair market rent.
# The income limit and fair market rent tables run through family size 8.
# The Department of Taxes renter credit calculator looks up
# IF(Household_Size>8,8,Household_Size), so larger households use the
# 8-person values. Before the size cap, sizes 9 and 12 raised
# ParameterNotFoundError even with only Vermont households.
period: 2025
input:
people:
person1:
age: 40
person2:
age: 40
person3:
age: 40
tax_units:
tax_unit1:
members: [person1]
tax_unit_size: 8
vt_renter_credit_income: 82_780
rent_is_shared_with_another_tax_unit: false
tax_unit2:
members: [person2]
tax_unit_size: 9
vt_renter_credit_income: 82_780
rent_is_shared_with_another_tax_unit: false
tax_unit3:
members: [person3]
tax_unit_size: 12
vt_renter_credit_income: 82_780
rent_is_shared_with_another_tax_unit: false
spm_units:
spm_unit1:
members: [person1]
housing_assistance: 0
spm_unit2:
members: [person2]
housing_assistance: 0
spm_unit3:
members: [person3]
housing_assistance: 0
households:
household1:
members: [person1]
state_code: VT
county: CHITTENDEN_COUNTY_VT
household2:
members: [person2]
state_code: VT
county: CHITTENDEN_COUNTY_VT
household3:
members: [person3]
state_code: VT
county: CHITTENDEN_COUNTY_VT
output:
# Chittenden 2025, size 8: full credit limit 54,150, partial credit limit
# 111,410, fair market rent 2,083.
# (111,410 - 82,780) / (111,410 - 54,150) = 0.5;
# 0.5 * 2,083 * 12 * 0.1 = 1,249.8 -> 1,250 for all three tax units.
# (The 7-person limits, 48,650 and 104,650, would give 976.)
# The Department of Taxes 2025 Renter Credit Website Calculator gives
# 1,250 for family sizes 8, 9 and 10 (its maximum input) and 976 for 7.
vt_renter_credit: [1_250, 1_250, 1_250]
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,44 @@
output:
# defined_for wi_shares_eligible_child zeroes the rate.
wi_shares_hourly_max_rate: 0

- name: Case 9, unknown-county and out-of-state households in one simulation with a Milwaukee County household.
# defined_for masks the output but the formula still runs over every
# household in the simulation. Before the UNKNOWN guard, the Wisconsin
# household with an UNKNOWN county reached the county-keyed rate tables and
# raised ParameterNotFoundError.
period: 2027-01
absolute_error_margin: 0.01
input:
people:
person1:
age: 3
childcare_hours_per_week: 20
wi_shares_provider_type: LICENSED_GROUP
person2:
age: 3
childcare_hours_per_week: 20
wi_shares_provider_type: LICENSED_GROUP
person3:
age: 3
childcare_hours_per_week: 20
wi_shares_provider_type: LICENSED_GROUP
households:
household1:
members: [person1]
state_code: WI
county: MILWAUKEE_COUNTY_WI
household2:
members: [person2]
state_code: WI
county: UNKNOWN
household3:
members: [person3]
state_code: MN
county: HENNEPIN_COUNTY_MN
output:
# person1: Milwaukee licensed group, ages 2-3: 9.72.
# person2: UNKNOWN county falls back to Adams licensed group, ages 2-3:
# 8.75.
# person3: Minnesota; defined_for zeroes the result.
wi_shares_hourly_max_rate: [9.72, 8.75, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,45 @@
# Licensed family hourly 8.15 x 131 part-time monthly hours = 1,067.65,
# not the certified hourly (7.34) x 131.
wi_shares_monthly_max_rate: 1_067.65

- name: Case 6, unknown-county and out-of-state households in one simulation with a Milwaukee County household.
# defined_for masks the output but the formula still runs over every
# household in the simulation. Before the UNKNOWN guard, the Wisconsin
# household with an UNKNOWN county reached the county-keyed rate tables and
# raised ParameterNotFoundError.
period: 2027-01
absolute_error_margin: 0.01
input:
people:
person1:
age: 3
childcare_hours_per_week: 15
wi_shares_provider_type: LICENSED_GROUP
person2:
age: 3
childcare_hours_per_week: 15
wi_shares_provider_type: LICENSED_GROUP
person3:
age: 3
childcare_hours_per_week: 15
wi_shares_provider_type: LICENSED_GROUP
households:
household1:
members: [person1]
state_code: WI
county: MILWAUKEE_COUNTY_WI
household2:
members: [person2]
state_code: WI
county: UNKNOWN
household3:
members: [person3]
state_code: MN
county: HENNEPIN_COUNTY_MN
output:
# person1: Milwaukee licensed group hourly 9.72 x 131 part-time monthly
# hours = 1,273.32.
# person2: UNKNOWN county falls back to Adams licensed group hourly 8.75
# x 131 = 1,146.25.
# person3: Minnesota; defined_for zeroes the result.
wi_shares_monthly_max_rate: [1_273.32, 1_146.25, 0]
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ def formula(person, period, parameters):
center_rate = p.formal.licensed_center[region][age_group] * unit_share
family_rate = p.formal.licensed_family[region][age_group] * unit_share

# defined_for does not short-circuit vectorized execution, so
# non-Maryland counties are masked before indexing the county-keyed
# informal rate table. The table has no UNKNOWN key either, so a
# Maryland household with an unknown county also falls back to
# Allegany.
county = person.household("county_str", period)
in_md = person.household("state_code_str", period) == "MD"
safe_county = where(in_md, county, "ALLEGANY_COUNTY_MD")
safe_county = where(in_md & (county != "UNKNOWN"), county, "ALLEGANY_COUNTY_MD")
informal_rate = p.informal.rates[safe_county][age_group] * unit_share

return select(
Expand Down
Loading
Loading