From 063e45b8e3dd7583f44d4bc44f0ccde336e892ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:11:48 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- lib/iris/_data_manager.py | 8 +++++--- lib/iris/tests/unit/cube/test_Cube.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index c5b7df8e1c..d27d759161 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -161,9 +161,11 @@ def _deepcopy(self, memo, data=None): try: if iris.FUTURE.dataless_cube and data is None: shape = self.shape - elif (iris.FUTURE.dataless_cube and type(data) is str and data == iris.MAINTAIN_DATA) or ( - data is None - ): + elif ( + iris.FUTURE.dataless_cube + and type(data) is str + and data == iris.MAINTAIN_DATA + ) or (data is None): # Copy the managed data. if self.has_lazy_data(): data = copy.deepcopy(self._lazy_array, memo) diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index 7dc3068866..cf832719a0 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -2090,7 +2090,7 @@ def test_copy_new_data(self): _shared_utils.assert_array_equal(new_cube.data, new_data) def test_copy_remove_data(self): - with iris.FUTURE.context(dataless_cube = True): + with iris.FUTURE.context(dataless_cube=True): cube = stock.simple_3d() new_cube = cube.copy() assert new_cube.metadata == cube.metadata