Skip to content

Conversation

@mscheltienne
Copy link
Contributor

Follow-up on #3648

@d-v-b

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jan 12, 2026
@mscheltienne
Copy link
Contributor Author

Exactly what I just realized- copy was introduced in numpy 2.1 which is not that old. In this case, @d-v-b I would advocate to keep the current implementation of #3648 with an implicit copy if a view is impossible- which in theory should not occur. Otherwise, I can also conditionally add the copy argument for numpy >= 2.1, let me know which solution you prefer for Zarr.

@mscheltienne
Copy link
Contributor Author

I added a version with a compat function in this PR, which retains the behavior across all numpy version. I'll let you decide if this is worth the added maintenance burden or if using the defaults as implemented in #3648 is sufficient. Feel free to close if you prefer #3648.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.89%. Comparing base (7166a8d) to head (afbb472).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/zarr/_compat.py 50.00% 4 Missing ⚠️
src/zarr/codecs/vlen_utf8.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3649      +/-   ##
==========================================
- Coverage   60.90%   60.89%   -0.01%     
==========================================
  Files          86       86              
  Lines       10174    10182       +8     
==========================================
+ Hits         6196     6200       +4     
- Misses       3978     3982       +4     
Files with missing lines Coverage Δ
src/zarr/codecs/vlen_utf8.py 27.58% <33.33%> (-0.49%) ⬇️
src/zarr/_compat.py 10.52% <50.00%> (+10.52%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@d-v-b d-v-b left a comment

Choose a reason for hiding this comment

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

this looks great, thank you!

@d-v-b d-v-b merged commit 1c05c1a into zarr-developers:main Jan 12, 2026
31 checks passed
@mscheltienne mscheltienne deleted the better-fix-for-numpy-dep branch January 12, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants