-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Index variables loaded from dask can be computed twice #1533
Comments
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the |
Still valid in xarray 0.13 import xarray
import numpy
import dask.array
def kernel():
print("Kernel invoked!")
return numpy.array([100, 200])
data = dask.array.Array(name='foo', dask={('foo', 0): (kernel, )}, chunks=((2,),), dtype=float)
ds = xarray.Dataset(coords={'z': ('z', data)}) output:
|
Nice example! I tracked this down to
We need to replace the appropriate objects in |
We should probably merge my merging refactor before doing much more on
this...
…On Wed, Oct 2, 2019 at 7:28 AM Deepak Cherian ***@***.***> wrote:
Nice example!
I tracked this down to
1. as_variable being called when extracting the index. This seems
sensible.
https://github.com/pydata/xarray/blob/21705e61503fb49f000186c0d556e5623bd5ac82/xarray/core/merge.py#L413-L420
2. as_variable being called again in the expand_variable_dicts call in
merge_core (should be avoided):
https://github.com/pydata/xarray/blob/21705e61503fb49f000186c0d556e5623bd5ac82/xarray/core/merge.py#L493-L497
We need to replace the appropriate objects in aligned with IndexVariables
from indexes if indexes is not None.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1533?email_source=notifications&email_token=AAJJFVQSTUPMQV6FAQGHX5LQMSVXFA5CNFSM4DYTHFMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAE6GKI#issuecomment-537518889>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJJFVW6FY37NVRUPXSMQU3QMSVXFANCNFSM4DYTHFMA>
.
|
Haha I thought it was already in! |
Adding if not isinstance(coords, Frozen):
coords.update(indexes) before the Lines 455 to 462 in 283b4fe
|
as reported by @crusaderky in #1522
The text was updated successfully, but these errors were encountered: