Skip to content

Move BatchedCodecPipeline to zarr.core #2086

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 4 commits into from
Nov 5, 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
2 changes: 0 additions & 2 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
from zarr.codecs.bytes import BytesCodec, Endian
from zarr.codecs.crc32c_ import Crc32cCodec
from zarr.codecs.gzip import GzipCodec
from zarr.codecs.pipeline import BatchedCodecPipeline
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
from zarr.codecs.transpose import TransposeCodec
from zarr.codecs.vlen_utf8 import VLenBytesCodec, VLenUTF8Codec
from zarr.codecs.zstd import ZstdCodec
from zarr.core.metadata.v3 import DataType

__all__ = [
"BatchedCodecPipeline",
"BloscCname",
"BloscCodec",
"BloscShuffle",
Expand Down
Empty file removed src/zarr/codecs/registry.py
Empty file.
4 changes: 4 additions & 0 deletions src/zarr/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from __future__ import annotations

from zarr.core.buffer import Buffer, NDBuffer # noqa: F401
from zarr.core.codec_pipeline import BatchedCodecPipeline # noqa: F401
File renamed without changes.
2 changes: 1 addition & 1 deletion src/zarr/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def reset(self) -> None:
"threading": {"max_workers": None},
"json_indent": 2,
"codec_pipeline": {
"path": "zarr.codecs.pipeline.BatchedCodecPipeline",
"path": "zarr.core.codec_pipeline.BatchedCodecPipeline",
"batch_size": 1,
},
"codecs": {
Expand Down
9 changes: 5 additions & 4 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
from zarr import Array, zeros
from zarr.abc.codec import CodecInput, CodecOutput, CodecPipeline
from zarr.abc.store import ByteSetter, Store
from zarr.codecs import BatchedCodecPipeline, BloscCodec, BytesCodec, Crc32cCodec, ShardingCodec
from zarr.codecs import BloscCodec, BytesCodec, Crc32cCodec, ShardingCodec
from zarr.core.array_spec import ArraySpec
from zarr.core.buffer import NDBuffer
from zarr.core.codec_pipeline import BatchedCodecPipeline
from zarr.core.config import BadConfigError, config
from zarr.core.indexing import SelectorTuple
from zarr.registry import (
Expand Down Expand Up @@ -45,7 +46,7 @@ def test_config_defaults_set() -> None:
"threading": {"max_workers": None},
"json_indent": 2,
"codec_pipeline": {
"path": "zarr.codecs.pipeline.BatchedCodecPipeline",
"path": "zarr.core.codec_pipeline.BatchedCodecPipeline",
"batch_size": 1,
},
"buffer": "zarr.core.buffer.cpu.Buffer",
Expand Down Expand Up @@ -96,8 +97,8 @@ def test_config_codec_pipeline_class(store: Store) -> None:
# has default value
assert get_pipeline_class().__name__ != ""

config.set({"codec_pipeline.name": "zarr.codecs.pipeline.BatchedCodecPipeline"})
assert get_pipeline_class() == zarr.codecs.pipeline.BatchedCodecPipeline
config.set({"codec_pipeline.name": "zarr.core.codec_pipeline.BatchedCodecPipeline"})
assert get_pipeline_class() == zarr.core.codec_pipeline.BatchedCodecPipeline

_mock = Mock()

Expand Down