diff --git a/tobac/utils/decorators.py b/tobac/utils/decorators.py index 5270ba31..80f4e844 100644 --- a/tobac/utils/decorators.py +++ b/tobac/utils/decorators.py @@ -182,9 +182,11 @@ def wrapper(*args, **kwargs): if type(output) == tuple: output = tuple( [ - output_item.to_iris().copy(output_item.data) - if type(output_item) == xarray.DataArray - else output_item + ( + output_item.to_iris().copy(output_item.data) + if type(output_item) == xarray.DataArray + else output_item + ) for output_item in output ] ) @@ -244,9 +246,11 @@ def wrapper(*args, **kwargs): # print("converting xarray to iris and back") args = tuple( [ - arg.to_iris().copy(arg.data) - if type(arg) == xarray.DataArray - else arg + ( + arg.to_iris().copy(arg.data) + if type(arg) == xarray.DataArray + else arg + ) for arg in args ] ) @@ -344,11 +348,15 @@ def wrapper(*args, **kwargs): if type(output) == tuple: output = tuple( [ - output_item.to_iris().copy(output_item.data) - if type(output_item) == xarray.DataArray - else output_item.to_dataframe() - if type(output_item) == xarray.Dataset - else output_item + ( + output_item.to_iris().copy(output_item.data) + if type(output_item) == xarray.DataArray + else ( + output_item.to_dataframe() + if type(output_item) == xarray.Dataset + else output_item + ) + ) for output_item in output ] )