Skip to content

Commit

Permalink
allow recursive search with glob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
vuillaut committed Sep 5, 2024
1 parent 4f7ed59 commit 4e0ab08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 @@ def main():
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

0 comments on commit 4e0ab08

Please sign in to comment.