Use HBAI population groups for UK poverty breakdowns; stop requesting the deprecated is_child/is_adult
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
src/policyengine/tax_benefit_models/uk/model.py: dropis_adultandis_childfrom the UK person output columns (lines ~63-65) and addhbai_person_type(enum:CHILD,WORKING_AGE_ADULT,PENSIONER) oris_hbai_dependent_child. Replace the benunitfamily_typecolumn (line ~94; deprecated, age-18 split) withrelation_type(claimant has a partner) if a family column is still wanted. Updateuk/household.pyaccordingly and regenerate the UK household snapshot fixtures.src/policyengine/outputs/poverty.py: UK poverty by group should use the HBAI population groups, not the age bands inAGE_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 exampleaged_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").src/policyengine/outputs/cliff_impact.py: the cliff-share denominator sumsis_adult. Make it an explicit per-country predicate (for the UK, people aged 18 or over viaage, oris_hbai_adultif 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_indexexcepted). - UK poverty-by-group outputs reproduce HBAI's population split on the enhanced FRS.
- Snapshot and poverty tests updated.
🤖 Generated with Claude Code
- 主要语言
- Python
- 星标
- 8
- 派生
- 10
- 平均合并
- 21 小时 34 分钟
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PolicyEngine/policyengine.py 的其他 Issue
-
Raise the simulation cache memory warning to 16 GiB可能已有人在做 @anth-volk 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
PolicyEngine/policyengine.py#549 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
PolicyEngine/policyengine.py#473 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
PolicyEngine/policyengine.py#436 · 1 条评论 ·
维护者通常 1 天内回复
-
Certify populace-uk as the UK certified default可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
PolicyEngine/policyengine.py#408 ·
维护者通常 1 天内回复
-
UK replay gate: a data-limited inert measure blocks certification of every pe-uk release after #2241可能已有人在做 @MaxGhenis 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
PolicyEngine/policyengine.py#653 ·
维护者通常 1 天内回复
查看 PolicyEngine/policyengine.py 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
collective/icalendar#1968 · 1 条评论 ·
维护者通常 1 天内回复
-
Deferred from #1869: Complete the companion pytest guardrail update noted in the PR description...未关闭
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#140958 ·
维护者通常 1 天内回复
-
Bug triage/confirmed
难度 2/5 半天 新手友好度 85/100
agentscope-ai/agentscope#3355 ·
维护者通常 2 天内回复