PolicyEngine / PolicyEngine/policyengine-us

Replace `np.any` calls with `aggr`/`add`

Open
#598 0 comments 0 reactions 0 assignees View on GitHub
code-health
Dominant language
Python
Stars
162
Forks
212
Avg merge
3d 3h
Merged PRs (30d)
97

Description

For example, this:
https://github.com/PolicyEngine/openfisca-us/blob/2605343194d36cc319aa52511c797c927cb759b3/openfisca_us/variables/fcc/acp/is_acp_eligible.py#L13-L21

can be replaced with
```python
def formula(spm_unit, period, parameters):
fcc = parameters(period).fcc
categorically_eligible = aggr(spm_unit, period, fcc.acp.categorical_eligibility)
```
`np.any` is called similarly in a few places where this pattern could simplify the code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.