Split Enhanced CPS CTC calibration targets across national and unified paths#711
Split Enhanced CPS CTC calibration targets across national and unified paths#711
Conversation
baogorek
left a comment
There was a problem hiding this comment.
The title says "legacy," but since this PR is already tackling some files used only by local area calibration, it might be worth it to just go all in and attempt to fix CTC in both spots. You can remind the robot that this is how we build the X matrix for the local area calibration:
python -m policyengine_us_data.calibration.unified_calibration \
--build-only
At the very least, make database must pass:
● make database fails at the etl_irs_soi.py step with:
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) Invalid period value for targets
[parameters: ('tax_unit_count', 2021, 10356, 0, 37086500.0, ...)]
The DB's field_valid_values trigger rejects period=2021 because only 2022-2025 are registered as valid periods. So
CI will fail on any workflow that runs make database.
If that didn't fail during the PR build, if you could please check on why, I'd appreciate it.
I also requested some light documentation on ORG.
|
Addressed the main review blocker on this branch:
On the CI question: the PR workflow currently gates The unified/local path piece is already on this branch via the |
|
Addressed the review items from Ben:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closes #709.
This branch fixes the legacy national Enhanced CPS CTC calibration path so the refundable and non-refundable components are calibrated and validated separately.
What changed:
Tests:
uv run pytest tests/unit/test_etl_irs_soi_overlay.py tests/unit/calibration/test_loss_targets.py tests/unit/calibration/test_validate_national_h5.py tests/unit/calibration/test_check_staging_sums.pyuv run ruff check policyengine_us_data/db/etl_irs_soi.py policyengine_us_data/utils/loss.py policyengine_us_data/calibration/validate_national_h5.py policyengine_us_data/calibration/check_staging_sums.py tests/unit/test_etl_irs_soi_overlay.py tests/unit/calibration/test_loss_targets.py tests/unit/calibration/test_validate_national_h5.py tests/unit/calibration/test_check_staging_sums.py