Skip to content

Commit

Permalink
chore: update pre-commit hooks (#26)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](pre-commit/mirrors-prettier@v3.1.0...v4.0.0-alpha.8)
- [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.8.2](astral-sh/ruff-pre-commit@v0.5.2...v0.8.2)
- [github.com/abravalheri/validate-pyproject: v0.18 → v0.23](abravalheri/validate-pyproject@v0.18...v0.23)
- [github.com/python-jsonschema/check-jsonschema: 0.29.0 → 0.30.0](python-jsonschema/check-jsonschema@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>
  • Loading branch information
pre-commit-ci[bot] authored Dec 10, 2024
1 parent 3acb451 commit 4c43c2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
Expand All @@ -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
Expand Down
21 changes: 12 additions & 9 deletions fixms/fix_ms_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 4c43c2c

Please sign in to comment.