Skip to content

Commit

Permalink
fixes for ci after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman committed Nov 24, 2024
1 parent 950fe94 commit 65170a7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion spec/draft/API_specification/array_object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ A conforming implementation of the array API standard must provide and support a
- `operator.ne(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ne>`_
- `operator.__ne__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ne__>`_

:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
:meth:`.Array.__lt__`, :meth:`.Array.__le__`, :meth:`.Array.__gt__`, :meth:`.Array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).

In-place Operators
Expand Down
1 change: 1 addition & 0 deletions src/_array_api_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
("py:obj", "typing.Union[int, float, typing.Literal[inf, - inf]]"),
("py:class", "int | float | ~typing.Literal[inf, -inf]"),
("py:class", "enum.Enum"),
("py:class", "Enum"),
("py:class", "ellipsis"),
]
nitpick_ignore_regex = [
Expand Down
8 changes: 4 additions & 4 deletions src/array_api_stubs/_draft/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ class Info(Protocol):
def capabilities(self) -> Capabilities:
...

def default_device(self) -> device:
def default_device(self) -> Device:
...

def default_dtypes(self, *, device: Optional[device]) -> DefaultDataTypes:
def default_dtypes(self, *, device: Optional[Device]) -> DefaultDataTypes:
...

def devices(self) -> List[device]:
def devices(self) -> List[Device]:
...

def dtypes(
self, *, device: Optional[device], kind: Optional[Union[str, Tuple[str, ...]]]
self, *, device: Optional[Device], kind: Optional[Union[str, Tuple[str, ...]]]
) -> DataTypes:
...

Expand Down
9 changes: 5 additions & 4 deletions src/array_api_stubs/_draft/array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

__all__ = ["Array"]

from typing import TYPE_CHECKING, Protocol, TypeVar
from enum import Enum
from typing import TYPE_CHECKING, Protocol, TypeVar

from .data_types import DType
from ._types import Device

Expand Down Expand Up @@ -311,7 +312,7 @@ def __dlpack__(
self,
/,
*,
stream: Any | None = None,
stream: Any | None = None,
max_version: tuple[int, int] | None = None,
dl_device: tuple[Enum, int] | None = None,
copy: bool | None = None,
Expand Down Expand Up @@ -370,7 +371,7 @@ def __dlpack__(
dl_device: Optional[tuple[enum.Enum, int]]
the DLPack device type. Default is ``None``, meaning the exported capsule
should be on the same device as ``self`` is. When specified, the format
must be a 2-tuple, following that of the return value of :meth:`array.__dlpack_device__`.
must be a 2-tuple, following that of the return value of :meth:`Array.__dlpack_device__`.
If the device type cannot be handled by the producer, this function must
raise ``BufferError``.
Expand Down Expand Up @@ -492,7 +493,7 @@ def __dlpack_device__(self, /) -> tuple[Enum, int]:
Returns
-------
device: Tuple[Enum, int]
device: Tuple[enum.Enum, int]
a tuple ``(device_type, device_id)`` in DLPack format. Valid device type enum members are:
::
Expand Down
2 changes: 1 addition & 1 deletion src/array_api_stubs/_draft/creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def from_dlpack(
Notes
-----
See :meth:`array.__dlpack__` for implementation suggestions for `from_dlpack` in
See :meth:`Array.__dlpack__` for implementation suggestions for `from_dlpack` in
order to handle DLPack versioning correctly.
A way to move data from two array libraries to the same device (assumed supported by both libraries) in
Expand Down
14 changes: 8 additions & 6 deletions src/array_api_stubs/_draft/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
DataTypes,
Capabilities,
Info,
Device,
)


def __array_namespace_info__() -> Info:
def __array_namespace_info__() -> Info: # type: ignore[empty-body]
"""
Returns a namespace with Array API namespace inspection utilities.
Expand All @@ -48,9 +49,10 @@ def __array_namespace_info__() -> Info:
.. versionadded: 2023.12
"""
...


def capabilities() -> Capabilities:
def capabilities() -> Capabilities: # type: ignore[empty-body]
"""
Returns a dictionary of array library capabilities.
Expand All @@ -72,7 +74,7 @@ def capabilities() -> Capabilities:
"""


def default_device() -> device:
def default_device() -> Device: # type: ignore[empty-body]
"""
Returns the default device.
Expand All @@ -88,7 +90,7 @@ def default_device() -> device:
"""


def default_dtypes(
def default_dtypes( # type: ignore[empty-body]
*,
device: Optional[device] = None,
) -> DefaultDataTypes:
Expand Down Expand Up @@ -124,7 +126,7 @@ def default_dtypes(
"""


def dtypes(
def dtypes( # type: ignore[empty-body]
*,
device: Optional[device] = None,
kind: Optional[Union[str, Tuple[str, ...]]] = None,
Expand Down Expand Up @@ -179,7 +181,7 @@ def dtypes(
"""


def devices() -> List[device]:
def devices() -> List[device]: # type: ignore[empty-body]
"""
Returns a list of supported devices which are available at runtime.
Expand Down

0 comments on commit 65170a7

Please sign in to comment.