Skip to content

feat: narrow partial reads of uncompressed chunks within a single row - #4611

Open
bendichter wants to merge 3 commits into
zarr-developers:mainfrom
bendichter:partial-decode-single-row
Open

bendichter wants to merge 3 commits into
zarr-developers:mainfrom
bendichter:partial-decode-single-row

Conversation

@bendichter

@bendichter bendichter commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

Summary

We have use-cases such as reading a small patch of a single frame of an image series, where it's possible and useful to extend the partial decode logic to inner dimensions. This identifies that specific indexing pattern and extends the current partial decode logic to efficiently read bytes in this case.

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

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>
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.90%. Comparing base (27f034e) to head (6e7d727).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4611   +/-   ##
=======================================
  Coverage   94.90%   94.90%           
=======================================
  Files          96       96           
  Lines       14048    14063   +15     
=======================================
+ Hits        13332    13347   +15     
  Misses        716      716           
Files with missing lines Coverage Δ
src/zarr/codecs/bytes.py 99.37% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

d-v-b and others added 2 commits November 9, 2026 19:13
@bendichter bendichter changed the title Narrow partial reads of uncompressed chunks within a single row feat: narrow partial reads of uncompressed chunks within a single row Nov 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants