From 5861918bc087632b749cdb242e04981e95034623 Mon Sep 17 00:00:00 2001 From: Constantine Evans Date: Mon, 25 Nov 2024 21:37:18 +0000 Subject: [PATCH] Fix compile_eds when run not found. When a folder-based experiment was not found by compile_eds, it raised the wrong error. It now raises FileNotFoundError. This fixes a monitor bug. --- src/qslib/qsconnection_async.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qslib/qsconnection_async.py b/src/qslib/qsconnection_async.py index 8eb5507..0697a04 100644 --- a/src/qslib/qsconnection_async.py +++ b/src/qslib/qsconnection_async.py @@ -197,8 +197,10 @@ async def compile_eds(self, run_name: str) -> None: results = [r for r in expfiles if r["path"] == run_name] - if len(results) != 1: - raise ValueError + if len(results) == 0: + raise FileNotFoundError(run_name) + elif len(results) > 1: + raise ValueError(f"Multiple runs with name {run_name}: {results}") res = results[0] if "run" not in res: