PolicyEngine / PolicyEngine/policyengine-uk
Simplify logic for `is_benunit_eldest_child` variable
Open
Nobody has claimed this yet.
code-health
- Dominant language
- Python
- Stars
- 50
- Forks
- 33
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 14
Description
See https://github.com/PSLmodels/openfisca-uk/pull/197#discussion_r702295052
Now here - I think we could do this without the child_index intermediate variable:
Might also be able to do it without this:
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 at lines 79-121, then compare openfisca_uk/variables/demographic/benunit.py at lines 106-115. Trace how is_benunit_eldest_child uses child_index and the other intermediate logic before deciding what can be removed. Done means the logic is simpler while preserving existing behavior and tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100