Skip to content

Commit 4f84f8f

Browse files
authored
Merge pull request #12 from LPC-HH/utils_refactoring
Bug fix.
2 parents ea1eb40 + 6caaf77 commit 4f84f8f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/boostedhh/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,11 @@ def load_sample(
514514

515515
# find the directory that contains the sample
516516
for sp in sample_path:
517-
spy = sp / year
518-
full_samples_list = listdir(spy) # get all directories in data_dir
519-
load_samples = [str(s) for s in full_samples_list if sample.get_selector(year).match(s)]
517+
spy = Path(sp) / year
518+
full_samples_list = list(spy.iterdir()) # get all directories in data_dir
519+
load_samples = [
520+
s.name for s in full_samples_list if sample.get_selector(year).match(s.name)
521+
]
520522
if len(load_samples):
521523
sample_path = spy
522524
break

0 commit comments

Comments
 (0)