Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make find's default predicate be identity #23120

Closed
Keno opened this issue Aug 3, 2017 · 1 comment · Fixed by #23812
Closed

Make find's default predicate be identity #23120

Keno opened this issue Aug 3, 2017 · 1 comment · Fixed by #23812
Assignees
Labels
domain:collections Data structures holding multiple items, e.g. sets
Milestone

Comments

@Keno
Copy link
Member

Keno commented Aug 3, 2017

As discussed in #23005, the zeroness predicate is not uniquely defined. It seems odd to pick one for find. However, one really useful property of this is that it returns the true indices for boolean arrays, so you can do things like find(x .== 1), which we should preserve. I thus propose to make the default predicate be identity to retain the useful behavior for boolean arrays, but force the user to choose their predicate for numeric arrays.

@Keno Keno added this to the 1.0 milestone Aug 3, 2017
@kshyatt kshyatt added the domain:collections Data structures holding multiple items, e.g. sets label Aug 3, 2017
@nalimilan
Copy link
Member

+1

If we do that, then the Search & Find Julep should be updated to say "true values" rather than "non zeros" in a few places.

@JeffBezanson JeffBezanson self-assigned this Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:collections Data structures holding multiple items, e.g. sets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants