Skip to content

Commit

Permalink
feat: add max rank to inspection API capabilities
Browse files Browse the repository at this point in the history
PR-URL: #763
Closes: #694
Reviewed-by: Ralf Gommers <[email protected]>
Reviewed-by: Leo Fang <[email protected]>
  • Loading branch information
kgryte authored May 2, 2024
1 parent 69e2733 commit 6a5767a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/array_api_stubs/_draft/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,10 @@ def dtypes(
total=False,
)
Capabilities = TypedDict(
"Capabilities", {"boolean indexing": bool, "data-dependent shapes": bool}
"Capabilities",
{
"boolean indexing": bool,
"data-dependent shapes": bool,
"max rank": Optional[int],
},
)
1 change: 1 addition & 0 deletions src/array_api_stubs/_draft/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def capabilities() -> Capabilities:
- `"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``.
- `"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``.
- `"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.
Returns
-------
Expand Down

0 comments on commit 6a5767a

Please sign in to comment.