From 4843be0e171e40a4c83bea7e37508fc8287ad857 Mon Sep 17 00:00:00 2001 From: "Thomson, Alec (CASS, Kensington)" Date: Tue, 30 Apr 2024 16:14:53 +1000 Subject: [PATCH] Ruff --- arrakis/utils/msutils.py | 2 +- scripts/compare_leakage.py | 3 ++- scripts/spica.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arrakis/utils/msutils.py b/arrakis/utils/msutils.py index 844d5d28..49539232 100644 --- a/arrakis/utils/msutils.py +++ b/arrakis/utils/msutils.py @@ -718,7 +718,7 @@ def wsclean( logger.warning("CAUTION - square channel joining and multiscale is unstable!") for key, value in arguments.items(): - if type(value) is bool: + if isinstance(value, bool): if value: command += f" -{key.replace('_', '-')}" elif value: diff --git a/scripts/compare_leakage.py b/scripts/compare_leakage.py index 1a24b5de..53ba69e7 100644 --- a/scripts/compare_leakage.py +++ b/scripts/compare_leakage.py @@ -83,7 +83,8 @@ def interpolate(field, comp, beams, cutdir, septab, holofile, verbose=True): imfile = glob( os.path.join(cutdir, f"{comp['Source_ID']}*beam{bm:02d}.conv.fits") )[0] - except: + except Exception as e: + logger.error(e) logger.critical(f"No image file for source {comp['Source_ID']} beam {bm}") return diff --git a/scripts/spica.py b/scripts/spica.py index e791b8d1..8d5ef92f 100755 --- a/scripts/spica.py +++ b/scripts/spica.py @@ -55,7 +55,8 @@ def mslist(cal_sb, name): try: ms = glob(f"{racs_area}/{cal_sb}/RACS_test4_1.05_{name}/*beam00_*.ms")[0] - except: + except Exception as e: + logger.error(e) raise Exception( f"Can't find '{racs_area}/{cal_sb}/RACS_test4_1.05_{name}/*beam00_*.ms'" )