Remove inferred is_parent formula#1595
Merged
Merged
Conversation
MaxGhenis
added a commit
that referenced
this pull request
Apr 17, 2026
Catches silent model/data skew at the point the enhanced FRS dataset is republished on HuggingFace, not after a release. Exercises whatever is currently on HF `main` (unlike `conftest.py` which pins to an older version) and asserts plausibility bounds on: - UK weighted population and household/benunit counts - `is_parent` weighted population (>10M) — catches the defaulting-to- zero failure introduced by removing the inferred formula in #1595 - Universal credit aggregate in £55-£95bn range around the OBR target - state pension / child benefit / pension credit floors - `extended_childcare_entitlement_eligible` reaching >500k benefit units Verified against the 1.45.8 stale dataset: correctly fails 3 of 5 tests (is_parent=0, UC=£51.7bn, childcare=0), passes the other two. Marked `microsimulation` so it only runs in CI when HUGGING_FACE_TOKEN is set. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
MaxGhenis
added a commit
that referenced
this pull request
Apr 17, 2026
Catches silent model/data skew at the point the enhanced FRS dataset is republished on HuggingFace, not after a release. Exercises whatever is currently on HF `main` (unlike `conftest.py` which pins to an older version) and asserts plausibility bounds on: - UK weighted population and household/benunit counts - `is_parent` weighted population (>10M) — catches the defaulting-to- zero failure introduced by removing the inferred formula in #1595 - Universal credit aggregate in £55-£95bn range around the OBR target - state pension / child benefit / pension credit floors - `extended_childcare_entitlement_eligible` reaching >500k benefit units Verified against the 1.45.8 stale dataset: correctly fails 3 of 5 tests (is_parent=0, UC=£51.7bn, childcare=0), passes the other two. Marked `microsimulation` so it only runs in CI when HUGGING_FACE_TOKEN is set. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
is_parentformula that inferred parent status fromfamily_typeand household-leveladult_index.is_parentas an input/default-only variable withdefault_value = False, now thatpolicyengine-uk-dataassigns it from FRS microdata in Assign is_parent from FRS microdata policyengine-uk-data#343.uv.lockwithpyproject.toml.Closes #1031.
Validation
uv run --python 3.13 ruff check policyengine_uk/variables/household/demographic/is_parent.pyuv run --python 3.13 ruff format --check policyengine_uk/variables/household/demographic/is_parent.pyuv run --python 3.13 policyengine-core test policyengine_uk/tests/policy/baseline/household/demographic/is_parent.yaml -c policyengine_ukuv run --python 3.13 policyengine-core test policyengine_uk/tests/policy/baseline/gov/dfe/care_to_learn/care_to_learn_eligible.yaml policyengine_uk/tests/policy/baseline/gov/dfe/extended_childcare_entitlement/extended_childcare_entitlement_work_condition.yaml policyengine_uk/tests/policy/baseline/gov/hmrc/tax_free_childcare -c policyengine_uk