datatree icon indicating copy to clipboard operation
datatree copied to clipboard

How to efficiently test the huge inherited Dataset API

Open TomNicholas opened this issue 2 years ago • 1 comments

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 avatar Aug 20 '21 17:08 TomNicholas

@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 avatar May 25 '22 14:05 TomNicholas