From 9284246ffa548ad07e71540c469f57bfe71c4d0b Mon Sep 17 00:00:00 2001 From: brokkoli71 Date: Wed, 12 Feb 2025 13:35:10 +0100 Subject: [PATCH] fix mypy --- src/zarr/core/array.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index bfd69f5168..853c8432d7 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -2271,12 +2271,7 @@ def __array__( raise ValueError(msg) arr = self[...] - arr_np: NDArrayLike - - if not hasattr(arr, "astype"): - arr_np = np.array(arr, dtype=dtype) - else: - arr_np = arr + arr_np: NDArrayLike = np.array(arr, dtype=dtype) if dtype is not None: arr_np = arr_np.astype(dtype) @@ -3330,7 +3325,7 @@ def set_coordinate_selection( value = np.array(value).reshape(-1) if not is_scalar(value, self.dtype) and ( - isinstance(value, NDArrayOrScalarLike) and indexer.shape != value.shape + isinstance(value, NDArrayLike) and indexer.shape != value.shape ): raise ValueError( f"Attempting to set a selection of {indexer.sel_shape[0]} "