Skip to content

Commit a200eda

Browse files
committed
sample paths:
1 parent 6787c43 commit a200eda

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/boostedhh/utils.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,17 @@ def load_sample(
509509
else:
510510
sample_path = paths["bg"]
511511

512-
sample_path = sample_path / year
513-
514-
full_samples_list = listdir(sample_path) # get all directories in data_dir
515-
load_samples = [str(s) for s in full_samples_list if sample.get_selector(year).match(s)]
512+
if not isinstance(sample_path, list):
513+
sample_path = [sample_path]
514+
515+
# find the directory that contains the sample
516+
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)]
520+
if len(load_samples):
521+
sample_path = spy
522+
break
516523

517524
logger.info(f"Loading {load_samples}")
518525

0 commit comments

Comments
 (0)