Skip to content

Commit 17d0e3d

Browse files
committed
set default clevel to 0
1 parent 600b455 commit 17d0e3d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

numcodecs/zstd.pyx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ MICRO_VERSION_NUMBER = (
6666
(MINOR_VERSION_NUMBER * 100)
6767
)
6868
__version__ = '%s.%s.%s' % (MAJOR_VERSION_NUMBER, MINOR_VERSION_NUMBER, MICRO_VERSION_NUMBER)
69-
DEFAULT_CLEVEL = 1
69+
DEFAULT_CLEVEL = 0
7070
MAX_CLEVEL = ZSTD_maxCLevel()
7171

7272

@@ -79,7 +79,7 @@ def compress(source, int level=DEFAULT_CLEVEL, bint checksum=False):
7979
Data to be compressed. Can be any object supporting the buffer
8080
protocol.
8181
level : int
82-
Compression level (1-22).
82+
Compression level (-131072 to 22).
8383
checksum : bool
8484
Flag to enable checksums. The default is False.
8585
@@ -97,8 +97,6 @@ def compress(source, int level=DEFAULT_CLEVEL, bint checksum=False):
9797
bytes dest
9898

9999
# check level
100-
if level <= 0:
101-
level = DEFAULT_CLEVEL
102100
if level > MAX_CLEVEL:
103101
level = MAX_CLEVEL
104102

@@ -218,7 +216,7 @@ class Zstd(Codec):
218216
Parameters
219217
----------
220218
level : int
221-
Compression level (1-22).
219+
Compression level (-131072 to 22).
222220
checksum : bool
223221
Flag to enable checksums. The default is False.
224222

0 commit comments

Comments
 (0)