-
-
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
Why do arithmetic operations between two datatrees depend on the order of subtrees? #9643
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Thanks for raising this! You're being a helpful guinea pig by messing around with what's on This was originally intentional behaviour by me, but @shoyer also flagged this as undesirable, and his PR #9636 should make it work as you expect. See |
What is your issue?
I was surprised by the following datatree behaviour.
Adding to datatrees,
tree1 + tree2
, which both have nodes/a
and/b
, seems to yield the result I'd expect only ifa
andb
appear in the same order (first node:a
, second node:b
).If the order in
tree1
andtree2
is reversed, then the datasets in the treetree1 + tree2
have zero data variables.Create 2 Trees
output:
tree1
andtree2
are exactly the same except that the order of the subtrees is different.This works as I'd expect
output:
This does not work as I'd expect
output:
You can see, there are no data variables in the dataset. Why does tree1/a not automatically align with tree2/a?
Sorry if I'm missing something obvious. But is this a desired behaviour?
The text was updated successfully, but these errors were encountered: