Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Commit 56c3059

Browse files
baogorekclaude
andcommitted
Update test_xw_consistency for current calibration config
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0633a53 commit 56c3059

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

policyengine_us_data/tests/test_calibration/test_xw_consistency.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_xw_matches_stacked_sim():
4848
prepare_base_sim_data,
4949
)
5050
from policyengine_us_data.utils.takeup import (
51-
TAKEUP_AFFECTED_TARGETS,
51+
SIMPLE_TAKEUP_VARS,
5252
)
5353

5454
sim = Microsimulation(dataset=DATASET_PATH)
@@ -67,7 +67,6 @@ def test_xw_matches_stacked_sim():
6767

6868
target_filter = {
6969
"variables": [
70-
"aca_ptc",
7170
"snap",
7271
"household_count",
7372
"tax_unit_count",
@@ -77,18 +76,13 @@ def test_xw_matches_stacked_sim():
7776
geography=geography,
7877
sim=sim,
7978
target_filter=target_filter,
80-
hierarchical_domains=["aca_ptc", "snap"],
79+
hierarchical_domains=["snap"],
8180
rerandomize_takeup=True,
82-
county_level=True,
81+
county_level=False,
8382
workers=2,
8483
)
8584

86-
target_vars = set(target_filter["variables"])
87-
takeup_filter = [
88-
info["takeup_var"]
89-
for key, info in TAKEUP_AFFECTED_TARGETS.items()
90-
if key in target_vars
91-
]
85+
takeup_filter = [spec["variable"] for spec in SIMPLE_TAKEUP_VARS]
9286

9387
w = np.ones(n_total, dtype=np.float64)
9488
xw = X @ w
@@ -102,7 +96,7 @@ def test_xw_matches_stacked_sim():
10296
cd_weights[cd] = w[mask].sum()
10397
top_cds = sorted(cd_weights, key=cd_weights.get, reverse=True)[:N_CDS_TO_CHECK]
10498

105-
check_vars = ["aca_ptc", "snap"]
99+
check_vars = ["snap"]
106100
tmpdir = tempfile.mkdtemp()
107101
base_data = prepare_base_sim_data(Path(DATASET_PATH))
108102

0 commit comments

Comments
 (0)