Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Use HBAI population groups for UK poverty breakdowns; stop requesting the deprecated is_child/is_adult

Open
#537 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend, data

Research direction

Start with src/policyengine/tax_benefit_models/uk/model.py and uk/household.py, then inspect src/policyengine/outputs/poverty.py and cliff_impact.py. Confirm the policyengine-uk pin includes the HBAI variables, and run the existing snapshot and poverty tests before changing the UK output keys. Done means deprecated UK variables are no longer read, HBAI groups reproduce the enhanced FRS split, and snapshots, poverty tests, executor keys, and labels are consistent.

Written by the indexing model from the issue text.

Description

Why

PolicyEngine/policyengine-uk#1896 replaces the generic is_child (age < 18) and is_adult (age >= 18) flags inside the UK model with each programme's legal definition, and adds explicit HBAI (Households Below Average Income) variables for statistics. UK law has no single definition of a child: Child Benefit, Universal Credit, tax credits, Pension Credit, the legacy benefits and student support each define their own, and HBAI defines a dependent child as under 16, or 16-19, unpartnered, living with parents and in full-time non-advanced education or unwaged government training.

is_child, is_adult, family_type and the other generic variables stay in policyengine-uk as deprecated shims with their old age-18 formulas, so nothing breaks. This issue moves policyengine.py onto the explicit variables once its policyengine-uk pin moves past the release containing that PR.

Changes

  1. src/policyengine/tax_benefit_models/uk/model.py: drop is_adult and is_child from the UK person output columns (lines ~63-65) and add hbai_person_type (enum: CHILD, WORKING_AGE_ADULT, PENSIONER) or is_hbai_dependent_child. Replace the benunit family_type column (line ~94; deprecated, age-18 split) with relation_type (claimant has a partner) if a family column is still wanted. Update uk/household.py accordingly and regenerate the UK household snapshot fixtures.
  2. src/policyengine/outputs/poverty.py: UK poverty by group should use the HBAI population groups, not the age bands in AGE_GROUPS (child <= 17, adult 18-64, senior 65+). HBAI groups: dependent children, working-age adults (below State Pension age) and pensioners (at or above State Pension age), i.e. hbai_person_type. Keep age bands where an age band is meant, but label them as age bands (for example aged_0_to_17, aged_18_to_64, aged_65_and_over), and keep the US groups separate from the UK ones. The api-v2 simulation executor and the app's "Children / Working-age adults / Seniors" labels read these groups: coordinate the key change (for the UK, "Seniors" should read "Pensioners").
  3. src/policyengine/outputs/cliff_impact.py: the cliff-share denominator sums is_adult. Make it an explicit per-country predicate (for the UK, people aged 18 or over via age, or is_hbai_adult if the intended population is HBAI adults) and document it; the numerator currently counts everyone.

Acceptance

  • No policyengine.py code reads a deprecated UK variable (is_child, is_adult, num_children, num_adults, family_type, child_index, adult_index excepted).
  • UK poverty-by-group outputs reproduce HBAI's population split on the enhanced FRS.
  • Snapshot and poverty tests updated.

🤖 Generated with Claude Code

Dominant language
Python
Stars
8
Forks
9
Avg merge
15h 28m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/policyengine.py

All issues in PolicyEngine/policyengine.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.