Skip to content

Remove inferred is_parent formula#1595

Merged
MaxGhenis merged 1 commit into
mainfrom
remove-is-parent-formula
Apr 15, 2026
Merged

Remove inferred is_parent formula#1595
MaxGhenis merged 1 commit into
mainfrom
remove-is-parent-formula

Conversation

@MaxGhenis

Copy link
Copy Markdown
Collaborator

Summary

  • Remove the is_parent formula that inferred parent status from family_type and household-level adult_index.
  • Keep is_parent as an input/default-only variable with default_value = False, now that policyengine-uk-data assigns it from FRS microdata in Assign is_parent from FRS microdata policyengine-uk-data#343.
  • Add a focused policy test proving parent status is no longer inferred from family composition and can still be supplied as input.
  • Sync the editable package version in uv.lock with pyproject.toml.

Closes #1031.

Validation

  • uv run --python 3.13 ruff check policyengine_uk/variables/household/demographic/is_parent.py
  • uv run --python 3.13 ruff format --check policyengine_uk/variables/household/demographic/is_parent.py
  • uv run --python 3.13 policyengine-core test policyengine_uk/tests/policy/baseline/household/demographic/is_parent.yaml -c policyengine_uk
  • uv 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

@MaxGhenis MaxGhenis merged commit 275c500 into main Apr 15, 2026
2 checks passed
@MaxGhenis MaxGhenis deleted the remove-is-parent-formula branch April 15, 2026 14:04
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove is_parent formula

1 participant