Skip to content

Conversation

@mdhaber
Copy link
Owner

@mdhaber mdhaber commented Apr 4, 2025

Willl close gh-28

Turns out there are some tests that currently depend on __bool__ and __index__ to be defined for masked values. For instance, that xp.all([]) is True makes sense in some applications, and this sort of logic is relied on in some tests. Note that mxp.all(mxp.asarray([])) currently returns a masked True, as it does when all elements of the argument are masked. With the current behavior, this evaluates to True when forced to be boolean, consistent with xp.all([]), but now it raises. Perhaps all on an empty array should return a non-masked True?

I'll have to a take a closer look at the tests to see if we really rely on this behavior or if tests just need to be refactored.

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.

bool(x == x) when x is masked?

2 participants