Repository navigation
feat: narrow partial reads of uncompressed chunks within a single row - #1
Open
bendichter wants to merge 1 commit into
Open
bendichter wants to merge 1 commit into
bendichter wants to merge 1 commit into
Conversation
When a selection touches one index along the first axis, apply the same row window along the next axis, and so on. arr[t, y0:y1, x0:x1] then fetches rows y0 to y1 of frame t instead of the whole frame, and a single item is fetched for a point. The fetched block keeps the narrowed axes with length 1, so the shifted selection applies to it unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Stacked on
bytes-partial-decode(zarr-developers#4458). This PR is against that branch in the fork so the diff shows only the new change.The parent PR reads the rows along the first axis that a selection touches. This extends it to the case where the selection touches a single row: the same row window is then applied along the next axis, and so on. For a
(T, Y, X)chunk,arr[t, y0:y1, x0:x1]fetches rowsy0toy1of frametinstead of the whole frame, andarr[t, y, x]fetches one item.For example, say you have a stack of image frames through time (i.e. a video): (T, Y, X), and you wanted a region of a single frame.
bytes-partial-decode: Only the desired row (frame) is read, but you must read the entire row (frame)How it works:
_axis_windowis the per-axis logic that_row_windowhad: the first and last index a selector touches, and the selector shifted to start at zero._block_windowwalks the axes from the first. It records each axis's window and continues to the next axis only while the window is a single index. It returns the block's offset in items, the block's shape, and the shifted selection.For reviewers
test_block_windowchecks, for each case, that the shifted selection picks the same items from the block as the original selection does from the chunk.Author attestation
TODO
docs/user-guide/*.mdchanges/(extends the parent PR'schanges/4458.feature.md; needs its own file if opened upstream separately)🤖 Generated with Claude Code