Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,19 @@ def __init__(self, data, standard_name=None, long_name=None,

@property
def share_data(self):
"""Share cube data when slicing/indexing cube if True."""
"""
Share cube data when slicing/indexing cube if True.
Setting this flag to True will realise the data payload,
if it is lazy, as lazy data cannot currently be shared across cubes.

"""
return self._share_data

@share_data.setter
def share_data(self, value):
# Realise the data if is hasn't already been as sharing lazy data is
# not right now possible or a usecase understood.
if self.has_lazy_data():
# If value is True: realise the data (if is hasn't already been) as
# sharing lazy data is not possible.
if value and self.has_lazy_data():
_ = self.data
self._share_data = bool(value)

Expand Down