Skip to content

Commit cb7e678

Browse files
committed
feat: add support for querying the maximum number of supported dimensions
Closes: data-apis#694
1 parent c305b82 commit cb7e678

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: src/array_api_stubs/_draft/_types.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,10 @@ def dtypes(
140140
total=False,
141141
)
142142
Capabilities = TypedDict(
143-
"Capabilities", {"boolean indexing": bool, "data-dependent shapes": bool}
143+
"Capabilities",
144+
{
145+
"boolean indexing": bool,
146+
"data-dependent shapes": bool,
147+
"max rank": Optional[int],
148+
},
144149
)

Diff for: src/array_api_stubs/_draft/info.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def capabilities() -> Capabilities:
5656
5757
- `"boolean indexing"`: boolean indicating whether an array library supports boolean indexing. If a conforming implementation fully supports boolean indexing in compliance with this specification (see :ref:`indexing`), the corresponding dictionary value must be ``True``; otherwise, the value must be ``False``.
5858
- `"data-dependent shapes"`: boolean indicating whether an array library supports data-dependent output shapes. If a conforming implementation fully supports all APIs included in this specification (excluding boolean indexing) which have data-dependent output shapes, as explicitly demarcated throughout the specification, the corresponding dictionary value must be ``True``; otherwise, the value must be ``False``.
59+
- `"max rank"`: maximum number of supported dimensions. If a conforming implementation supports arrays having an arbitrary number of dimensions (potentially infinite), the corresponding dictionary value must be ``None``; otherwise, the value must be a finite integer.
5960
6061
Returns
6162
-------

0 commit comments

Comments
 (0)