From d95c4d7377fc30b5160593f1bd80a3a9f34e7614 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 19 Feb 2026 11:34:09 -0500 Subject: [PATCH] Add TANF takeup assignment to CPS data pipeline The TANF takeup rate was added to SIMPLE_TAKEUP_VARS (for calibration) but not to add_takeup() in cps.py (for data persistence). This meant takes_up_tanf_if_eligible defaulted to True (100%) in the dataset. Co-Authored-By: Claude Opus 4.6 --- changelog_entry.yaml | 4 ++++ policyengine_us_data/datasets/cps/cps.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..6688a7949 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Add TANF takeup (22%) assignment to CPS data pipeline so takes_up_tanf_if_eligible is persisted in the dataset. diff --git a/policyengine_us_data/datasets/cps/cps.py b/policyengine_us_data/datasets/cps/cps.py index 4a5fa36db..76e55d4ac 100644 --- a/policyengine_us_data/datasets/cps/cps.py +++ b/policyengine_us_data/datasets/cps/cps.py @@ -268,6 +268,11 @@ def add_takeup(self): rng = seeded_rng("takes_up_ssi_if_eligible") data["takes_up_ssi_if_eligible"] = rng.random(n_persons) < ssi_rate + # TANF + tanf_rate = load_take_up_rate("tanf", self.time_period) + rng = seeded_rng("takes_up_tanf_if_eligible") + data["takes_up_tanf_if_eligible"] = rng.random(n_spm_units) < tanf_rate + # WIC: resolve draws to bools using category-specific rates wic_categories = baseline.calculate("wic_category_str").values wic_takeup_rates = load_take_up_rate("wic_takeup", self.time_period)