From 7e2377ffc29be6d1ed07b831e4c460ba1e16966e Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Mon, 5 Aug 2019 12:39:56 +0100 Subject: [PATCH] collapsed lazy coord points should stay lazy --- lib/iris/tests/unit/coords/test_Coord.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index 0ea7b133ce..11a6378daf 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -280,6 +280,13 @@ def test_dim_1d(self): self.assertArrayEqual(collapsed_coord.bounds, [[coord.bounds.min(), coord.bounds.max()]]) + def test_lazy_points(self): + # Lazy points should stay lazy after collapse. + coord = AuxCoord(points=da.from_array(np.arange(5), chunks=5)) + collapsed_coord = coord.collapsed() + self.assertTrue(collapsed_coord.has_lazy_bounds()) + self.assertTrue(collapsed_coord.has_lazy_points()) + def test_numeric_nd(self): coord = AuxCoord(points=np.array([[1, 2, 4, 5], [4, 5, 7, 8],