From cb446505fd79eec72decaa40ad7795832d963785 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 11:27:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lib/iris/coords.py | 7 ++----- lib/iris/tests/unit/coords/test_Coord.py | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/iris/coords.py b/lib/iris/coords.py index 6a3d830ea0a..ea3cf6e7991 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -2106,8 +2106,7 @@ def cell(self, index): return Cell(point, bound) def collapsed(self, dims_to_collapse: Optional[Dims] = None) -> "Coord": - """ - Returns a copy of this coordinate, which has been collapsed along the specified dimensions. + """Returns a copy of this coordinate, which has been collapsed along the specified dimensions. Replaces the points & bounds with a simple bounded region. """ @@ -2133,9 +2132,7 @@ def serialize( # array we can loop through. work_array = np.moveaxis(x, axis, range(-len(axis), 0)) out_shape = work_array.shape[: -len(axis)] - work_array = work_array.reshape( - np.prod(out_shape, dtype=int), -1 - ) + work_array = work_array.reshape(np.prod(out_shape, dtype=int), -1) joined = [] for arr_slice in work_array: diff --git a/lib/iris/tests/unit/coords/test_Coord.py b/lib/iris/tests/unit/coords/test_Coord.py index 9ef448b72ec..714289dd097 100644 --- a/lib/iris/tests/unit/coords/test_Coord.py +++ b/lib/iris/tests/unit/coords/test_Coord.py @@ -581,9 +581,7 @@ def test_string_nd_second(self): def test_string_nd_bounds_first(self): self.setupTestArrays((3, 4)) - coord = AuxCoord( - self.pts_real.astype(str), bounds=self.bds_real.astype(str) - ) + coord = AuxCoord(self.pts_real.astype(str), bounds=self.bds_real.astype(str)) collapsed_coord = coord.collapsed(0) @@ -607,9 +605,7 @@ def test_string_nd_bounds_first(self): def test_string_nd_bounds_second(self): self.setupTestArrays((3, 4)) - coord = AuxCoord( - self.pts_real.astype(str), bounds=self.bds_real.astype(str) - ) + coord = AuxCoord(self.pts_real.astype(str), bounds=self.bds_real.astype(str)) collapsed_coord = coord.collapsed(1)