Skip to content

Commit 6a5767a

Browse files
authored
feat: add max rank to inspection API capabilities
PR-URL: #763 Closes: #694 Reviewed-by: Ralf Gommers <ralf.gommers@gmail.com> Reviewed-by: Leo Fang <leo80042@gmail.com>
1 parent 69e2733 commit 6a5767a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/array_api_stubs/_draft/_types.py

Lines changed: 6 additions & 1 deletion
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
)

src/array_api_stubs/_draft/info.py

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy