Skip to content

Error in average_over_dims: NotImplementedError: Computing the mean of an array containing cftime.datetime objects is not yet implemented on dask arrays. #185

@agstephens

Description

@agstephens
  • clisops version: 0.6.5
  • Python version: 3.7+
  • Operating System: All

Description

Tests demonstrate an error. Computing with ds.mean() over an array containing cftime.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:

============================================================== short test summary info ==============================================================
FAILED tests/ops/test_average.py::test_average_lat_xarray - NotImplementedError: Computing the mean of an array containing cftime.datetime objects...
FAILED tests/ops/test_average.py::test_average_lon_xarray - NotImplementedError: Computing the mean of an array containing cftime.datetime objects...
FAILED tests/ops/test_average.py::test_average_lat_nc - NotImplementedError: Computing the mean of an array containing cftime.datetime objects is ...
FAILED tests/ops/test_average.py::test_average_lon_nc - NotImplementedError: Computing the mean of an array containing cftime.datetime objects is ...
FAILED tests/ops/test_xarray_mean.py::test_xarray_da_mean_keep_attrs_true - NotImplementedError: Computing the mean of an array containing cftime....
======================================== 5 failed, 231 passed, 20 skipped, 330 warnings in 287.45s (0:04:47) ========================================

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions