Skip to content

Commit

Permalink
Merge branch 'v3' into array_fixture_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
d-v-b authored Jul 21, 2024
2 parents a7bbff8 + 4b7be5b commit 90cf2dd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/zarr/codecs/transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections.abc import Iterable
from dataclasses import dataclass, replace
from typing import TYPE_CHECKING, Any, cast
from typing import TYPE_CHECKING, cast

import numpy as np

Expand All @@ -14,7 +14,7 @@
from zarr.common import JSON, ChunkCoordsLike, parse_named_configuration

if TYPE_CHECKING:
from typing import TYPE_CHECKING
from typing import Any

from typing_extensions import Self

Expand Down
2 changes: 1 addition & 1 deletion src/zarr/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Iterable
from typing import Any, Literal
from typing import Any

logger = logging.getLogger("zarr.group")

Expand Down
2 changes: 1 addition & 1 deletion src/zarr/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ def __init__(self, selection: CoordinateSelection, shape: ChunkCoords, chunk_gri
# flatten selection
selection_broadcast = tuple(dim_sel.reshape(-1) for dim_sel in selection_broadcast)
chunks_multi_index_broadcast = tuple(
[dim_chunks.reshape(-1) for dim_chunks in chunks_multi_index_broadcast]
dim_chunks.reshape(-1) for dim_chunks in chunks_multi_index_broadcast
)

# ravel chunk indices
Expand Down
3 changes: 1 addition & 2 deletions src/zarr/store/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
import fsspec

from zarr.abc.store import Store
from zarr.buffer import Buffer, BufferPrototype
from zarr.common import OpenMode
from zarr.store.core import _dereference_path

if TYPE_CHECKING:
from fsspec.asyn import AsyncFileSystem
from upath import UPath

from zarr.buffer import Buffer
from zarr.buffer import Buffer, BufferPrototype
from zarr.common import BytesLike


Expand Down
3 changes: 1 addition & 2 deletions tests/v2/test_indexing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy
import numpy as np
import pytest
from numpy.testing import assert_array_equal
Expand Down Expand Up @@ -1679,7 +1678,7 @@ def test_numpy_int_indexing():
z = zarr.v2.create(shape=1050, chunks=100, dtype=a.dtype)
z[:] = a
assert a[42] == z[42]
assert a[numpy.int64(42)] == z[numpy.int64(42)]
assert a[np.int64(42)] == z[np.int64(42)]


@pytest.mark.parametrize(
Expand Down
2 changes: 0 additions & 2 deletions tests/v2/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,6 @@ def test_complex(self):
assert store[self.root + "foo"] == b"hello"

def test_deep_ndim(self):
import zarr.v2

store = self.create_store()
path = None if self.version == 2 else "group1"
foo = zarr.v2.open_group(store=store, path=path)
Expand Down
6 changes: 2 additions & 4 deletions tests/v2/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,17 @@ def init_attributes(self, store, read_only=False, cache=True):

def _append(arg):
z, i = arg
import numpy

x = numpy.empty(1000, dtype="i4")
x = np.empty(1000, dtype="i4")
x[:] = i
shape = z.append(x)
return shape


def _set_arange(arg):
z, i = arg
import numpy

x = numpy.arange(i * 1000, (i * 1000) + 1000, 1)
x = np.arange(i * 1000, (i * 1000) + 1000, 1)
z[i * 1000 : (i * 1000) + 1000] = x
return i

Expand Down

0 comments on commit 90cf2dd

Please sign in to comment.