diff --git a/findxfel.py b/findxfel.py index 369ec0bdb9150d9dc7258ec2fddefbcd767e4f40..97664467b4290f27749053d1580f791f7d62fbbf 100644 --- a/findxfel.py +++ b/findxfel.py @@ -5,9 +5,10 @@ from glob import iglob import os.path as osp from typing import Union -__version__ = "0.1.1" +__version__ = "0.1.2" -DATA_ROOT_DIR = '/gpfs/exfel/exp' +# '/dcache' is the mount poin of our example data inside VISA images +PROPOSALS_IN_GLOBS = ('/gpfs/exfel/exp/*/*', '/dcache') def find_proposal(proposal: Union[int, str]) -> str: """Retrieve path to the proposal folder.""" @@ -17,11 +18,14 @@ def find_proposal(proposal: Union[int, str]) -> str: return proposal proposal = 'p' + proposal.lstrip('p').zfill(6) - glob_path = osp.join(DATA_ROOT_DIR, '*/*', proposal) - for d in iglob(glob_path): - return d + glob_paths = [] + for proposal_root_dir in PROPOSALS_IN_GLOBS: + glob_path = osp.join(proposal_root_dir, proposal) + glob_paths.append(glob_path) + for d in iglob(glob_path): + return d - raise ValueError(f"No matches found for {glob_path}") + raise ValueError(f"No matches found for {glob_paths}.") def find_run( proposal: Union[int, str], run: Union[int, str], is_proc: bool=False