Skip to content

Commit e733943

Browse files
committed
define ZarrFormat in top-level types
1 parent 3e119a9 commit e733943

34 files changed

+55
-36
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
ChunkCoords,
5858
DimensionNames,
5959
MemoryOrder,
60-
ZarrFormat,
6160
)
6261
from zarr.storage import StoreLike
62+
from zarr.types import ZarrFormat
6363

6464
# TODO: this type could use some more thought
6565
ArrayLike = AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata] | Array | npt.NDArray[Any]

src/zarr/api/synchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
DimensionNames,
3939
MemoryOrder,
4040
ShapeLike,
41-
ZarrFormat,
4241
)
4342
from zarr.storage import StoreLike
43+
from zarr.types import ZarrFormat
4444

4545
__all__ = [
4646
"array",

src/zarr/core/_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from zarr.abc.codec import ArrayArrayCodec, ArrayBytesCodec, BytesBytesCodec
1111
from zarr.core.dtype.wrapper import TBaseDType, TBaseScalar, ZDType
12-
from zarr.core.types import ZarrFormat
12+
from zarr.types import ZarrFormat
1313

1414

1515
@dataclasses.dataclass(kw_only=True)

src/zarr/core/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
DimensionNames,
120120
MemoryOrder,
121121
ShapeLike,
122-
ZarrFormat,
123122
)
124123
from zarr.errors import MetadataValidationError, ZarrDeprecationWarning, ZarrUserWarning
125124
from zarr.registry import (
@@ -142,6 +141,7 @@
142141
from zarr.core.dtype.wrapper import TBaseDType, TBaseScalar
143142
from zarr.core.group import AsyncGroup
144143
from zarr.storage import StoreLike
144+
from zarr.types import ZarrFormat
145145

146146

147147
# Array and AsyncArray are defined in the base ``zarr`` namespace

src/zarr/core/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
if TYPE_CHECKING:
2828
from collections.abc import Awaitable, Callable, Iterable, Iterator
2929

30-
from zarr.core.types import ChunkCoords, ZarrFormat
30+
from zarr.core.types import ChunkCoords
31+
from zarr.types import ZarrFormat
3132

3233

3334
def product(tup: ChunkCoords) -> int:

src/zarr/core/dtype/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
)
3333

3434
if TYPE_CHECKING:
35-
from zarr.core.types import ZarrFormat
35+
from zarr.types import ZarrFormat
3636

3737
from collections.abc import Mapping
3838

src/zarr/core/dtype/npy/bool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
from zarr.core.dtype.wrapper import TBaseDType, ZDType
1616

1717
if TYPE_CHECKING:
18-
from zarr.core.types import JSON, ZarrFormat
18+
from zarr.core.types import JSON
19+
from zarr.types import ZarrFormat
1920

2021

2122
@dataclass(frozen=True, kw_only=True, slots=True)

src/zarr/core/dtype/npy/bytes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import base64
44
import re
55
from dataclasses import dataclass
6-
from typing import ClassVar, Literal, Self, TypedDict, TypeGuard, cast, overload
6+
from typing import TYPE_CHECKING, ClassVar, Literal, Self, TypedDict, TypeGuard, cast, overload
77

88
import numpy as np
99

@@ -19,7 +19,10 @@
1919
)
2020
from zarr.core.dtype.npy.common import check_json_str
2121
from zarr.core.dtype.wrapper import TBaseDType, ZDType
22-
from zarr.core.types import JSON, NamedConfig, ZarrFormat
22+
from zarr.core.types import JSON, NamedConfig
23+
24+
if TYPE_CHECKING:
25+
from zarr.types import ZarrFormat
2326

2427
BytesLike = np.bytes_ | str | bytes | int
2528

src/zarr/core/dtype/npy/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
)
2929

3030
if TYPE_CHECKING:
31-
from zarr.core.types import JSON, ZarrFormat
31+
from zarr.core.types import JSON
32+
from zarr.types import ZarrFormat
3233

3334
IntLike = SupportsInt | SupportsIndex | bytes | str
3435
FloatLike = SupportsIndex | SupportsFloat | bytes | str

src/zarr/core/dtype/npy/complex.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
from zarr.core.dtype.wrapper import TBaseDType, ZDType
3737

3838
if TYPE_CHECKING:
39-
from zarr.core.types import JSON, ZarrFormat
39+
from zarr.core.types import JSON
40+
from zarr.types import ZarrFormat
4041

4142

4243
@dataclass(frozen=True)

0 commit comments

Comments
 (0)