Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print missing filename #427

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Print the wrong filename when not found
  • Loading branch information
dnerini committed Aug 21, 2024
commit 22ff341d8d67bc2548f48d590feba955a38ba4e2
5 changes: 2 additions & 3 deletions pysteps/io/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def _find_matching_filename(
date, root_path, path_fmt, fn_pattern, fn_ext, silent=False
):
path = _generate_path(date, root_path, path_fmt)
fn = None

if os.path.exists(path):
fn = datetime.strftime(date, fn_pattern) + "." + fn_ext
Expand All @@ -113,13 +112,13 @@ def _find_matching_filename(
if os.path.exists(fn):
fn = fn
else:
fn = None
if not silent:
print("file not found: %s" % fn)
return None
elif not silent:
print("path", path, "not found.")

return fn
return None


def _generate_path(date, root_path, path_format):
Expand Down
Loading