Repository navigation
Correct the policyengine.py household-impact diagnosis page (#1628) - #1729
Merged
vahid-ahmadi merged 6 commits intoOct 24, 2026
Merged
Conversation
vahid-ahmadi
force-pushed
the
vahid-ahmadi/issue-1628-household-impact-tests-diagnosis
branch
from
October 8, 2026 14:51
86b3b80 to
5f34909
Compare
#1628 reported that two policyengine.py household-impact integration tests started asserting 0.0 for expected-positive tax / child-benefit values after bumping to policyengine-uk==2.88.0. Reproducing the same scenarios directly against policyengine-uk shows the model is healthy: a £50k single adult correctly returns £7,486 income tax, and a couple with one child correctly returns £1,354.60 child benefit at 2025 rates. The figures are stable across 2022-2025. So the regression is upstream in policyengine.py's test harness, not a model bug. Most likely cause: the harness depending on the model's default_input_period (2025) vs the year encoded in the test fixture, or being broken by the default-dataset env var requirement introduced since the previous 2.74 pin. Persist the diagnosis as a docs page so the next reviewer of #1628 gets a one-stop explanation. Guidance for the upstream fix: - pass explicit period= to every calculate() call, - use Microsimulation(situation=...) for single-household queries (no dataset needed), - assert against the fixture-encoded year rather than the model's default. Cross-links to mp30k-uk-switch-plan.md which documents the env-var contract this issue collides with.
…gelog fragment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default period was already 2025 at 2.74.0, so it did not change in that window; the dataset-required error arrived in 2.76.0. Note that policyengine.py now tests with explicit years in TestUKCalculateHousehold, and remove em dashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vahid-ahmadi
force-pushed
the
vahid-ahmadi/issue-1628-household-impact-tests-diagnosis
branch
from
October 12, 2026 09:05
5f34909 to
ad466f5
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main already carries this page (#2386) and released its changelog line in 2.143.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page reached main through #2386 and its changelog line shipped in 2.143.0, so this drops the released .added fragment and corrects main's copy. The page blamed the 2.76.0 dataset-required change and the default period; the harness at policyengine.py#280's head passed an explicit dataset and period, and its tests built 2026 households. The actual cause, per policyengine-core#475 and core's 3.24.4 changelog, was core 3.24.0 to 3.24.3 wiping set_input values on apply_reform; #280 raised the core floor to 3.24.1 alongside the UK bump, and policyengine.py#283 moved it to 3.25.0. - Cut the guidance and "why documented here" sections, which rested on the wrong diagnosis and cited a repo rule that does not exist. - policyengine.py now pins policyengine-uk 2.132.6 and its eight TestUKCalculateHousehold cases pass on main CI (run 39822499276). - Re-ran the page's code on 2.148.2: 7486.0 and 1354.60, non-zero for 2022 to 2025. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
UK hub (Claude build session, for Max) Head: Read this first. The page is already on main, word for word, through #2386 ( This branch now:
Against main, the diff is the page and the fragment. Suggested title on landing: "Correct the policyengine.py household-impact diagnosis (#1628)". Claims checked
Corrections: 9. Uncertain
Follow-up for the hub#1628 is still open. Its closing condition is met, and it can be closed with a link to core#475 and policyengine.py#283. I haven't closed it. Full ledger: |
3 of 5 tasks
vahid-ahmadi
deleted the
vahid-ahmadi/issue-1628-household-impact-tests-diagnosis
branch
October 24, 2026 09:53
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.
Corrects the policyengine.py household-impact diagnosis page (
docs/book/validation/policyengine-py-household-impact.md), written for #1628.The page itself is already on main: it shipped in #2386 (merged 21 October 2026), and its original
.addedchangelog entry was released in 2.143.0. This branch has merged main, dropped the released fragment and now carries only corrections to main's copy of the page.What this PR corrects (from its changelog fragment):
The claim-by-claim review behind these corrections, with sources, is in the "Ready for hub review" comment on this PR.
The corrected page notes that the closing condition for #1628 is now met (policyengine.py's UK household-impact tests pass on its main CI); the issue itself is left for its author to close.
changelog.d/1628-household-impact-diagnosis.changed.md(changed).🤖 Generated with Claude Code