Port v2 filters to v3 and add the scale_offset codec - #350
Draft
asinghvi17 wants to merge 1 commit into
Draft
asinghvi17 wants to merge 1 commit into
asinghvi17 wants to merge 1 commit into
Conversation
v2 filters are readable and writable as zarr-python's `numcodecs.<id>` v3 codecs through `FilterCodec`, and `zcreate(...; zarr_format=3, filters)` now uses them. Codecs may change the element type via `encoded_type`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LH4S6Dry2jRaisNvj7dWU1
asinghvi17
added this pull request to stack #352
September 30, 2026 20:03
Coverage Report for CI Build 36769972476Coverage increased (+0.08%) to 90.567%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
asinghvi17
commented
Sep 30, 2026
| The zarr v3 `scale_offset` array->array codec: encodes `(x - offset) * scale` | ||
| and decodes `x / scale + offset` in the array's element type. | ||
| """ | ||
| struct ScaleOffset{S<:Real} <: V3Codec{:array, :array} |
Member
Author
There was a problem hiding this comment.
this should be ScaleOffsetCodec in line with the rest...
asinghvi17
commented
Sep 30, 2026
Member
Author
There was a problem hiding this comment.
@meggart worth a look here, not sure if this is necessarily what we want
This branch has not been deployed
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.
First part of #346, addressing this comment.
numcodecs.<id>v3 codecs, wrapped inFilterCodec.zcreate(...; zarr_format=3, filters)now uses them.scale_offsetcodec asScaleOffset.encoded_type.getfilterfor delta and quantize, which droppedastype.Tested round trips against zarr-python 3.4 in both directions.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LH4S6Dry2jRaisNvj7dWU1