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
9 changes: 9 additions & 0 deletions fixture/pcodec/codec.10/config.json
Original file line number Diff line number Diff line change
@@ -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"
}
Binary file added fixture/pcodec/codec.10/encoded.00.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.01.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.02.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.03.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.04.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.05.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.06.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.07.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.08.dat
Binary file not shown.
Binary file added fixture/pcodec/codec.10/encoded.09.dat
Binary file not shown.
11 changes: 6 additions & 5 deletions numcodecs/pcodec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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":
Expand Down
1 change: 1 addition & 0 deletions numcodecs/tests/test_pcodec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
]


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ zfpy = [
"zfpy>=1.0.0"
]
pcodec = [
"pcodec>=0.3,<0.4",
"pcodec>=1,<2",
]
crc32c = [
"crc32c>=2.7",
Expand Down
Loading