Skip to content
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

Disable methods implemented by map_over_subtree and inheritance from Dataset #9582

Closed
TomNicholas opened this issue Oct 4, 2024 · 0 comments · Fixed by #9585
Closed

Disable methods implemented by map_over_subtree and inheritance from Dataset #9582

TomNicholas opened this issue Oct 4, 2024 · 0 comments · Fixed by #9585
Labels
topic-DataTree Related to the implementation of a DataTree class

Comments

@TomNicholas
Copy link
Member

TomNicholas commented Oct 4, 2024

What is your issue?

Today we discussed how there are a bunch of methods for DataTree that are implemented using the somewhat sketchy approach of taking the equivalent method from Dataset, then applying it using map_over_subtree. Because there are so many of these methods, and they are ultimately just syntactic sugar that saves the user about 3 lines of code each, these were originally implemented in xarray-contrib/datatree without tests.

We decided that it would be safer to disable these methods for now, and then add them back in as we double-check that they actually work / write unit tests for them. The logic being that it would be less painful to just force users to write out their loops over the tree in early versions than it would be for our new inheritance model to break the method in some subtle way without anyone realizing.

Some very important methods we will try to get into the first release (particularly isel/sel and arithmetic).

The code with the lists of methods to be disabled is here

https://github.com/pydata/xarray/blob/main/xarray/core/datatree_ops.py

cc @shoyer, @flamingbear, @kmuehlbauer, @owenlittlejohns , @castelao, @keewis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-DataTree Related to the implementation of a DataTree class
Projects
Development

Successfully merging a pull request may close this issue.

1 participant