From 4c43c2c741f4149b38eee90186ff0fdf4d851bfa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:10:01 +0800 Subject: [PATCH] chore: update pre-commit hooks (#26) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](https://github.com/adamchainz/blacken-docs/compare/1.18.0...1.19.1) - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.1.0...v4.0.0-alpha.8) - [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.8.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.2...v0.8.2) - [github.com/abravalheri/validate-pyproject: v0.18 → v0.23](https://github.com/abravalheri/validate-pyproject/compare/v0.18...v0.23) - [github.com/python-jsonschema/check-jsonschema: 0.29.0 → 0.30.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.0...0.30.0) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 12 ++++++------ fixms/fix_ms_dir.py | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) 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.