diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 791bac8..39f0dff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,13 +4,13 @@ ci: repos: - repo: https://github.com/adamchainz/blacken-docs - rev: "1.18.0" + rev: "1.19.1" hooks: - id: blacken-docs additional_dependencies: [black==24.*] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.6.0" + rev: "v5.0.0" hooks: - id: check-added-large-files - id: check-case-conflict @@ -32,14 +32,14 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: - id: prettier types_or: [yaml, markdown, html, css, scss, javascript, json] args: [--prose-wrap=always] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.2" + rev: "v0.8.2" hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -64,13 +64,13 @@ repos: exclude: .pre-commit-config.yaml - repo: https://github.com/abravalheri/validate-pyproject - rev: "v0.18" + rev: "v0.23" hooks: - id: validate-pyproject additional_dependencies: ["validate-pyproject-schema-store[all]"] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.29.0" + rev: "0.30.0" hooks: - id: check-dependabot - id: check-github-workflows diff --git a/fixms/fix_ms_dir.py b/fixms/fix_ms_dir.py index e3507bf..9c07d79 100644 --- a/fixms/fix_ms_dir.py +++ b/fixms/fix_ms_dir.py @@ -234,9 +234,10 @@ def restore_ms_dir(ms): if tableexists("%s/FIELD_OLD" % (ms)): logger.info("Restoring FIELD directions in %s" % (ms), ms=ms) - with table("%s/FIELD" % (ms), readonly=False, ack=False) as tp, table( - "%s/FIELD_OLD" % (ms), readonly=True, ack=False - ) as fp: + with ( + table("%s/FIELD" % (ms), readonly=False, ack=False) as tp, + table("%s/FIELD_OLD" % (ms), readonly=True, ack=False) as fp, + ): field_dir = fp.getcol("PHASE_DIR") tp.putcol("PHASE_DIR", field_dir) tp.putcol("DELAY_DIR", field_dir) @@ -251,9 +252,10 @@ def restore_ms_dir(ms): if tableexists("%s/FEED_OLD" % (ms)): logger.info("Restoring BEAM_OFFSET in %s" % (ms), ms=ms) - with table("%s/FEED" % (ms), readonly=False, ack=False) as tp, table( - "%s/FEED_OLD" % (ms), readonly=True, ack=False - ) as fp: + with ( + table("%s/FEED" % (ms), readonly=False, ack=False) as tp, + table("%s/FEED_OLD" % (ms), readonly=True, ack=False) as fp, + ): offset = fp.getcol("BEAM_OFFSET") tp.putcol("BEAM_OFFSET", offset) @@ -304,9 +306,10 @@ def fix_ms_dir(ms): # Open up the MS FIELD table so it can be updated. # Open up the MS FEED table so we can work out what the offset is for the beam. - with table("%s/FIELD" % (ms), readonly=False, ack=False) as tp, table( - "%s/FEED_OLD" % (ms), readonly=True, ack=False - ) as tf: + with ( + table("%s/FIELD" % (ms), readonly=False, ack=False) as tp, + table("%s/FEED_OLD" % (ms), readonly=True, ack=False) as tf, + ): # The offsets are assumed to be the same for all antennas so get a list of all # the offsets for one antenna and for the current beam. This should return offsets # required for each field.