Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e6cfdf9

Browse files
committedMar 21, 2025·
meshgrid xy parameter should be literal
1 parent 772fb46 commit e6cfdf9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/array_api_stubs/_draft/creation_functions.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from ._types import (
2222
List,
23+
Literal,
2324
NestedSequence,
2425
Optional,
2526
SupportsBufferProtocol,
@@ -454,15 +455,15 @@ def linspace(
454455
"""
455456

456457

457-
def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
458+
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
458459
"""
459460
Returns coordinate matrices from coordinate vectors.
460461
461462
Parameters
462463
----------
463464
arrays: array
464465
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
465-
indexing: str
466+
indexing: 'xy' | 'ij'
466467
Cartesian ``'xy'`` or matrix ``'ij'`` indexing of output. If provided zero or one one-dimensional vector(s) (i.e., the zero- and one-dimensional cases, respectively), the ``indexing`` keyword has no effect and should be ignored. Default: ``'xy'``.
467468
468469
Returns

0 commit comments

Comments
 (0)
Please sign in to comment.