FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Widen ChunksLike type alias by chuckwondo · Pull Request #3990 · zarr-developers/zarr-python · GitHub

Widen ChunksLike type alias - #3990

Merged
d-v-b merged 3 commits into
zarr-developers:mainfrom
chuckwondo:iterable-chunkslike
May 20, 2026
Merged

Widen ChunksLike type alias#3990
d-v-b merged 3 commits into
zarr-developers:mainfrom
chuckwondo:iterable-chunkslike

Conversation

chuckwondo commented May 20, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Widen ChunksLike type alias to use Iterable instead of Sequence, and also remove None from the union.

Fixes #3869

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)

github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label May 20, 2026
Comment thread src/zarr/core/array.py Outdated
Comment on lines +4417 to +4422
max_bytes = None if shards is None else SHARDED_INNER_CHUNK_MAX_BYTES
chunks_normalized = (
guess_chunks(shape_parsed, item_size, max_bytes=max_bytes)
if chunks == "auto"
else normalize_chunks_nd(chunks, shape_parsed)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

[non-blocking] I have a mild preference for the original form, because it makes the conditional more obvious. IMO the second form obscures the branching inside the function call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'll restore the if/else block.

github-actions Bot removed the needs release notes Automatically applied to PRs which haven't added release notes label May 20, 2026

d-v-b left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

d-v-b commented May 20, 2026

Copy link
Copy Markdown
Contributor

thanks @chuckwondo, let me know when you're happy with things and I will merge

codecov Bot commented May 20, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.39%. Comparing base (6ebc031) to head (b149248).
⚠️ Report is 142 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3990      +/-   ##
==========================================
- Coverage   93.39%   93.39%   -0.01%     
==========================================
  Files          88       88              
  Lines       11840    11839       -1     
==========================================
- Hits        11058    11057       -1     
  Misses        782      782              
Files with missing lines Coverage Δ
src/zarr/core/array.py 97.88% <100.00%> (-0.01%) ⬇️
src/zarr/core/common.py 92.77% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

thanks @chuckwondo, let me know when you're happy with things and I will merge

Merge away!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider Iterable[Iterable[int]] for ChunksLike instead of Sequence[Sequence[int]]

2 participants


Back | FazBrowse Home | New Git URL