Closed VolkerH closed 2 years ago
Challenge accepted! :). Thanks this is exactly what I was looking to find. Your tests are very helpful. Worse case scenario I can make returning the proxy an optional parameter
Worse case scenario I can make returning the proxy an optional parameter
I think that may be useful in any scenario.
I think i've got a good solution, will push soon
I think #26 fixes this. but of course, feel free to reopen if you find more numpy incompatibilities!
Description
In this https://github.com/tlambert03/nd2/issues/19#issuecomment-965182850, @tlambert03 wrote:
The hidden issues are coming out of hiding. Where the NEP-18 mechanism would dispatch the dask array method corresponding to a numpy method when passing a dask array to the numpy method, this no longer works with the
DaskArrayProxy
. This triggers acompute()
on the array underlying the proxy where nocompute()
would have happened on a non-proxied array. In my case (large array) that kills the Linux kernel.To reproduce (here I use a 4d nd2-file):
test_nd2.py
Running these tests shows the problem
For me, the convenience of using NEP-18 dispatch almost outweighs the problem of a few open file handles without the array proxy. I guess the chances to get numpy to support ObjectProxies with NEP18 as well are fairly slim.