From 35f1c06f75a4a4e540277bd760c96ec7b3bd4083 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:18:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/_helpers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/_helpers.py b/scripts/_helpers.py index beca3f4f..c5c96db9 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -103,16 +103,18 @@ def configure_logging(snakemake, skip_handlers=False): } ) logging.basicConfig(**kwargs) - + # Setup a function to handle uncaught exceptions and include them with their stacktrace into logfiles def handle_exception(exc_type, exc_value, exc_traceback): # Log the exception logger = logging.getLogger() - logger.error("Uncaught exception", - exc_info=(exc_type, exc_value, exc_traceback)) + logger.error( + "Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback) + ) sys.excepthook = handle_exception + def update_p_nom_max(n): # if extendable carriers (solar/onwind/...) have capacity >= 0, # e.g. existing assets from the OPSD project are included to the network,