From 8098fa30798cfe9623b53aa99f4557e0c55affcf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:29:23 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../namedarray/_array_api/_creation_functions.py | 2 +- xarray/namedarray/_array_api/_info.py | 15 ++++++++------- .../_array_api/_manipulation_functions.py | 3 +-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xarray/namedarray/_array_api/_creation_functions.py b/xarray/namedarray/_array_api/_creation_functions.py index f0588fba8d6..12204f07b9c 100644 --- a/xarray/namedarray/_array_api/_creation_functions.py +++ b/xarray/namedarray/_array_api/_creation_functions.py @@ -5,8 +5,8 @@ import numpy as np from xarray.namedarray._array_api._utils import ( - _maybe_default_namespace, _get_data_namespace, + _maybe_default_namespace, ) from xarray.namedarray._typing import ( Default, diff --git a/xarray/namedarray/_array_api/_info.py b/xarray/namedarray/_array_api/_info.py index 006b724fccd..9979ce5f854 100644 --- a/xarray/namedarray/_array_api/_info.py +++ b/xarray/namedarray/_array_api/_info.py @@ -4,11 +4,16 @@ if TYPE_CHECKING: from types import ModuleType - from typing import Optional, Union, Tuple, List + from typing import Optional, Union + from xarray.namedarray._typing import _Device from xarray.namedarray._array_api._dtypes import ( bool, + complex64, + complex128, + float32, + float64, int8, int16, int32, @@ -17,10 +22,6 @@ uint16, uint32, uint64, - float32, - float64, - complex64, - complex128, ) @@ -60,7 +61,7 @@ def default_dtypes( def dtypes( *, device: _Device | None = None, - kind: Optional[Union[str, Tuple[str, ...]]] = None, + kind: Optional[Union[str, tuple[str, ...]]] = None, ) -> dict: if kind is None: return { @@ -138,7 +139,7 @@ def dtypes( raise ValueError(f"unsupported kind: {kind!r}") -def devices() -> List[_Device]: +def devices() -> list[_Device]: return [default_device()] diff --git a/xarray/namedarray/_array_api/_manipulation_functions.py b/xarray/namedarray/_array_api/_manipulation_functions.py index d8735fafd31..662911cbbf6 100644 --- a/xarray/namedarray/_array_api/_manipulation_functions.py +++ b/xarray/namedarray/_array_api/_manipulation_functions.py @@ -2,9 +2,8 @@ from typing import Any -from xarray.namedarray._array_api._utils import _get_data_namespace from xarray.namedarray._array_api._creation_functions import asarray - +from xarray.namedarray._array_api._utils import _get_data_namespace from xarray.namedarray._typing import ( Default, _arrayapi,