Branch: codex/add-loss-py-targets-unified
Context
Legacy policyengine_us_data/utils/loss.py still contains calibration target families that were not selected by the newer unified calibration target set. We audited the legacy target families against policyengine_us_data/calibration/target_config.yaml and identified a narrow set that are distinct from existing unified targets, were not recently removed by Max Ghenis, and are not just slight variants of already-selected targets.
What this branch does
This branch ports the recommended target families into unified calibration:
- Adds SOI taxable AGI-grid income targets for:
irs_employment_income, mapped from SOI employment_income, matching the legacy loss.py concept.
pension_income, mapped from SOI total_pension_income.
social_security, mapped from SOI total_social_security.
- Selects existing IRS workbook target rows for:
- refundable American Opportunity Credit amount and claimant count.
- nonrefundable education tax credit amount and claimant count.
- Adds state EITC claimant-count targets from IRS EITC Central controls.
- Selects state SNAP household-count targets already loaded by SNAP ETL.
- Selects LIHEAP household-count targets already loaded by national target ETL.
- Adds and selects state ACS rent targets from
acs_housing_costs_YEAR.csv.
- Selects positive real-estate-tax itemizer count targets nationally and by state.
- Adds and selects Medicare Part B premium age-bucket targets from
healthcare_spending.csv.
Files touched
policyengine_us_data/calibration/target_config.yaml
policyengine_us_data/db/create_field_valid_values.py
policyengine_us_data/db/etl_irs_soi.py
policyengine_us_data/db/etl_national_targets.py
tests/unit/calibration/test_target_config.py
tests/unit/test_etl_irs_soi_overlay.py
tests/unit/test_etl_national_targets.py
Verification so far
Passed locally:
python3 -m py_compile policyengine_us_data/db/etl_irs_soi.py policyengine_us_data/db/etl_national_targets.py policyengine_us_data/db/create_field_valid_values.py tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.py
ruff check policyengine_us_data/db/etl_irs_soi.py policyengine_us_data/db/etl_national_targets.py tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.py
git diff --check
Blocked locally:
uv run pytest tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.py
The pytest command is blocked on this macOS x86_64 environment because the lock currently resolves torch==2.9.1, which has no wheel for this platform.
Branch:
codex/add-loss-py-targets-unifiedContext
Legacy
policyengine_us_data/utils/loss.pystill contains calibration target families that were not selected by the newer unified calibration target set. We audited the legacy target families againstpolicyengine_us_data/calibration/target_config.yamland identified a narrow set that are distinct from existing unified targets, were not recently removed by Max Ghenis, and are not just slight variants of already-selected targets.What this branch does
This branch ports the recommended target families into unified calibration:
irs_employment_income, mapped from SOIemployment_income, matching the legacyloss.pyconcept.pension_income, mapped from SOItotal_pension_income.social_security, mapped from SOItotal_social_security.acs_housing_costs_YEAR.csv.healthcare_spending.csv.Files touched
policyengine_us_data/calibration/target_config.yamlpolicyengine_us_data/db/create_field_valid_values.pypolicyengine_us_data/db/etl_irs_soi.pypolicyengine_us_data/db/etl_national_targets.pytests/unit/calibration/test_target_config.pytests/unit/test_etl_irs_soi_overlay.pytests/unit/test_etl_national_targets.pyVerification so far
Passed locally:
python3 -m py_compile policyengine_us_data/db/etl_irs_soi.py policyengine_us_data/db/etl_national_targets.py policyengine_us_data/db/create_field_valid_values.py tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.pyruff check policyengine_us_data/db/etl_irs_soi.py policyengine_us_data/db/etl_national_targets.py tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.pygit diff --checkBlocked locally:
uv run pytest tests/unit/test_etl_irs_soi_overlay.py tests/unit/test_etl_national_targets.py tests/unit/calibration/test_target_config.pyThe pytest command is blocked on this macOS x86_64 environment because the lock currently resolves
torch==2.9.1, which has no wheel for this platform.