From be840c2a6488da82d4699a7cb08237b4802fea97 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver <thomas.kluyver@xfel.eu> Date: Fri, 10 Jan 2025 11:17:12 +0000 Subject: [PATCH] Formatting in setup_logging.py --- src/xfel_calibrate/setup_logging.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xfel_calibrate/setup_logging.py b/src/xfel_calibrate/setup_logging.py index ae8cbda32..b9237517c 100644 --- a/src/xfel_calibrate/setup_logging.py +++ b/src/xfel_calibrate/setup_logging.py @@ -1,13 +1,13 @@ +import json import os import sys -import json import warnings -import IPython from datetime import datetime -from typing import Type, Any +from typing import Any, Type -from cal_tools.warnings import CalibrationWarning +import IPython +from cal_tools.warnings import CalibrationWarning JOB_ID = os.getenv('SLURM_JOB_ID', 'local') @@ -44,8 +44,10 @@ def log_error( except Exception as e: sys.stdout.write(f"Logging failed: {e}\n") + original_showwarning = warnings.showwarning + def handle_warning( message: Warning, category: Type[Warning], # these are needed for `warnings.showwarning` -- GitLab