You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically DataTree.__getitem__ will currently return more things than DataTree.__contains__ will actually tell you are "in" the tree, which can be confusing.
To fix this __contains__ should support path-like syntax.
I also think that it's convenient that we can separate the "is this key in the local node's variables" question from the "is this path in the tree anywhere" question. In the former case the key will never have a / character and the latter case it will always have one, so we could perhaps think of this like overloading the __contains__ method to behave slightly differently for str vs PathLike types.
The text was updated successfully, but these errors were encountered:
What is your issue?
Summarizing xarray-contrib/datatree#240 (comment):
Basically
DataTree.__getitem__
will currently return more things thanDataTree.__contains__
will actually tell you are "in
" the tree, which can be confusing.To fix this
__contains__
should support path-like syntax.The text was updated successfully, but these errors were encountered: