From cf08bd64c29fbc6b0eb7f0e49e6971242a4c47d5 Mon Sep 17 00:00:00 2001 From: cpelley Date: Fri, 11 Jan 2019 12:48:13 +0000 Subject: [PATCH 1/2] ENH: Working cube data equality --- docs/iris/src/whatsnew/2.2.rst | 2 ++ lib/iris/cube.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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 From 2165fc9a5c206cff3c7c356a8066500044649001 Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Tue, 1 Oct 2019 15:28:15 +0100 Subject: [PATCH 2/2] Pin dask to >=1.2 --- requirements/core.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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