Closed cmalinmayor closed 4 days ago
Do you then later go on to use data outside of the context? Or is the warning seen simply by calling to_dask?
Managing file handles have been tricky with dask and "delayed" reads. You can mostly just ignore it, but I can also try to silence the warning specifically in the dask case
Oh, never mind... yeah it wouldn't matter whether you use data there or not. We basically have to leave the handle open for dask, so the warning shows up. so I should just toss that warning in the dask case. Thanks for opening the issue
now that I'm back and playing with this, I was unable to reproduce it, but then updated dask and was. So this problem is new to dask 2024.8, (and tests are indeed currently failing accordingly, which is nice)
Description
I was trying to load an nd2 into a dask array. Calling .to_dask on my ND2File inside the with statement results in a garbage colleciton warning. @tlambert03, can you explain why this is happening? I'm not sure if its expected or not, or if it's an actual problem. It also happens if you just call nd2.imread with dask=True.
What I Did
Minimal example 1:
Minimal Example 2:
Warning: