Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 8, 2024
1 parent 68082f0 commit cb44650
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 2 additions & 5 deletions lib/iris/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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:
Expand Down
8 changes: 2 additions & 6 deletions lib/iris/tests/unit/coords/test_Coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit cb44650

Please sign in to comment.