diff --git a/pystream/models/squire.py b/pystream/models/squire.py index a36bed5..6e9d9ad 100644 --- a/pystream/models/squire.py +++ b/pystream/models/squire.py @@ -97,8 +97,11 @@ def get_iter(filename: pathlib.PurePath) -> Union[Tuple[str, str], Tuple[None, N Tuple[str, str]: Tuple of previous file and next file. """ - dir_content = sorted((file for file in os.listdir(filename.parent) if pathlib.PosixPath(file).suffix in config.env.file_formats), - key=lambda x: natural_sort_key(x)) + # Extract only the file formats that are supported + dir_content = sorted( + (file for file in os.listdir(filename.parent) if pathlib.PosixPath(file).suffix in config.env.file_formats), + key=lambda x: natural_sort_key(x) + ) idx = dir_content.index(filename.name) try: previous_ = dir_content[idx - 1]