From af7d727d9635063169a045d8863b5986fe5acb90 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Thu, 12 Dec 2024 15:38:26 +0000 Subject: [PATCH] pre-commit --- lib/iris/__init__.py | 18 +++++++++++++++--- lib/iris/_data_manager.py | 9 ++++----- lib/iris/cube.py | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/iris/__init__.py b/lib/iris/__init__.py index 98b3275769..37b6a89c9a 100644 --- a/lib/iris/__init__.py +++ b/lib/iris/__init__.py @@ -143,7 +143,13 @@ def callback(cube, field, filename): class Future(threading.local): """Run-time configuration controller.""" - def __init__(self, datum_support=False, pandas_ndim=False, save_split_attrs=False, dataless_cube=False): + def __init__( + self, + datum_support=False, + pandas_ndim=False, + save_split_attrs=False, + dataless_cube=False, + ): """Container for run-time options controls. To adjust the values simply update the relevant attribute from @@ -190,7 +196,12 @@ def __repr__(self): # msg = ('Future(example_future_flag={})') # return msg.format(self.example_future_flag) msg = "Future(datum_support={}, pandas_ndim={}, save_split_attrs={}, dataless_cubes={})" - return msg.format(self.datum_support, self.pandas_ndim, self.save_split_attrs, self.dataless_cube) + return msg.format( + self.datum_support, + self.pandas_ndim, + self.save_split_attrs, + self.dataless_cube, + ) # deprecated_options = {'example_future_flag': 'warning',} deprecated_options: dict[str, Literal["error", "warning"]] = {} @@ -834,4 +845,5 @@ def use_plugin(plugin_name): """ importlib.import_module(f"iris.plugins.{plugin_name}") -MAINTAIN_DATA = "MAINTAINDATA" \ No newline at end of file + +MAINTAIN_DATA = "MAINTAINDATA" diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index e0093a746f..5f30d33cec 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -159,12 +159,11 @@ def _deepcopy(self, memo, data=None): """ shape = None try: - if (iris.FUTURE.dataless_cube and data is None): + if iris.FUTURE.dataless_cube and data is None: shape = self.shape - elif ( - (iris.FUTURE.dataless_cube and data == iris.MAINTAIN_DATA) - or (data is None) - ): + elif (iris.FUTURE.dataless_cube 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/cube.py b/lib/iris/cube.py index e90cac7b45..902999b112 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -4084,7 +4084,7 @@ def _deepcopy(self, memo, data=None): aux_coords_and_dims=new_aux_coords_and_dims, cell_measures_and_dims=new_cell_measures_and_dims, ancillary_variables_and_dims=new_ancillary_variables_and_dims, - shape=(dm.shape if dm.core_data() is None else None) + shape=(dm.shape if dm.core_data() is None else None), ) new_cube.metadata = deepcopy(self.metadata, memo)