Support gzip and zlib 'level' of -1 in v2 metadata - #106
Merged
normanrz merged 1 commit intoSep 21, 2026
Merged
Conversation
Other implementations write zlib's Z_DEFAULT_COMPRESSION (-1) as the 'level' of gzip and zlib, meaning "let the library choose". Both codecs rejected it while parsing .zarray, so such an array could not be opened. Deflater takes -1 as-is, so only the lower bound of the check moves. Reported for gzip in mobie/mobie-io#181. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Hi @normanrz, would be great if that could be merged and released soon, as it currently is a blocker for a mobie-io zarr3 release; unless I comment out a few valid tests :-) |
Member
|
0.3.1 is out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
numcodecs writes zlib's
Z_DEFAULT_COMPRESSION(-1) as thelevelof gzip and zlib compressors, meaning "let the library choose". Both v2 codecs rejected it while parsing.zarray, so such an array could not be opened at all.Deflatertakes -1 as-is, so the value is passed through unchanged and only the lower bound of the check moves. Same shape as #102, which fixed the analogous-1gap for blosc'sshuffle.ZlibCodeccarried the identical check, so it is fixed here too.Related issues
Reported for gzip in mobie/mobie-io#181, on a dataset written by n5-zarr.
Checklist
ZarrV2Test.testReadDefaultCompressionLevel, parameterized over gzip and zlib, following the pattern of Support blosc 'shuffle' of -1 in v2 metadata #102's testlevelrange only widens🤖 Generated with Claude Code