Skip to content

Multiple imports for an import name #2047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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