From ad875715c366715ae7dd35e04d2daddf4f2e13dc Mon Sep 17 00:00:00 2001 From: thevickypedia Date: Sun, 28 Jan 2024 10:36:31 -0600 Subject: [PATCH] Make `flake8` happy --- pystream/models/squire.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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]