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/980.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Align Stage 1 Medicaid validation with 2025 Medicaid enrollment targets.
9 changes: 5 additions & 4 deletions policyengine_us_data/storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
• Date: 2024
• Location: https://www.medicaid.gov/resources-for-states/downloads/eligib-oper-and-enrol-snap-december2024.pdf#page=26

- **medicaid_enrollment_2025.csv**
• Source: Medicaid.gov performance indicator dataset, latest final-report month available in the March 2026 release
• Date: November 2025 final reports
• Location: https://data.medicaid.gov/dataset/State-Medicaid-and-CHIP-Applications-Eligibility-Deter/pi-dataset-march-2026release
- **medicaid_enrollment_2025.csv**
• Source: Medicaid.gov performance indicator dataset, updated December 2025 Applications, Eligibility, and Enrollment Data
• Date: December 2025 final reports, last updated April 24, 2026
• Location: https://data.medicaid.gov/dataset/6165f45b-ca93-5bb5-9d06-db29c692a360?conditions%5B0%5D%5Boperator%5D=%3D&conditions%5B0%5D%5Bproperty%5D=reporting_period&conditions%5B0%5D%5Bvalue%5D=202512&conditions%5B1%5D%5Boperator%5D=%3D&conditions%5B1%5D%5Bproperty%5D=preliminary_or_updated&conditions%5B1%5D%5Bvalue%5D=U
• Notes: Uses `total_medicaid_enrollment`, not combined Medicaid and CHIP enrollment.

- **district_mapping.csv**
• Source: created by the script `policyengine_us/storage/calibration_targets/make_district_mapping.py`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
state,enrollment
AK,199460
AL,752535
AR,723536
AZ,1579905
CA,11554412
CO,1046707
CT,882013
DC,242274
DE,227234
FL,3447907
GA,1698374
HI,364787
IA,585282
ID,293777
IL,2719408
IN,1431868
KS,333620
KY,1200890
LA,1274536
MA,1405793
MD,1209670
ME,314237
MI,2131207
MN,1158706
MO,1133140
MS,509631
MT,192806
NC,2527040
ND,100854
NE,299026
NH,159398
NJ,1514284
NM,640061
NV,679632
NY,5894332
OH,2508352
OK,913130
OR,1124039
PA,2732233
RI,263719
SC,875777
SD,122031
TN,1233717
TX,3776984
UT,298758
VA,1503054
VT,146362
WA,1722640
WI,1030040
WV,451904
WY,54143
AK,199113
AL,750744
AR,723941
AZ,1565458
CA,11498458
CO,1052954
CT,881656
DC,242180
DE,226467
FL,3431155
GA,1692481
HI,363466
IA,586048
ID,294104
IL,2700951
IN,1412073
KS,332430
KY,1194495
LA,1265315
MA,1396994
MD,1208676
ME,312572
MI,2132117
MN,1154038
MO,1131455
MS,509186
MT,193114
NC,2535205
ND,100706
NE,299325
NH,158237
NJ,1507882
NM,638988
NV,679311
NY,5887318
OH,2486762
OK,889045
OR,1123951
PA,2724282
RI,264836
SC,864722
SD,122091
TN,1226436
TX,3764587
UT,297414
VA,1495172
VT,145876
WA,1726702
WI,1029554
WV,450475
WY,54505
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ testpaths = [
markers = [
"integration: tests that exercise integration-level behavior or external runtime seams",
"slow: tests or validators that require substantial local runtime or built artifacts",
"verify_behavior_skip_temporarily: temporarily skipped while expected behavior is being verified",
]
filterwarnings = [
"ignore::SyntaxWarning:IPython.core.interactiveshell",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/calibration/test_loss_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_medicaid_targets_roll_forward_to_2025():

assert data_year == 2025
assert len(targets) == 51
assert int(targets["enrollment"].sum()) == 69_185_225
assert int(targets["enrollment"].sum()) == 68_925_023


def test_medicaid_targets_roll_forward_to_2026():
Expand All @@ -98,7 +98,7 @@ def test_medicaid_national_targets_use_2025_values():
spending, enrollment, data_year = _get_medicaid_national_targets(2025)

assert data_year == 2025
assert enrollment == 69_185_225
assert enrollment == 68_925_023
assert spending == pytest.approx(1_000_645_800_000.0001)


Expand Down
13 changes: 0 additions & 13 deletions validation/stage_1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@
collect_ignore_glob.append("test_no_formula_variables_stored.py")


def pytest_collection_modifyitems(config, items):
marker_name = "verify_behavior_skip_temporarily"
for item in items:
marker = item.get_closest_marker(marker_name)
if marker is None:
continue
reason = marker.kwargs.get(
"reason",
"Temporarily skipped while expected validation behavior is verified.",
)
item.add_marker(pytest.mark.skip(reason=reason))


@pytest.fixture(scope="session", autouse=True)
def refresh_policy_db_views():
db_path = STORAGE_FOLDER / "calibration" / "policy_data.db"
Expand Down
14 changes: 5 additions & 9 deletions validation/stage_1/test_enhanced_cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,27 +383,23 @@ def test_immigration_status_diversity():
print(f"Immigration status diversity test passed: {citizen_pct:.1f}% citizens")


@pytest.mark.verify_behavior_skip_temporarily(
reason=(
"Investigating whether comparing 2025 medicaid_enrolled against "
"2024 Medicaid enrollment targets is intentional."
)
)
def test_medicaid_calibration():
import pandas as pd
from pathlib import Path
from policyengine_us import Microsimulation
from policyengine_us_data.datasets.cps import EnhancedCPS_2024

TARGETS_PATH = Path(
"policyengine_us_data/storage/calibration_targets/medicaid_enrollment_2024.csv"
VALIDATION_PERIOD = 2025
target_file = f"medicaid_enrollment_{VALIDATION_PERIOD}.csv"
TARGETS_PATH = (
Path("policyengine_us_data/storage/calibration_targets") / target_file
)
targets = pd.read_csv(TARGETS_PATH)

sim = Microsimulation(dataset=EnhancedCPS_2024)
state_code_hh = sim.calculate("state_code", map_to="household").values
medicaid_enrolled = sim.calculate(
"medicaid_enrolled", map_to="household", period=2025
"medicaid_enrolled", map_to="household", period=VALIDATION_PERIOD
)

TOLERANCE = 0.45
Expand Down
8 changes: 5 additions & 3 deletions validation/stage_1/test_sparse_enhanced_cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,16 @@ def test_sparse_aca_calibration(sim):


def test_sparse_medicaid_calibration(sim):
TARGETS_PATH = Path(
"policyengine_us_data/storage/calibration_targets/medicaid_enrollment_2024.csv"
VALIDATION_PERIOD = 2025
target_file = f"medicaid_enrollment_{VALIDATION_PERIOD}.csv"
TARGETS_PATH = (
Path("policyengine_us_data/storage/calibration_targets") / target_file
)
targets = pd.read_csv(TARGETS_PATH)

state_code_hh = sim.calculate("state_code", map_to="household").values
medicaid_enrolled = sim.calculate(
"medicaid_enrolled", map_to="household", period=2025
"medicaid_enrolled", map_to="household", period=VALIDATION_PERIOD
)

TOLERANCE = 1.0
Expand Down