Skip to content

Commit a94f2b4

Browse files
chore: update pre-commit hooks (#28)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.9.2](astral-sh/ruff-pre-commit@v0.8.3...v0.9.2) - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](python-jsonschema/check-jsonschema@0.30.0...0.31.0) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b9ea67a commit a94f2b4

File tree

3 files changed

+44
-44
lines changed

3 files changed

+44
-44
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
args: [--prose-wrap=always]
4040

4141
- repo: https://github.com/astral-sh/ruff-pre-commit
42-
rev: "v0.8.3"
42+
rev: "v0.9.2"
4343
hooks:
4444
- id: ruff
4545
args: ["--fix", "--show-fixes"]
@@ -70,7 +70,7 @@ repos:
7070
additional_dependencies: ["validate-pyproject-schema-store[all]"]
7171

7272
- repo: https://github.com/python-jsonschema/check-jsonschema
73-
rev: "0.30.0"
73+
rev: "0.31.0"
7474
hooks:
7575
- id: check-dependabot
7676
- id: check-github-workflows

fixms/fix_ms_corrs.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,12 @@ async def fix_ms_corrs_coro(
547547
# throughout the observation. For example, bandpass observations vary
548548
# this direction as each beam cycles in the footprint cycles over the
549549
# calibrator source.
550-
assert (
551-
len(feed1) == 1 and len(feed2) == 1
552-
), "Found more than one feed orientation!"
553-
assert (
554-
feed1[0] == feed2[0]
555-
), f"The unique feed entries available in the data table differ, {feed1=} {feed2=}"
550+
assert len(feed1) == 1 and len(feed2) == 1, (
551+
"Found more than one feed orientation!"
552+
)
553+
assert feed1[0] == feed2[0], (
554+
f"The unique feed entries available in the data table differ, {feed1=} {feed2=}"
555+
)
556556

557557
# The two assertions above should enforce enough constraint
558558
# to make sure the rotation matrix constructed is correct

tests/test_fix_ms_corrs.py

+36-36
Original file line numberDiff line numberDiff line change
@@ -181,24 +181,24 @@ def test_get_pol_axis(ms_standard_example, ms_rotated_example):
181181
pol_axis_fixed = get_pol_axis(ms.fixed_ms_path, col="INSTRUMENT_RECEPTOR_ANGLE")
182182
rot_pol_axis_fixed = get_pol_axis(ms.fixed_ms_path, col="RECEPTOR_ANGLE")
183183

184-
assert np.isclose(
185-
pol_axis_original, ms.pol_axis
186-
), f"Pol axis is incorrect {pol_axis_original=}"
187-
assert np.isclose(
188-
pol_axis_fixed, ms.pol_axis
189-
), f"Pol axis is incorrect {pol_axis_fixed=}"
190-
assert np.isclose(
191-
rot_pol_axis_fixed, 0 * u.deg
192-
), f"Pol axis is incorrect {rot_pol_axis_fixed=}"
184+
assert np.isclose(pol_axis_original, ms.pol_axis), (
185+
f"Pol axis is incorrect {pol_axis_original=}"
186+
)
187+
assert np.isclose(pol_axis_fixed, ms.pol_axis), (
188+
f"Pol axis is incorrect {pol_axis_fixed=}"
189+
)
190+
assert np.isclose(rot_pol_axis_fixed, 0 * u.deg), (
191+
f"Pol axis is incorrect {rot_pol_axis_fixed=}"
192+
)
193193

194194

195195
def test_column_exists(ms_standard_example, ms_rotated_example):
196196
# Check that CORRECTED_DATA is on disk
197197
for ms in (ms_standard_example, ms_rotated_example):
198198
with table(ms.fixed_ms_path.as_posix()) as tab:
199-
assert (
200-
ms.corrected_data_column in tab.colnames()
201-
), f"{ms.corrected_data_column} not in MS"
199+
assert ms.corrected_data_column in tab.colnames(), (
200+
f"{ms.corrected_data_column} not in MS"
201+
)
202202

203203

204204
def test_original_data(ms_standard_example, ms_rotated_example):
@@ -290,66 +290,66 @@ def get_wsclean_stokes(ms):
290290
def test_rotated_data_I(ms_standard_example):
291291
mueller_a = askap_stokes(ms_standard_example)
292292
mueller_a_mat = askap_stokes_mat(ms_standard_example)
293-
assert np.allclose(
294-
mueller_a.stokes_I, mueller_a_mat.stokes_I, atol=1e-4
295-
), "Stokes rotation I failed"
293+
assert np.allclose(mueller_a.stokes_I, mueller_a_mat.stokes_I, atol=1e-4), (
294+
"Stokes rotation I failed"
295+
)
296296

297297

298298
def test_rotated_data_Q(ms_standard_example):
299299
mueller_a = askap_stokes(ms_standard_example)
300300
mueller_a_mat = askap_stokes_mat(ms_standard_example)
301-
assert np.allclose(
302-
mueller_a.stokes_Q, mueller_a_mat.stokes_Q, atol=1e-4
303-
), f"Stokes rotation Q failed for {ms_standard_example.fixed_ms_path.name}"
301+
assert np.allclose(mueller_a.stokes_Q, mueller_a_mat.stokes_Q, atol=1e-4), (
302+
f"Stokes rotation Q failed for {ms_standard_example.fixed_ms_path.name}"
303+
)
304304

305305

306306
def test_rotated_data_U(ms_standard_example):
307307
mueller_a = askap_stokes(ms_standard_example)
308308
mueller_a_mat = askap_stokes_mat(ms_standard_example)
309-
assert np.allclose(
310-
mueller_a.stokes_U, mueller_a_mat.stokes_U, atol=1e-4
311-
), f"Stokes rotation U failed for {ms_standard_example.fixed_ms_path.name}"
309+
assert np.allclose(mueller_a.stokes_U, mueller_a_mat.stokes_U, atol=1e-4), (
310+
f"Stokes rotation U failed for {ms_standard_example.fixed_ms_path.name}"
311+
)
312312

313313

314314
def test_rotated_data_V(ms_standard_example):
315315
mueller_a = askap_stokes(ms_standard_example)
316316
mueller_a_mat = askap_stokes_mat(ms_standard_example)
317-
assert np.allclose(
318-
mueller_a.stokes_V, mueller_a_mat.stokes_V, atol=1e-4
319-
), f"Stokes rotation V failed for {ms_standard_example.fixed_ms_path.name}"
317+
assert np.allclose(mueller_a.stokes_V, mueller_a_mat.stokes_V, atol=1e-4), (
318+
f"Stokes rotation V failed for {ms_standard_example.fixed_ms_path.name}"
319+
)
320320

321321

322322
def test_stokes_I(ms_standard_example, ms_rotated_example):
323323
for ms in (ms_standard_example, ms_rotated_example):
324324
mueller_a = askap_stokes_mat(ms)
325325
mueller_w = get_wsclean_stokes(ms)
326-
assert np.allclose(
327-
mueller_a.stokes_I, mueller_w.stokes_I, atol=1e-4
328-
), f"ASKAP and WSClean disagree on Stokes I in {ms.fixed_ms_path.name}"
326+
assert np.allclose(mueller_a.stokes_I, mueller_w.stokes_I, atol=1e-4), (
327+
f"ASKAP and WSClean disagree on Stokes I in {ms.fixed_ms_path.name}"
328+
)
329329

330330

331331
def test_stokes_Q(ms_standard_example, ms_rotated_example):
332332
for ms in (ms_standard_example, ms_rotated_example):
333333
mueller_a = askap_stokes_mat(ms)
334334
mueller_w = get_wsclean_stokes(ms)
335-
assert np.allclose(
336-
mueller_a.stokes_Q, mueller_w.stokes_Q, atol=1e-1
337-
), f"ASKAP and WSClean disagree on Stokes Q in {ms.fixed_ms_path.name}"
335+
assert np.allclose(mueller_a.stokes_Q, mueller_w.stokes_Q, atol=1e-1), (
336+
f"ASKAP and WSClean disagree on Stokes Q in {ms.fixed_ms_path.name}"
337+
)
338338

339339

340340
def test_stokes_U(ms_standard_example, ms_rotated_example):
341341
for ms in (ms_standard_example, ms_rotated_example):
342342
mueller_a = askap_stokes_mat(ms)
343343
mueller_w = get_wsclean_stokes(ms)
344-
assert np.allclose(
345-
mueller_a.stokes_U, mueller_w.stokes_U, atol=1e-4
346-
), f"ASKAP and WSClean disagree on Stokes U in {ms.fixed_ms_path.name}"
344+
assert np.allclose(mueller_a.stokes_U, mueller_w.stokes_U, atol=1e-4), (
345+
f"ASKAP and WSClean disagree on Stokes U in {ms.fixed_ms_path.name}"
346+
)
347347

348348

349349
def test_stokes_V(ms_standard_example, ms_rotated_example):
350350
for ms in (ms_standard_example, ms_rotated_example):
351351
mueller_a = askap_stokes_mat(ms)
352352
mueller_w = get_wsclean_stokes(ms)
353-
assert np.allclose(
354-
mueller_a.stokes_V, mueller_w.stokes_V, atol=1e-4
355-
), f"ASKAP and WSClean disagree on Stokes V in {ms.fixed_ms_path.name}"
353+
assert np.allclose(mueller_a.stokes_V, mueller_w.stokes_V, atol=1e-4), (
354+
f"ASKAP and WSClean disagree on Stokes V in {ms.fixed_ms_path.name}"
355+
)

0 commit comments

Comments
 (0)