PolicyEngine / PolicyEngine/policyengine-uk
Replace + and * with | and & for logical operations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 50
- Forks
- 33
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 14
Description
e.g.:
This works because np.array(True) + np.array(True) = np.array(True), but outside of numpy, True + True = 2. pd.Series(True) + pd.Series(True) = pd.Series(True), but this throws a warning and asks to use | instead.
Replacing bool + bool with bool | bool and bool * bool with bool & bool throughout will clarify the code.
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 with openfisca_uk/variables/finance/benefit/benefit.py at line 133, then search the repository for similar uses of + and * in boolean expressions. Replace boolean addition and multiplication with the corresponding logical operators throughout, and confirm the existing project checks still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, pandas, python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100