@@ -31,13 +31,17 @@ class PCodec(Codec):
3131 Configures whether Pcodec should try to infer the best "mode" or
3232 structure of the data (e.g. approximate multiples of 0.1) to improve
3333 compression ratio, or skip this step and just use the numbers as-is
34- (Classic mode).
34+ (Classic mode). Note that the "try*" specs are not currently supported.
3535 delta_spec : {"auto", "none", "try_consecutive", "try_lookback"}
3636 Configures the delta encoding strategy. By default, uses "auto" which
3737 will try to infer the best encoding order.
38+ paging_spec : {"equal_pages_up_to"}
39+ Configures the paging strategy. Only "equal_pages_up_to" is currently
40+ supported.
3841 delta_encoding_order : int or None
3942 Explicit delta encoding level from 0-7. Only valid if delta_spec is
40- "try_consecutive" or None.
43+ "try_consecutive" or "auto" (to support backwards compatibility with
44+ older versions of this codec).
4145 equal_pages_up_to : int
4246 Divide the chunk into equal pages of up to this many numbers.
4347 """
@@ -47,6 +51,7 @@ class PCodec(Codec):
4751 def __init__ (
4852 self ,
4953 level : int = 8 ,
54+ * ,
5055 mode_spec : Literal ["auto" , "classic" ] = "auto" ,
5156 delta_spec : Literal ["auto" , "none" , "try_consecutive" , "try_lookback" ] = "auto" ,
5257 paging_spec : Literal ["equal_pages_up_to" ] = "equal_pages_up_to" ,
@@ -83,7 +88,7 @@ def _get_chunk_config(self):
8388 )
8489 else :
8590 match self .delta_spec :
86- case "auto" | None :
91+ case "auto" :
8792 delta_spec = DeltaSpec .auto ()
8893 case "none" :
8994 delta_spec = DeltaSpec .none ()
@@ -95,7 +100,7 @@ def _get_chunk_config(self):
95100 raise ValueError (f"delta_spec { self .delta_spec } is not supported" )
96101
97102 match self .paging_spec :
98- case "equal_pages_up_to" | None :
103+ case "equal_pages_up_to" :
99104 paging_spec = PagingSpec .equal_pages_up_to (self .equal_pages_up_to )
100105 case _:
101106 raise ValueError (f"paging_spec { self .paging_spec } is not supported" )
0 commit comments