Update SPI ingestion to 2022-23#412
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spi_2020_21.zipto the existingspi_2022_23.zipprivate HF artifactdatasets/spi.pyput2223uk.tabincome.pklfiles are not silently reusedAGERANGE=-1and GORCODE values outside 1-12 without silently mapping them to Londonstorage/incomes_projection.csvfrom the 2022-23 SPI input and make the projection builder validate/rebuild stale SPI H5 files before useTESTING=1data-build sample to 10k so PR CI stays boundedContext
policyengine/policyengine-uk-data-privatealready containsspi_2022_23.zipandspi_2022_23.h5, but the income-imputation donor path still pointed atspi_2020_21/put2021uk.tab. I did not find an open issue specifically for that donor-file switch.Related open issues are about target vintages rather than this private prerequisite path:
This PR advances the current SPI microdata input to 2022-23 and regenerates the checked-in SPI income projections from that base. The remaining stale non-SPI private inputs are tracked separately in #411.
Validation
TESTING=1 uv run --python 3.13 pytest policyengine_uk_data/tests/test_income_projection.py policyengine_uk_data/tests/test_spi_build.py policyengine_uk_data/tests/test_frs_prerequisites.py -quv run --python 3.13 ruff format --check policyengine_uk_data/datasets/imputations/income.py policyengine_uk_data/utils/incomes_projection.py policyengine_uk_data/tests/test_spi_build.pygit diff --check