Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/array_api_stubs/_2021_12/creation_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from ._types import (
List,
Literal,
NestedSequence,
Optional,
SupportsBufferProtocol,
Expand Down Expand Up @@ -311,15 +312,15 @@ def linspace(
"""


def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
"""
Returns coordinate matrices from coordinate vectors.

Parameters
----------
arrays: array
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
indexing: str
indexing: Literal["xy", "ij"]
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'``.

Returns
Expand Down
5 changes: 3 additions & 2 deletions src/array_api_stubs/_2022_12/creation_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from ._types import (
List,
Literal,
NestedSequence,
Optional,
SupportsBufferProtocol,
Expand Down Expand Up @@ -372,15 +373,15 @@ def linspace(
"""


def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
"""
Returns coordinate matrices from coordinate vectors.

Parameters
----------
arrays: array
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
indexing: str
indexing: Literal["xy", "ij"]
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'``.

Returns
Expand Down
5 changes: 3 additions & 2 deletions src/array_api_stubs/_2023_12/creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from ._types import (
List,
Literal,
NestedSequence,
Optional,
SupportsBufferProtocol,
Expand Down Expand Up @@ -454,15 +455,15 @@ def linspace(
"""


def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
"""
Returns coordinate matrices from coordinate vectors.

Parameters
----------
arrays: array
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
indexing: str
indexing: Literal["xy", "ij"]
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'``.

Returns
Expand Down
5 changes: 3 additions & 2 deletions src/array_api_stubs/_2024_12/creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from ._types import (
List,
Literal,
NestedSequence,
Optional,
SupportsBufferProtocol,
Expand Down Expand Up @@ -454,15 +455,15 @@ def linspace(
"""


def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
"""
Returns coordinate matrices from coordinate vectors.

Parameters
----------
arrays: array
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
indexing: str
indexing: Literal["xy", "ij"]
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'``.

Returns
Expand Down
5 changes: 3 additions & 2 deletions src/array_api_stubs/_draft/creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from ._types import (
List,
Literal,
NestedSequence,
Optional,
SupportsBufferProtocol,
Expand Down Expand Up @@ -454,15 +455,15 @@ def linspace(
"""


def meshgrid(*arrays: array, indexing: str = "xy") -> List[array]:
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
"""
Returns coordinate matrices from coordinate vectors.

Parameters
----------
arrays: array
an arbitrary number of one-dimensional arrays representing grid coordinates. Each array should have the same numeric data type.
indexing: str
indexing: Literal["xy", "ij"]
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'``.

Returns
Expand Down