-
Notifications
You must be signed in to change notification settings - Fork 205
Description
Summary
Texas Child Care Services (TX CCS) has 3 pre-existing bugs that prevent it from running in microsimulation. These only affect microsim (vectorized) — the API/JSON path (single-household, scalar) works fine.
Discovered while attempting to wire tx_ccs into the new child_care_subsidies federal aggregator (PR #7765).
Bug 1: Entity broadcast mismatch in tx_ccs_work_requirement_eligible
File: policyengine_us/variables/gov/states/tx/twc/ccs/eligibility/tx_ccs_work_requirement_eligible.py
Line 37: parent_meets_requirement = is_exempt | household_meets_work_requirement
is_exemptis Person-level (fromspm_unit.memberson line 17-19)household_meets_work_requirementis SPMUnit-level (fromspm_unit.sum()on line 25, then comparison on line 36)- In microsim:
(101384,) | (43134,)→ValueError: operands could not be broadcast together
Fix options:
Option A — use spm_unit.project():
household_meets_work_requirement = spm_unit.project(total_work_hours >= requirement)
parent_meets_requirement = is_exempt | household_meets_work_requirementOption B — simplify to pure SPMUnit logic (equivalent):
household_meets = total_work_hours >= requirement
all_parents_exempt = spm_unit.sum(is_head_or_spouse & ~is_exempt) == 0
return household_meets | all_parents_exemptBug 2: Missing historical copay data
File: policyengine_us/parameters/gov/states/tx/twc/ccs/copay/rate/first_child.yaml
The bracket parameter only has values from 2024-10-01. When microsim calculates months before October 2024 (e.g., January 2024), fc.thresholds[0] returns IndexError: list index out of range because no brackets exist for that period.
Fix: Add historical bracket data for prior years.
Bug 3: Missing region parameter data
File: policyengine_us/parameters/gov/states/tx/twc/ccs/region/
The workforce board region parameter is not found for 2024-01-01:
ParameterNotFoundError: The parameter 'gov.states.tx.twc.ccs.region[panhandle]' was not found in the 2024-01-01 tax and benefit system.
Fix: Add historical region parameter data.
Why these weren't caught
TX CCS was never wired into any aggregator or microsim-tested variable chain. The microsim test only calculates household_net_income and decile variables — programs outside that dependency chain are never exercised in microsim.
Impact
- API/JSON (single household): No impact — scalar values broadcast correctly
- Microsimulation: TX CCS cannot be included in the
child_care_subsidiesaggregator until all 3 bugs are fixed
Acceptance Criteria
- Entity broadcast fix in
tx_ccs_work_requirement_eligible.py - Historical copay bracket data added to
first_child.yaml - Historical region parameter data added
-
tx_ccswired intoSTATE_CHILD_CARE_SUBSIDY_VARIABLESinchild_care_subsidies.py - Microsimulation passes with TX CCS included