Commit a0a92257 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Merge branch 'expose_stream__data' into 'sliced_stream'

Expose Stream.__data: now Stream._data to allow regular access by StreamFilter

See merge request !9
parents e04e8af7 134ccc54
Pipeline #42527 canceled with stage
in 15 seconds
......@@ -22,8 +22,8 @@ class Stream:
# reset stream
def reset(self):
self.__loaded = None
self.__data = None
self._loaded = None
self._data = None
self.__bounding_box = StreamArray(self)
self.__image_points = StreamArray(self)
......@@ -199,14 +199,14 @@ class Stream:
def load(self, index=None):
indices = self.get_frame_indices(index)
# return buffered data OR load from file OR process data
if self.__loaded == indices and self.__data is not None:
if self._loaded == indices and self._data is not None:
# print('loaded', self.name)
pass
else:
self.__data = self.parent.load_stream_data(self.name, indices)
self._data = self.parent.load_stream_data(self.name, indices)
# buffer and return data
self.__loaded = indices
return self.__data
self._loaded = indices
return self._data
# get size of a given (sliced) axis
def get_axis_size(self, axis, _slice=None):
......@@ -264,16 +264,16 @@ class StreamFilter(Stream):
# load one or several frames
def load(self, index=None):
indices = self.get_frame_indices(index)
# return buffered data OR load from file OR process data
if self._Stream__loaded == indices and self._Stream__data is not None:
# return buffered data OR process data
if self._loaded == indices and self._data is not None:
# print('loaded', self.name)
pass
else:
self.__data = self.process(self.parent.load(indices), indices)
self._data = self.process(self.parent.load(indices), indices)
# buffer and return data
self.__loaded = indices
return self.__data
self._loaded = indices
return self._data
################################################################################
### astype ###
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment