Stop income imputation scaling housing costs#375
Draft
Conversation
Collaborator
|
Hi @MaxGhenis — this looks like a duplicate of #372 (opened 2026-04-20), which fixes the same rent/mortgage rescaling in policyengine_uk_data/datasets/imputations/income.py. The branch prefix here (codex/) suggests Codex didn't have visibility into the open-PR list — was that the case? If you're happy to consolidate, I'd suggest closing this in favour of #372 — that PR is tied to the root-cause issue #367 (with the full element-by-element audit), and its regression test injects a ×100 dividend multiplier so the original 2.5× bug couldn't slip back in. I can pull your changelog.d/375.md and the additional behaviour test from here into #372 so nothing's lost. |
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
Rationale
Housing costs should come from the housing data path, calibration, and uprating logic. SPI income imputation changes person income components; it should not mechanically multiply household rent or mortgage costs as a side effect.
Tests
uv run pytest policyengine_uk_data/tests/test_income_imputation_housing_costs.py policyengine_uk_data/tests/test_frs_only_imputation.py policyengine_uk_data/tests/test_housing_targets.py -quv run ruff check policyengine_uk_data/datasets/imputations/income.py policyengine_uk_data/tests/test_income_imputation_housing_costs.py