Closed dstansby closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.98%. Comparing base (
c5c4698
) to head (c88a6c7
). Report is 1 commits behind head on main.
The only immediate question in my mind is whether this adds any additional copies of the array.
Using the test script below on my laptop shows that with numpy 2.0.1:
copy
not set, a copy is madecopy=False
errorscopy
not set, a copy is madecopy=False
, a copy is not madeSo behaviour with this PR is the same as before.
import numpy as np
import zarr
z = zarr.zeros((100, 100), chunks=(10, 10), dtype='i4')
print("Copy not set")
print("Same memory?", id(z[:]) == id(np.array(z)))
@dstansby - have you looked into the test failure in the minimum_build
. Certainly looks unrelated but something we should probably fix.
Yes, in the top comment here I said:
The one test failure is an issue with a new version of numcodecs (0.13.0) which is a simple fix, but easier to make when we bump the numocdecs version in the test dependencies, so I'd advocate for merging this PR and dealing with the numcodecs bump in a follow up PR.
Trusting @dstansby to be Mr. Fixit! :smile:
This updates array for numpy 2.1, specifically by implementing the copy keyword argument.
The one test failure is an issue with a new version of numcodecs (0.13.0) which is a simple fix, but easier to make when we bump the numocdecs version in the test dependencies, so I'd advocate for merging this PR and dealing with the numcodecs bump in a follow up PR.
TODO: