tlambert03 / nd2

Full-featured nd2 (Nikon NIS Elements) file reader for python. Outputs to numpy, dask, and xarray. Exhaustive metadata extraction
https://tlambert03.github.io/nd2
BSD 3-Clause "New" or "Revised" License
53 stars 15 forks source link

fix numpy 1.22.4 bug #55

Closed tlambert03 closed 2 years ago

tlambert03 commented 2 years ago

Numpy 1.22.4 (specifically, https://github.com/numpy/numpy/pull/21446) changed the way that arrays are created from buffers. It is causing tests here to fail specifically in the case where a dask array is requested without using the "ResourceBackedArray" protocol, the underlying file is closed, and then the array is computed.

To be sure, this was a risky operation to begin with :joy: ... so the numpy error is good.

This fixes the copy operation that should prevent it