Skip to content

[hail] Add two new forms to any all#9835

Merged
danking merged 8 commits intohail-is:mainfrom
danking:fix-any
Dec 22, 2020
Merged

[hail] Add two new forms to any all#9835
danking merged 8 commits intohail-is:mainfrom
danking:fix-any

Conversation

@danking
Copy link
Contributor

@danking danking commented Dec 17, 2020

CHANGELOG: hl.any and hl.all now also support a single collection argument and a varargs of Boolean expressions

Any and all currently take two arguments: a function and a collection. This
differs from the Python any and all which take only a collection and check
for truthy values.

We rectify this situation by supporting three forms:

  1. hl.all(boolean, ...), are all arguments True?
  2. hl.all(collection), are all elements of the collection True?
  3. hl.all(function, collection), does function return True for
    all values in this collection?

CHANGELOG: `hl.any` and `hl.all` now also support a single collection argument and a varargs of Boolean expressions

Any and all currently take two arguments: a function and a collection. This
differs from the Python `any` and `all` which take only a collection and check
for truthy values.

We rectify this situation by supporting three forms:

1. ``hl.all(boolean, ...)``, are all arguments ``True``?
2. ``hl.all(collection)``, are all elements of the collection ``True``?
3. ``hl.all(function, collection)``, does ``function`` return ``True`` for
    all values in this collection?
@danking
Copy link
Contributor Author

danking commented Dec 17, 2020

example of docs rendering on my laptop:

Screen Shot 2020-12-17 at 1 47 15 PM

Copy link
Contributor

@tpoterba tpoterba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good change, especially the checker refactor!

Daniel King added 2 commits December 21, 2020 19:38
@danking danking merged commit d858dff into hail-is:main Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants