Skip to content
Open
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
1 change: 1 addition & 0 deletions changes/3874.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `cast_value` and `scale_offset` codecs.
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ remote = [
gpu = [
"cupy-cuda12x",
]
cast-value-rs = ["cast-value-rs"]
cli = ["typer"]
optional = ["universal-pathlib"]

Expand Down Expand Up @@ -191,6 +192,16 @@ run-benchmark = "pytest --benchmark-enable tests/benchmarks"
serve-coverage-html = "python -m http.server -d htmlcov 8000"
list-env = "pip list"

[tool.hatch.envs.cast-value]
template = "test"
features = ["cast-value-rs"]

[[tool.hatch.envs.cast-value.matrix]]
python = ["3.12"]

[tool.hatch.envs.cast-value.scripts]
run = "pytest tests/test_codecs/test_cast_value.py {args:}"

[tool.hatch.envs.gputest]
template = "test"
extra-dependencies = [
Expand Down
6 changes: 6 additions & 0 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from zarr.codecs.blosc import BloscCname, BloscCodec, BloscShuffle
from zarr.codecs.bytes import BytesCodec, Endian
from zarr.codecs.cast_value import CastValue
from zarr.codecs.crc32c_ import Crc32cCodec
from zarr.codecs.gzip import GzipCodec
from zarr.codecs.numcodecs import (
Expand All @@ -27,6 +28,7 @@
Zlib,
Zstd,
)
from zarr.codecs.scale_offset import ScaleOffset
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
from zarr.codecs.transpose import TransposeCodec
from zarr.codecs.vlen_utf8 import VLenBytesCodec, VLenUTF8Codec
Expand All @@ -38,9 +40,11 @@
"BloscCodec",
"BloscShuffle",
"BytesCodec",
"CastValue",
"Crc32cCodec",
"Endian",
"GzipCodec",
"ScaleOffset",
"ShardingCodec",
"ShardingCodecIndexLocation",
"TransposeCodec",
Expand All @@ -50,12 +54,14 @@
]

register_codec("blosc", BloscCodec)
register_codec("cast_value", CastValue)
register_codec("bytes", BytesCodec)

# compatibility with earlier versions of ZEP1
register_codec("endian", BytesCodec)
register_codec("crc32c", Crc32cCodec)
register_codec("gzip", GzipCodec)
register_codec("scale_offset", ScaleOffset)
register_codec("sharding_indexed", ShardingCodec)
register_codec("zstd", ZstdCodec)
register_codec("vlen-utf8", VLenUTF8Codec)
Expand Down
Loading
Loading