Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
brokkoli71 committed Feb 12, 2025
1 parent b005620 commit 9284246
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/zarr/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]} "
Expand Down

0 comments on commit 9284246

Please sign in to comment.