Skip to content

Commit 144b2b7

Browse files
committed
remove redundant test function
1 parent c04d7cf commit 144b2b7

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

tests/test_array.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from zarr import Array, AsyncArray, Group
1515
from zarr.codecs import BytesCodec, VLenBytesCodec, ZstdCodec
1616
from zarr.codecs.gzip import GzipCodec
17-
from zarr.codecs.sharding import ShardingCodec
1817
from zarr.codecs.transpose import TransposeCodec
1918
from zarr.core._info import ArrayInfo
2019
from zarr.core.array import (
@@ -29,12 +28,10 @@
2928
from zarr.core.buffer import default_buffer_prototype
3029
from zarr.core.buffer.cpu import NDBuffer
3130
from zarr.core.chunk_grids import _auto_partition
32-
from zarr.core.codec_pipeline import BatchedCodecPipeline
3331
from zarr.core.common import JSON, MemoryOrder, ZarrFormat
3432
from zarr.core.group import AsyncGroup
3533
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
3835
from zarr.core.sync import sync
3936
from zarr.errors import ContainsArrayError, ContainsGroupError
4037
from zarr.storage import LocalStore, MemoryStore
@@ -897,27 +894,6 @@ async def test_nbytes(
897894
assert arr.nbytes == np.prod(arr.shape) * arr.dtype.itemsize
898895

899896

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-
921897
@pytest.mark.parametrize(
922898
("array_shape", "chunk_shape"),
923899
[((256,), (2,))],

0 commit comments

Comments
 (0)