Skip to content

Commit caa6064

Browse files
committed
make none legal to avoid API change
Signed-off-by: mwlon <m.w.loncaric@gmail.com>
1 parent 63f05e9 commit caa6064

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

numcodecs/pcodec.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ class PCodec(Codec):
2727
structure of the data (e.g. approximate multiples of 0.1) to improve
2828
compression ratio, or skip this step and just use the numbers as-is
2929
(Classic mode). Note that the "try*" specs are not currently supported.
30-
delta_spec : {"auto", "no_op", "try_consecutive", "try_lookback"}
30+
delta_spec : {"auto", "no_op", "none", "try_consecutive", "try_lookback"}
3131
Configures the delta encoding strategy. By default, uses "auto" which
32-
will try to infer the best encoding order.
32+
will try to infer the best encoding order. "none" is equivalent to
33+
"no_op" and may be removed in the future.
3334
paging_spec : {"equal_pages_up_to"}
3435
Configures the paging strategy. Only "equal_pages_up_to" is currently
3536
supported.
@@ -48,7 +49,7 @@ def __init__(
4849
level: int = 8,
4950
*,
5051
mode_spec: Literal["auto", "classic"] = "auto",
51-
delta_spec: Literal["auto", "no_op", "try_consecutive", "try_lookback"] = "auto",
52+
delta_spec: Literal["auto", "no_op", "none", "try_consecutive", "try_lookback"] = "auto",
5253
paging_spec: Literal["equal_pages_up_to"] = "equal_pages_up_to",
5354
delta_encoding_order: int | None = None,
5455
equal_pages_up_to: int = DEFAULT_MAX_PAGE_N,

numcodecs/tests/test_pcodec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
PCodec(equal_pages_up_to=300),
2525
PCodec(delta_encoding_order=2),
2626
PCodec(delta_spec="try_lookback"),
27-
PCodec(delta_spec="none"), # type: ignore[arg-type]
27+
PCodec(delta_spec="none"),
2828
PCodec(delta_spec="try_consecutive", delta_encoding_order=1),
2929
PCodec(delta_spec="no_op"),
3030
]

0 commit comments

Comments
 (0)