Open agstephens opened 3 years ago
Since the average_over_dims
operation is not currently used in our production systems (e.g. the rook
WPS), the quick fix is just to load()
the xr.Dataset
before processing. This will not change the functionality. The only risk is that it will attempt to load any size of dataset from disk - so could cause memory issues. This is not a problem at this point in time because we don't use the functionality.
We can undo this in future when the xarray/pandas versions are brought into line.
I opened this issue here : pydata/xarray#5897. I believe the current bug has nothing to do with pandas or a version mismatch, rather then a PR introducing bugs on the xarray side.
All in all, this only happens in the test suite because of the time_bnds
variable that is present on some datasets. I would suggest either removing the variable, waiting for xarray or introducing a workaround directly in average_over_dims
to skip this faulty variable (which I can send a PR for). Everything but loading data unexpectedly.
Thanks @aulemahal I've just read this through. We aren't using average_over_dims
and we think it will be removed/refactored in the future, so a workaround can be introduced or the tests can be skipped
Description
Tests demonstrate an error. Computing with
ds.mean()
over an array containingcftime.datetime
objects is not yet implemented on dask arrays.Googling suggests that one solution is to force the data to be loaded, so it is no longer a delayed dask array, e.g.:
ds = ds.load()
What I Did
These tests demonstrate the error: