Skip to content

Commit 4a097e1

Browse files
authored
Move BatchedCodecPipeline to zarr.core (#2086)
* mv BatchedCodecPipeline to zarr.core * fix for tests * import codec_pipeline and buffer in zarr.core.__init__
1 parent a31046c commit 4a097e1

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

src/zarr/codecs/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99
from zarr.codecs.bytes import BytesCodec, Endian
1010
from zarr.codecs.crc32c_ import Crc32cCodec
1111
from zarr.codecs.gzip import GzipCodec
12-
from zarr.codecs.pipeline import BatchedCodecPipeline
1312
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
1413
from zarr.codecs.transpose import TransposeCodec
1514
from zarr.codecs.vlen_utf8 import VLenBytesCodec, VLenUTF8Codec
1615
from zarr.codecs.zstd import ZstdCodec
1716
from zarr.core.metadata.v3 import DataType
1817

1918
__all__ = [
20-
"BatchedCodecPipeline",
2119
"BloscCname",
2220
"BloscCodec",
2321
"BloscShuffle",

src/zarr/codecs/registry.py

Whitespace-only changes.

src/zarr/core/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from __future__ import annotations
2+
3+
from zarr.core.buffer import Buffer, NDBuffer # noqa: F401
4+
from zarr.core.codec_pipeline import BatchedCodecPipeline # noqa: F401
File renamed without changes.

src/zarr/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def reset(self) -> None:
4747
"threading": {"max_workers": None},
4848
"json_indent": 2,
4949
"codec_pipeline": {
50-
"path": "zarr.codecs.pipeline.BatchedCodecPipeline",
50+
"path": "zarr.core.codec_pipeline.BatchedCodecPipeline",
5151
"batch_size": 1,
5252
},
5353
"codecs": {

tests/test_config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
from zarr import Array, zeros
1212
from zarr.abc.codec import CodecInput, CodecOutput, CodecPipeline
1313
from zarr.abc.store import ByteSetter, Store
14-
from zarr.codecs import BatchedCodecPipeline, BloscCodec, BytesCodec, Crc32cCodec, ShardingCodec
14+
from zarr.codecs import BloscCodec, BytesCodec, Crc32cCodec, ShardingCodec
1515
from zarr.core.array_spec import ArraySpec
1616
from zarr.core.buffer import NDBuffer
17+
from zarr.core.codec_pipeline import BatchedCodecPipeline
1718
from zarr.core.config import BadConfigError, config
1819
from zarr.core.indexing import SelectorTuple
1920
from zarr.registry import (
@@ -45,7 +46,7 @@ def test_config_defaults_set() -> None:
4546
"threading": {"max_workers": None},
4647
"json_indent": 2,
4748
"codec_pipeline": {
48-
"path": "zarr.codecs.pipeline.BatchedCodecPipeline",
49+
"path": "zarr.core.codec_pipeline.BatchedCodecPipeline",
4950
"batch_size": 1,
5051
},
5152
"buffer": "zarr.core.buffer.cpu.Buffer",
@@ -96,8 +97,8 @@ def test_config_codec_pipeline_class(store: Store) -> None:
9697
# has default value
9798
assert get_pipeline_class().__name__ != ""
9899

99-
config.set({"codec_pipeline.name": "zarr.codecs.pipeline.BatchedCodecPipeline"})
100-
assert get_pipeline_class() == zarr.codecs.pipeline.BatchedCodecPipeline
100+
config.set({"codec_pipeline.name": "zarr.core.codec_pipeline.BatchedCodecPipeline"})
101+
assert get_pipeline_class() == zarr.core.codec_pipeline.BatchedCodecPipeline
101102

102103
_mock = Mock()
103104

0 commit comments

Comments
 (0)