From dba5c0f09d5bcf7f4434249e46beba066dea66c7 Mon Sep 17 00:00:00 2001 From: Filippo Airaldi Date: Fri, 9 Feb 2024 20:58:45 +0100 Subject: [PATCH] better trace for run errors --- benchmarking/run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmarking/run.py b/benchmarking/run.py index 956c535..b81b175 100644 --- a/benchmarking/run.py +++ b/benchmarking/run.py @@ -10,6 +10,7 @@ from itertools import chain, cycle, product from pathlib import Path from time import perf_counter +from traceback import format_exc from typing import Optional, Union from warnings import filterwarnings, warn @@ -262,9 +263,9 @@ def next_obs( bests = ",".join(map(str, bests)) timings = ",".join(map(str, timings)) lock_write(csv, f"{problem_name};{method};{rewards};{bests};{timings}") - except Exception as e: + except Exception: warn( - f"Exception raised during `{problem_name}` with `{method}`:\n{e}.", + f"Exception raised in `{problem_name}`, `{method}`:\n{format_exc()}", RuntimeWarning, ) finally: