xarray-contrib / xarray-array-testing

testing framework for testing duck array compatibility with xarray
Other
1 stars 2 forks source link

more reduction tests #11

Closed keewis closed 4 weeks ago

keewis commented 1 month ago

This adds a few more reduction (or index reduction) tests, which should cover everything xarray supports and which is part of the array API. xarray additionally provides sorting-based reductions like quantile and median, plus rank which I don't quite understand.

keewis commented 1 month ago

looks like numpy<2.1 didn't have cumulative_sum, so we'll have to wait until xarray supports numpy=2.1 (i.e. whenever we get around to releasing a new version).

We could probably merge all, any, min, and max into the main reduce test, but I do like the clear separation that gives us (even though we duplicate the code twice).

Other than that, this should be ready for review, @TomNicholas

keewis commented 1 month ago

looks like that finally did it. So with that we only need to decide what to do about the code duplication (or if we can, as I would suggest, leave it as is), and this should be good to merge.

keewis commented 4 weeks ago

assuming that the code duplication is nothing urgent, I'm going to go ahead and merge

TomNicholas commented 4 weeks ago

Sorry Justus! This looks great though.