Open
Description
sparse version checks
- I checked that this issue has not been reported before list of issues.
- I have confirmed this bug exists on the latest version of sparse.
- I have confirmed this bug exists on the main branch of sparse.
Describe the bug
The Array API specification states for unique_*
functions:
As nan values compare as False, nan values should be considered distinct.
In other words, it dictates behaviour equal to np.unique(..., equal_nan=False)
.
sparse.unique_*
functions however treat NaNs as equal.
Steps or code to reproduce the bug
>>> from math import nan
>>> import array_api_strict as xp
>>> xp.unique_values(xp.asarray([math.nan, math.nan]))
Array([nan, nan], dtype=array_api_strict.float64)
>>> import sparse
>>> sparse.unique_values(sparse.asarray([math.nan, math.nan]))
array([nan])
Please describe your system.
sparse 0.16.0b4