PolicyEngine / PolicyEngine/policyengine-uk
Refactor age-related variables
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 50
- Forks
- 33
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 14
Description
variables/demographic/person.py includes four age-related variables:
over_16:person("age", period) >= 16is_adult:person("age", period) >= 18is_child:person("age", period) < 18is_WA_adult:person("is_adult", period) * not_(person("is_SP_age", period))is_young_child:person("age", period.this_year) < 14age_under_18:person("age", period) < 18age_18_64:(age >= 18) & (age <= 64)age_over_64:person("age", period) > 64is_older_child:(person("age", period) >= 14) * (person("age", period) < 18)
One issue is that over_16 is inconsistently defined with over_64 (>= vs >). I think a couple of these can also use between().
But more generally, terms like young_child and even child can be ambiguous (sometimes a person under 18 isn't a child if they're not in a family). Can we remove or rename the variables that don't specify their criteria? We could also set a standard around only defining under_* and between_*_* to avoid redundancy. For example, all the above could be shrunk down to:
under_14between_15_17under_17under_18between_18_SPAbetween_18_64under_65
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in openfisca_uk/variables/demographic/person.py and review the listed age-related variables and their criteria. Compare the boundary definitions and naming options, then identify the consistent set of variables the project should retain or rename. Done means the age-variable scheme is agreed and the file reflects that decision without ambiguous or redundant definitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100