Commit 8c32c23e authored by David GEISSBUHLER's avatar David GEISSBUHLER
Browse files

view filter frame load ok

parent 5c5824da
......@@ -83,8 +83,13 @@ stream_sl = stream_a[1:4]
data_sl = data_a[1:4]
assert(stream_sl.shape == data_sl.shape)
assert(stream_sl.ndim == data_sl.ndim)
#assert(np.array_equal(stream_sl.load(), data_sl))
assert(np.array_equal(stream_sl.load(), data_sl))
stream_sl = stream_a[1::3]
data_sl = data_a[1::3]
assert(stream_sl.shape == data_sl.shape)
assert(stream_sl.ndim == data_sl.ndim)
assert(np.array_equal(stream_sl.load(), data_sl))
stream_sl = stream_a[:,1]
data_sl = data_a[:,1]
......@@ -104,6 +109,14 @@ assert(stream_sl.shape == data_sl.shape)
assert(stream_sl.ndim == data_sl.ndim)
assert(np.array_equal(stream_sl.load(), data_sl))
for t in tests:
s = slice(t[0], t[1], t[2])
dd = data_a[s]
sd = stream_a[s]
assert(sd.shape == dd.shape)
assert(sd.ndim == dd.ndim)
assert(np.array_equal(sd.load(), dd))
###########
#fo = StreamFile('api_test.h5', 'w')
......
......@@ -307,7 +307,9 @@ class StreamView(StreamFilter):
return __ndim
def load(self, index=None):
indices = get_index_list(index, self.shape[0])
parent_indices = get_index_list(self.frame_view, self.parent.shape[0])
view_indices = get_index_list(index, self.shape[0])
indices = [parent_indices[i] for i in view_indices]
return super().load(indices)
def process(self, data, indices):
......
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