File tree 2 files changed +15
-9
lines changed
array_api_compat/dask/array
2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,10 @@ def capabilities(self):
68
68
The resulting dictionary has the following keys:
69
69
70
70
- **"boolean indexing"**: boolean indicating whether an array library
71
- supports boolean indexing. Always ``False`` for Dask.
71
+ supports boolean indexing.
72
72
73
73
- **"data-dependent shapes"**: boolean indicating whether an array
74
- library supports data-dependent output shapes. Always ``False`` for
75
- Dask.
74
+ library supports data-dependent output shapes.
76
75
77
76
See
78
77
https://data-apis.org/array-api/latest/API_specification/generated/array_api.info.capabilities.html
@@ -99,9 +98,14 @@ def capabilities(self):
99
98
100
99
"""
101
100
return {
102
- "boolean indexing" : False ,
103
- "data-dependent shapes" : False ,
104
- # 'max rank' will be part of the 2024.12 standard
101
+ # Dask support boolean indexing as long as the index has known shape.
102
+ # The output .shape and .size properties will contain
103
+ # a non-compliant math.nan instead of None.
104
+ "boolean indexing" : True ,
105
+ # Dask implements unique_values et.al.
106
+ # The output .shape and .size properties will contain
107
+ # a non-compliant math.nan instead of None.
108
+ "data-dependent shapes" : True ,
105
109
"max dimensions" : 64 ,
106
110
}
107
111
Original file line number Diff line number Diff line change @@ -28,12 +28,14 @@ array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
28
28
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
29
29
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]
30
30
31
- # Fails because shape is NaN since we don't materialize it yet
31
+ # Data-dependent output shape
32
+ # These tests fail as array-api-tests doesn't cope with unknown shapes
33
+ # Also, output shape is (math.nan, ) instead of (None, )
34
+ # Also, da.unique() doesn't accept equals_nan which causes non-compliant
35
+ # output when there are NaNs in the input.
32
36
array_api_tests/test_searching_functions.py::test_nonzero
33
37
array_api_tests/test_set_functions.py::test_unique_all
34
38
array_api_tests/test_set_functions.py::test_unique_counts
35
-
36
- # Different error but same cause as above, we're just trying to do ndindex on nan shape
37
39
array_api_tests/test_set_functions.py::test_unique_inverse
38
40
array_api_tests/test_set_functions.py::test_unique_values
39
41
You can’t perform that action at this time.
0 commit comments