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 Dec 11, 2024
1 parent 44afb25 commit cdc51d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/iris/_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,15 @@ def _assert_axioms(self):
# Ensure there is a valid data state.
is_lazy = self._lazy_array is not None
is_real = self._real_array is not None
is_dataless = not(is_lazy or is_real) and self._shape is not None # if I remove the second check, allows empty arrays, like old behaviour
is_dataless = (
not (is_lazy or is_real) and self._shape is not None
) # if I remove the second check, allows empty arrays, like old behaviour
emsg = "Unexpected data state, got {}lazy and {}real data."
state = (is_lazy ^ is_real) or is_dataless
if not state:
raise iris.exceptions.InvalidCubeError(emsg.format("" if is_lazy else "no ", "" if is_real else "no "))

raise iris.exceptions.InvalidCubeError(
emsg.format("" if is_lazy else "no ", "" if is_real else "no ")
)

def _deepcopy(self, memo, data=None):
"""Perform a deepcopy of the :class:`~iris._data_manager.DataManager` instance.
Expand Down

0 comments on commit cdc51d5

Please sign in to comment.