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

allow recursive search with glob pattern #1286

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions lstchain/scripts/lstchain_merge_hdf5_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def main():
run = f'Run{args.run_number:05d}'
file_list = sorted(filter(
lambda f: run in f,
glob(os.path.join(args.input_dir, args.pattern))
glob(os.path.join(args.input_dir, args.pattern), recursive=True)
))
else:
file_list = sorted(glob(os.path.join(args.input_dir, args.pattern)))
file_list = sorted(glob(os.path.join(args.input_dir, args.pattern), recursive=True))

if args.no_image:
keys = get_dataset_keys(file_list[0])
Expand Down
4 changes: 2 additions & 2 deletions lstchain/scripts/lstchain_merge_muon_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
run = f'Run{args.run_number:05d}'
file_list = sorted(filter(
lambda f: run in f,
glob(os.path.join(args.srcdir, args.pattern))
glob(os.path.join(args.srcdir, args.pattern), recursive=True)
))
else:
file_list = sorted(glob(os.path.join(args.srcdir, args.pattern)))
file_list = sorted(glob(os.path.join(args.srcdir, args.pattern), recursive=True))

Check warning on line 59 in lstchain/scripts/lstchain_merge_muon_files.py

View check run for this annotation

Codecov / codecov/patch

lstchain/scripts/lstchain_merge_muon_files.py#L59

Added line #L59 was not covered by tests

if not file_list:
raise IOError(f'No muon files in {args.srcdir} with the parameters requested')
Expand Down