Skip to content

Commit 6216de1

Browse files
committed
Ensure open handles lists correctly
The call to `glob` was causing `list`s of files to fail in `open`. This fixes that issue by looping over the `list`s contents, calling `glob` on each one, and concatenating them into a list of files.
1 parent eda864a commit 6216de1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pims/api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ def open(sequence, **kwargs):
162162
>>> frame_count = len(video) # Number of frames in video
163163
>>> frame_shape = video.frame_shape # Pixel dimensions of video
164164
"""
165-
files = glob.glob(sequence)
165+
if not isinstance(sequence, list):
166+
sequence = [sequence]
167+
168+
files = []
169+
for each_seq in sequence:
170+
files.extend(glob.glob(sequence))
171+
166172
if len(files) > 1:
167173
# todo: test if ImageSequence can read the image type,
168174
# delegate to subclasses as needed

0 commit comments

Comments
 (0)