Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 11, 2023
1 parent 704cc46 commit ab2a779
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 5 additions & 8 deletions xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,25 @@
from xarray.core import dtypes
from xarray.namedarray.utils import (
Default,
DuckArray,
_arrayfunction_or_api,
_AttrsLike,
_Chunks,
_default,
_Array,
DuckArray,
duckarray,
_Dim,
_Dims,
_DimsLike,
_DType_co,
_IntOrUnknown,
_Shape,
_DType_co,
_ScalarType,
_ScalarType_co,
_Shape,
_ShapeType,
_ShapeType_co,
_SupportsReal,
_SupportsImag,
_sparsearrayfunction_or_api,
_SupportsImag,
_SupportsReal,
duckarray,
is_chunked_duck_array,
is_duck_dask_array,
to_0d_object_array,
Expand Down Expand Up @@ -126,7 +124,6 @@ def from_array(
return NamedArray(dims, data, attrs)

if isinstance(data, _arrayfunction_or_api):

return NamedArray(dims, data, attrs)
else:
if isinstance(data, tuple):
Expand Down
4 changes: 3 additions & 1 deletion xarray/namedarray/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
SupportsIndex,
TypeVar,
Union,
runtime_checkable,
overload,
runtime_checkable,
)

import numpy as np
Expand Down Expand Up @@ -54,6 +54,7 @@
_ScalarType = TypeVar("_ScalarType", bound=np.generic)
_ScalarType_co = TypeVar("_ScalarType_co", bound=np.generic, covariant=True)


# A protocol for anything with the dtype attribute
@runtime_checkable
class _SupportsDType(Protocol[_DType_co]):
Expand Down Expand Up @@ -97,6 +98,7 @@ class _SupportsImag(Protocol[_T_co]):
def imag(self) -> _T_co:
...


_SupportsReal[_ScalarType]


Expand Down

0 comments on commit ab2a779

Please sign in to comment.