Commit 1914d1c1 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Raise ValueError if a slice in a stream returns an empty stream.

parent 16d866dd
......@@ -335,6 +335,17 @@ class StreamView(StreamFilter):
else:
raise Exception('view_indices should be a tuple of int / slice object(s) or None')
if not all(self.shape): # true if a dimension in shape is 0
if not all(self.shape):
raise ValueError(
str(view_indices)
+ " in stream with shape "
+ str(parent.shape)
+ " results in empty stream. (shape "
+ str(self.shape)
+ ")"
)
# shape property
@property
def shape(self):
......
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