diff --git a/fixture/pcodec/codec.10/config.json b/fixture/pcodec/codec.10/config.json new file mode 100644 index 00000000..f5ae0a54 --- /dev/null +++ b/fixture/pcodec/codec.10/config.json @@ -0,0 +1,9 @@ +{ + "delta_encoding_order": null, + "delta_spec": "no_op", + "equal_pages_up_to": 262144, + "id": "pcodec", + "level": 8, + "mode_spec": "auto", + "paging_spec": "equal_pages_up_to" +} \ No newline at end of file diff --git a/fixture/pcodec/codec.10/encoded.00.dat b/fixture/pcodec/codec.10/encoded.00.dat new file mode 100644 index 00000000..77351ac6 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.00.dat differ diff --git a/fixture/pcodec/codec.10/encoded.01.dat b/fixture/pcodec/codec.10/encoded.01.dat new file mode 100644 index 00000000..27aa7746 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.01.dat differ diff --git a/fixture/pcodec/codec.10/encoded.02.dat b/fixture/pcodec/codec.10/encoded.02.dat new file mode 100644 index 00000000..cb40ea06 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.02.dat differ diff --git a/fixture/pcodec/codec.10/encoded.03.dat b/fixture/pcodec/codec.10/encoded.03.dat new file mode 100644 index 00000000..7f95971e Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.03.dat differ diff --git a/fixture/pcodec/codec.10/encoded.04.dat b/fixture/pcodec/codec.10/encoded.04.dat new file mode 100644 index 00000000..658d8487 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.04.dat differ diff --git a/fixture/pcodec/codec.10/encoded.05.dat b/fixture/pcodec/codec.10/encoded.05.dat new file mode 100644 index 00000000..cbc5f158 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.05.dat differ diff --git a/fixture/pcodec/codec.10/encoded.06.dat b/fixture/pcodec/codec.10/encoded.06.dat new file mode 100644 index 00000000..bc2bae9b Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.06.dat differ diff --git a/fixture/pcodec/codec.10/encoded.07.dat b/fixture/pcodec/codec.10/encoded.07.dat new file mode 100644 index 00000000..658ab676 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.07.dat differ diff --git a/fixture/pcodec/codec.10/encoded.08.dat b/fixture/pcodec/codec.10/encoded.08.dat new file mode 100644 index 00000000..71b72e72 Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.08.dat differ diff --git a/fixture/pcodec/codec.10/encoded.09.dat b/fixture/pcodec/codec.10/encoded.09.dat new file mode 100644 index 00000000..0e71ca3d Binary files /dev/null and b/fixture/pcodec/codec.10/encoded.09.dat differ diff --git a/numcodecs/pcodec.py b/numcodecs/pcodec.py index e214f781..71add9b9 100644 --- a/numcodecs/pcodec.py +++ b/numcodecs/pcodec.py @@ -27,9 +27,10 @@ class PCodec(Codec): structure of the data (e.g. approximate multiples of 0.1) to improve compression ratio, or skip this step and just use the numbers as-is (Classic mode). Note that the "try*" specs are not currently supported. - delta_spec : {"auto", "none", "try_consecutive", "try_lookback"} + delta_spec : {"auto", "no_op", "none", "try_consecutive", "try_lookback"} Configures the delta encoding strategy. By default, uses "auto" which - will try to infer the best encoding order. + will try to infer the best encoding order. "none" is equivalent to + "no_op" and may be removed in the future. paging_spec : {"equal_pages_up_to"} Configures the paging strategy. Only "equal_pages_up_to" is currently supported. @@ -48,7 +49,7 @@ def __init__( level: int = 8, *, mode_spec: Literal["auto", "classic"] = "auto", - delta_spec: Literal["auto", "none", "try_consecutive", "try_lookback"] = "auto", + delta_spec: Literal["auto", "no_op", "none", "try_consecutive", "try_lookback"] = "auto", paging_spec: Literal["equal_pages_up_to"] = "equal_pages_up_to", delta_encoding_order: int | None = None, equal_pages_up_to: int = DEFAULT_MAX_PAGE_N, @@ -82,8 +83,8 @@ def _get_chunk_config(self): match self.delta_spec: case "auto": delta_spec = DeltaSpec.auto() - case "none": - delta_spec = DeltaSpec.none() + case "no_op" | "none": # legacy support for "none" + delta_spec = DeltaSpec.no_op() case "try_consecutive": delta_spec = DeltaSpec.try_consecutive(self.delta_encoding_order) case "try_lookback": diff --git a/numcodecs/tests/test_pcodec.py b/numcodecs/tests/test_pcodec.py index d0520b45..fe26b3c4 100644 --- a/numcodecs/tests/test_pcodec.py +++ b/numcodecs/tests/test_pcodec.py @@ -26,6 +26,7 @@ PCodec(delta_spec="try_lookback"), PCodec(delta_spec="none"), PCodec(delta_spec="try_consecutive", delta_encoding_order=1), + PCodec(delta_spec="no_op"), ] diff --git a/pyproject.toml b/pyproject.toml index 164ba5dc..a1407633 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ zfpy = [ "zfpy>=1.0.0" ] pcodec = [ - "pcodec>=0.3,<0.4", + "pcodec>=1,<2", ] crc32c = [ "crc32c>=2.7",