diff --git a/docs/iris/src/whatsnew/2.2.rst b/docs/iris/src/whatsnew/2.2.rst index 1eff99ecb4..61a52e3784 100644 --- a/docs/iris/src/whatsnew/2.2.rst +++ b/docs/iris/src/whatsnew/2.2.rst @@ -85,6 +85,8 @@ Iris 2.2 Dependency updates Bugs Fixed ========== +* Cube equality of boolean data is now handled correctly. + * The bug has been fixed that prevented printing time coordinates with bounds when the time coordinate was measured on a long interval (that is, ``months`` or ``years``). diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 88b8a39347..8457b53ab4 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -3047,11 +3047,10 @@ def __eq__(self, other): result = not (coord_comparison['not_equal'] or coord_comparison['non_equal_data_dimension']) - # having checked everything else, check approximate data - # equality - loading the data if has not already been loaded. + # Having checked everything else, check approximate data equality. if result: - result = np.all(np.abs(self.data - other.data) < 1e-8) - + result = da.allclose(self.core_data(), + other.core_data()).compute() return result # Must supply __ne__, Python does not defer to __eq__ for negative equality diff --git a/requirements/core.txt b/requirements/core.txt index eb7d39ca5d..48ee3f1dfd 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -7,7 +7,7 @@ cartopy #conda: proj4<6 cf-units>=2 cftime -dask[array]>=1.1.0 #conda: dask>=1.1.0 +dask[array]>=1.2.0 #conda: dask>=1.2.0 matplotlib>=2,<3 netcdf4 numpy>=1.14