Skip to content

Commit

Permalink
Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed Apr 30, 2024
1 parent 4e76cd2 commit 4843be0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arrakis/utils/msutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion scripts/compare_leakage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion scripts/spica.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
)
Expand Down

0 comments on commit 4843be0

Please sign in to comment.