Skip to content

Commit f96e0e2

Browse files
committed
Address TODO for sort order in the output of unique()
Closes data-apisgh-40
1 parent 17b50f5 commit f96e0e2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

spec/API_specification/set_functions.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A conforming implementation of the array API standard must provide and support t
1313
<!-- NOTE: please keep the functions in alphabetical order -->
1414

1515
(function-unique)=
16-
### unique(x, /, *, return_counts=False, return_index=False, return_inverse=False, sorted=True)
16+
### unique(x, /, *, return_counts=False, return_index=False, return_inverse=False)
1717

1818
Returns the unique elements of an input array `x`.
1919

@@ -35,12 +35,6 @@ Returns the unique elements of an input array `x`.
3535

3636
- If `True`, the function must also return the indices of the unique array that reconstruct `x`. Default: `False`.
3737

38-
- **sorted**: _bool_
39-
40-
- If `True`, the function must sort the unique elements in ascending order before returning as output. If `False`, the function must sort the unique elements in the same order that they occur in `x`. Default: `False`.
41-
42-
_TODO: sort order needs discussion. See [gh-40](https://github.com/data-apis/array-api/issues/40)_
43-
4438
#### Returns
4539

4640
- **out**: _Union\[ &lt;array&gt;, Tuple\[ &lt;array&gt;, ... ] ]_
@@ -51,6 +45,10 @@ Returns the unique elements of an input array `x`.
5145

5246
- an array containing the set of unique elements in `x`. The returned array must have the same data type as `x`.
5347

48+
```{note}
49+
The order of elements is not specified, and may vary between implementations.
50+
```
51+
5452
- **indices**: _&lt;array&gt;_
5553
5654
- an array containing the indices (first occurrences) of `x` that result in `unique`. The returned array must have the default array index data type.

0 commit comments

Comments
 (0)