PolicyEngine / openfisca-tools

Python tools for enhancing OpenFisca country packages.
1 stars 1 forks source link

Add `all_` #28

Open MaxGhenis opened 2 years ago

MaxGhenis commented 2 years ago

any_ is currently an alias for or_, but we don't have a parallel alias for all_ to and_:

https://github.com/PolicyEngine/openfisca-tools/blob/e2bc593b29f670f302f2c64b892a3df60b7cc30d/openfisca_tools/model_api.py#L177-L179

I think we should adopt a standard for OpenFisca programming to use only one of these patterns. Since we call these as a function, I'd suggest any_ and all_, which more closely resembles numpy and Python versions than and_ or or_.

That said, I'm indifferent on keeping or_ and and_ around. Python and numpy offer all four in some way, so maybe we could offer a warning that any_ and all_ are the standards and we suggest those instead, rather than breaking code? Open to suggestions here.