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

How to efficiently test the huge inherited Dataset API #9347

Closed
TomNicholas opened this issue Aug 13, 2024 · 2 comments
Closed

How to efficiently test the huge inherited Dataset API #9347

TomNicholas opened this issue Aug 13, 2024 · 2 comments
Labels
topic-DataTree Related to the implementation of a DataTree class topic-internals topic-testing

Comments

@TomNicholas
Copy link
Member

What is your issue?

xarray.Dataset has a ginormous API, and eventually the entire thing should also be available on DataTree. However we probably still need to test this copied API, because the majority of it will be altered via the @map_over_subtree decorator. How can we do that without also copying thousands of lines of tests from xarray.tests?

@TomNicholas TomNicholas added topic-internals topic-testing topic-DataTree Related to the implementation of a DataTree class labels Aug 13, 2024
@TomNicholas
Copy link
Member Author

@jhamman made a good suggestion today: reroute as much as possible internally through a node._to_temp_dataset() private method, similarly to what we do in xarray.DataArray.

This would mean that every method which is intended to act the same as it does on Dataset will essentially be guaranteed to act the same, because internally it calls the corresponding Dataset method. This could make the number of tests required for #41 much lower.

@TomNicholas
Copy link
Member Author

I think this issue is outdated - after #9585 we no longer blindly inherit methods, and the plan is to add tests for them as we re-add them.

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 topic-internals topic-testing
Projects
None yet
Development

No branches or pull requests

1 participant