check if param file exists

This commit is contained in:
Justus Kuhlmann 2026-07-07 08:52:01 +02:00
commit 07fdc1ba6a
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -31,6 +31,8 @@ def load_ms1_infile(path: Path, project: str, file_in_project: str) -> dict[str,
""" """
file = os.path.join(path, "projects", project, file_in_project) file = os.path.join(path, "projects", project, file_in_project)
if not os.path.exists(file):
raise IOError(f"File {file} does not exist.")
ds = os.path.join(path, "projects", project) ds = os.path.join(path, "projects", project)
dl.get(file, dataset=ds) dl.get(file, dataset=ds)
with open(file, 'r') as fp: with open(file, 'r') as fp: