From 0a50cfa4b79a024d407973ce079eefec09a15018 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 01:27:39 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- fixms/fix_ms_dir.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fixms/fix_ms_dir.py b/fixms/fix_ms_dir.py index b9798b8..a9206e0 100644 --- a/fixms/fix_ms_dir.py +++ b/fixms/fix_ms_dir.py @@ -232,10 +232,9 @@ def restore_ms_dir(ms): """Restore the direction to the ASKAPsoft standard.""" if tableexists("%s/FIELD_OLD" % (ms)): - logger.info("Restoring FIELD directions in %s" % (ms)) tp = table("{}/FIELD".format(ms), readonly=False, ack=False) - fp = table("%s/FIELD_OLD" %(ms), readonly=True, ack=False) + fp = table("%s/FIELD_OLD" % (ms), readonly=True, ack=False) field_dir = fp.getcol("PHASE_DIR") tp.putcol("PHASE_DIR", field_dir) tp.putcol("DELAY_DIR", field_dir) @@ -243,8 +242,10 @@ def restore_ms_dir(ms): tp.flush() tp.close() else: - logger.warning("No `FIELD_OLD` table in %s - cannot restore direction if direction has not changed." % (ms)) - + logger.warning( + "No `FIELD_OLD` table in %s - cannot restore direction if direction has not changed." + % (ms) + ) def fix_ms_dir(ms): @@ -388,9 +389,10 @@ def cli(): "ms", help="Measurement set to update", type=str, default=None, nargs="?" ) parser.add_argument( - "-r", "--restore", + "-r", + "--restore", action="store_true", - help="Switch to restore direction to the original ASKAPsoft pipeline direction" + help="Switch to restore direction to the original ASKAPsoft pipeline direction", ) # Parse the command line args = parser.parse_args()