-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DayNightCompositor triggers early dask computation #2614
Comments
The key point of confusion here is that My guess, which is not extremely well founded, is that dask is being given DataArrays and it says "these aren't dask arrays that contain an internal meta representation, so I'll call the low-level function with fake data and see what the low-level function produces". I'm not entirely sure though, but I can't imagine dask is doing the meta checking on normal dask arrays as that would be a huge waste of time. I'll see if I can test this. |
I replaced the |
Draft PR going here, checking the failing tests. |
Describe the bug
Loading composites that use the
DayNightCompositor
trigger an early dask computation.To Reproduce
Expected behavior
I expect that exactly one computation occurs, in
ls.compute()
. Therefore, I expect no output.Actual results
In reality, this fails with:
NB: it says there were three computations, even though one would expect it should fail as soon as it tries to calculate number two — see "Additional context" for comments on why this happens.
Environment Info:
Additional context
The early computes that happen before
ls.compute()
are not easily seen, because theValueError
raised insatpy.tests.utils.CustomScheduler
is swallowed by dask incompute_meta
. See #2615 for more details, but briefly:https://github.com/dask/dask/blob/2023.9.3/dask/array/utils.py#L95-L96
When we run with
max_computes=0
and set a breakpoint insatpy/tests/utils.py:288
, we can investigate the traceback and whycompute_meta
gets called:The
da.where
call insatpy.composites
passes xarray types to dask:I'm still not sure why this triggers a computation of metadata, but perhaps it could be avoided by passing dask array or using xarray.where.
The text was updated successfully, but these errors were encountered: