File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -420,6 +420,16 @@ def format_columns(columns: list):
420420 return ret_columns
421421
422422
423+ # add OR filter to each inner filter list
424+ def add_or_filter (filters , cut : list [tuple ]):
425+ if isinstance (filters [0 ], list ):
426+ # recursively handle nested filter lists
427+ return [add_or_filter (f , cut ) for f in filters ]
428+ else :
429+ # add OR filter at leaf level
430+ return filters + cut
431+
432+
423433def _normalize_weights (
424434 events : pd .DataFrame ,
425435 year : str ,
@@ -514,9 +524,11 @@ def load_sample(
514524
515525 # find the directory that contains the sample
516526 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 )]
527+ spy = Path (sp ) / year
528+ full_samples_list = list (spy .iterdir ()) # get all directories in data_dir
529+ load_samples = [
530+ s .name for s in full_samples_list if sample .get_selector (year ).match (s .name )
531+ ]
520532 if len (load_samples ):
521533 sample_path = spy
522534 break
You can’t perform that action at this time.
0 commit comments