ToolBoxPathError is misleading
At the moment, the function find_run_dir
is used to find a proposal folder.
A ToolBoxPathError is raised when the folder is not found.
This masks (among others) the case of permission denied, which can often be stumbled upon by users at the start of a beamtime.
Example:
import toolbox_scs as tb
tb.load(2517, 43)
raises ToolBoxPathError: ('The constructed path does not exist.', '/gpfs/exfel/exp/HED/202001/p002517/raw/r0043')
import extra_data as ed
ed.open_run(2517, 43)
raises PermissionError: [Errno 13] Permission denied: '/gpfs/exfel/exp/HED/202001/p002517/raw/r0043'
, which is closer to what is actually going on: I do not have access to this proposal.
A wrong proposal number in find_run_dir
and in ed.open_run
raises the identical error message: Exception: Couldn't find proposal dir for 'p253432417'
Therefore, do we need the function find_run_dir
and the ToolBoxPathError
? Or shall we leave this machinery to extra_data package? What are the use cases?
A comment in the docstring: "The rather unspecified Exeption raised, when entering a invalid proposal number stems from the ed package -> to be fixed externally."
Is this still the case or has this been fixed in extra_data?