|
14 | 14 | from zarr import Array, AsyncArray, Group |
15 | 15 | from zarr.codecs import BytesCodec, VLenBytesCodec, ZstdCodec |
16 | 16 | from zarr.codecs.gzip import GzipCodec |
17 | | -from zarr.codecs.sharding import ShardingCodec |
18 | 17 | from zarr.codecs.transpose import TransposeCodec |
19 | 18 | from zarr.core._info import ArrayInfo |
20 | 19 | from zarr.core.array import ( |
|
29 | 28 | from zarr.core.buffer import default_buffer_prototype |
30 | 29 | from zarr.core.buffer.cpu import NDBuffer |
31 | 30 | from zarr.core.chunk_grids import _auto_partition |
32 | | -from zarr.core.codec_pipeline import BatchedCodecPipeline |
33 | 31 | from zarr.core.common import JSON, MemoryOrder, ZarrFormat |
34 | 32 | from zarr.core.group import AsyncGroup |
35 | 33 | from zarr.core.indexing import ceildiv |
36 | | -from zarr.core.metadata.v2 import ArrayV2Metadata |
37 | | -from zarr.core.metadata.v3 import ArrayV3Metadata, DataType |
| 34 | +from zarr.core.metadata.v3 import DataType |
38 | 35 | from zarr.core.sync import sync |
39 | 36 | from zarr.errors import ContainsArrayError, ContainsGroupError |
40 | 37 | from zarr.storage import LocalStore, MemoryStore |
@@ -897,27 +894,6 @@ async def test_nbytes( |
897 | 894 | assert arr.nbytes == np.prod(arr.shape) * arr.dtype.itemsize |
898 | 895 |
|
899 | 896 |
|
900 | | -def _get_partitioning( |
901 | | - data: AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata], |
902 | | -) -> tuple[tuple[int, ...], tuple[int, ...] | None]: |
903 | | - """ |
904 | | - Get the shard shape and chunk shape of an array. If the array is not sharded, the shard shape |
905 | | - will be None. |
906 | | - """ |
907 | | - |
908 | | - shard_shape: tuple[int, ...] | None |
909 | | - chunk_shape: tuple[int, ...] |
910 | | - codecs = data.codec_pipeline |
911 | | - if isinstance(codecs, BatchedCodecPipeline): |
912 | | - if isinstance(codecs.array_bytes_codec, ShardingCodec): |
913 | | - chunk_shape = codecs.array_bytes_codec.chunk_shape |
914 | | - shard_shape = data.chunks |
915 | | - else: |
916 | | - chunk_shape = data.chunks |
917 | | - shard_shape = None |
918 | | - return chunk_shape, shard_shape |
919 | | - |
920 | | - |
921 | 897 | @pytest.mark.parametrize( |
922 | 898 | ("array_shape", "chunk_shape"), |
923 | 899 | [((256,), (2,))], |
|
0 commit comments