From aa9359b29b2901aca737abdfde5d99de0f573723 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:05:55 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 25.11.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.11.0...26.1.0) - [github.com/PyCQA/isort: 7.0.0 → 8.0.1](https://github.com/PyCQA/isort/compare/7.0.0...8.0.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8285fd9..a2a7458 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,11 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.11.0 + rev: 26.1.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 7.0.0 + rev: 8.0.1 hooks: - id: isort args: ["--profile=black"] From 15982ef34152fbe3e5b5477447ab03ba19b3f766 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:08:26 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- RMtools_1D/do_QUfit_1D_mnest.py | 6 +++--- RMtools_1D/do_RMsynth_1D.py | 8 ++++---- RMtools_1D/rmtools_bwdepol.py | 8 ++++---- RMutils/__init__.py | 1 + RMutils/util_misc.py | 8 ++++---- tests/QA_test.py | 1 + 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/RMtools_1D/do_QUfit_1D_mnest.py b/RMtools_1D/do_QUfit_1D_mnest.py index f838ad8..f085a22 100644 --- a/RMtools_1D/do_QUfit_1D_mnest.py +++ b/RMtools_1D/do_QUfit_1D_mnest.py @@ -284,12 +284,12 @@ def run_qufit( # Parse the data array # freq_Hz, I, Q, U, dI, dQ, dU try: - (freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr) = data + freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr = data print("\nFormat [freq_Hz, I, Q, U, dI, dQ, dU]") except Exception: # freq_Hz, Q, U, dQ, dU try: - (freqArr_Hz, QArr, UArr, dQArr, dUArr) = data + freqArr_Hz, QArr, UArr, dQArr, dUArr = data print("\nFormat [freq_Hz, Q, U, dQ, dU]") noStokesI = True except Exception: @@ -320,7 +320,7 @@ def run_qufit( verbose=True, fit_function=fit_function, ) - (IModArr, qArr, uArr, dqArr, duArr, fit_result) = dataArr + IModArr, qArr, uArr, dqArr, duArr, fit_result = dataArr # Plot the data and the Stokes I model fit print("Plotting the input data and spectral index fit.") diff --git a/RMtools_1D/do_RMsynth_1D.py b/RMtools_1D/do_RMsynth_1D.py index 1f4a2d8..d4cd489 100755 --- a/RMtools_1D/do_RMsynth_1D.py +++ b/RMtools_1D/do_RMsynth_1D.py @@ -146,7 +146,7 @@ def run_rmsynth( try: if verbose: log("> Trying [freq_Hz, I, Q, U, dI, dQ, dU]", end=" ") - (freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr) = data + freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr = data if verbose: log("... success.") except Exception: @@ -156,7 +156,7 @@ def run_rmsynth( try: if verbose: log("> Trying [freq_Hz, q, u, dq, du]", end=" ") - (freqArr_Hz, QArr, UArr, dQArr, dUArr) = data + freqArr_Hz, QArr, UArr, dQArr, dUArr = data if verbose: log("... success.") noStokesI = True @@ -557,7 +557,7 @@ def readFile(dataFile, nBits, verbose=True, debug=False): try: if verbose: print("> Trying [freq_Hz, I, Q, U, dI, dQ, dU]", end=" ") - (freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr) = np.loadtxt( + freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr = np.loadtxt( dataFile, unpack=True, dtype=dtFloat ) if verbose: @@ -570,7 +570,7 @@ def readFile(dataFile, nBits, verbose=True, debug=False): try: if verbose: print("> Trying [freq_Hz, q, u, dq, du]", end=" ") - (freqArr_Hz, QArr, UArr, dQArr, dUArr) = np.loadtxt( + freqArr_Hz, QArr, UArr, dQArr, dUArr = np.loadtxt( dataFile, unpack=True, dtype=dtFloat ) if verbose: diff --git a/RMtools_1D/rmtools_bwdepol.py b/RMtools_1D/rmtools_bwdepol.py index b16eb5d..ccb5d11 100644 --- a/RMtools_1D/rmtools_bwdepol.py +++ b/RMtools_1D/rmtools_bwdepol.py @@ -1026,7 +1026,7 @@ def run_adjoint_rmsynth( if data.shape[0] == 7: if verbose: log("> Seven columns found, trying [freq_Hz, I, Q, U, dI, dQ, dU]", end=" ") - (freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr) = data + freqArr_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr = data widths_Hz = None elif data.shape[0] == 8: if verbose: @@ -1034,18 +1034,18 @@ def run_adjoint_rmsynth( "> Eight columns found, trying [freq_Hz, widths_Hz, I, Q, U, dI, dQ, dU]", end=" ", ) - (freqArr_Hz, widths_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr) = data + freqArr_Hz, widths_Hz, IArr, QArr, UArr, dIArr, dQArr, dUArr = data elif data.shape[0] == 6: if verbose: log( "> Six columns found, trying [freq_Hz, widths_Hz, Q, U, dQ, dU]", end=" ", ) - (freqArr_Hz, width_Hz, QArr, UArr, dQArr, dUArr) = data + freqArr_Hz, width_Hz, QArr, UArr, dQArr, dUArr = data elif data.shape[0] == 5: if verbose: log("> Five columns found, trying [freq_Hz, Q, U, dQ, dU]", end=" ") - (freqArr_Hz, QArr, UArr, dQArr, dUArr) = data + freqArr_Hz, QArr, UArr, dQArr, dUArr = data widths_Hz = None noStokesI = True else: diff --git a/RMutils/__init__.py b/RMutils/__init__.py index f05bc80..3b86e26 100644 --- a/RMutils/__init__.py +++ b/RMutils/__init__.py @@ -1,5 +1,6 @@ #! /usr/bin/env python """Dependencies for RM utilities""" + import pkg_resources __all__ = [ diff --git a/RMutils/util_misc.py b/RMutils/util_misc.py index 849a6af..cb3c30c 100644 --- a/RMutils/util_misc.py +++ b/RMutils/util_misc.py @@ -210,7 +210,7 @@ def config_read(filename, delim="=", doValueSplit=True): if not comment.match(line) and keyVal.match(line): # Weed out internal comments & split on 1st space line = comment.sub("", line) - (keyword, value) = line.split(delim, 1) + keyword, value = line.split(delim, 1) # If the line contains a value keyword = keyword.strip() # kill external whitespace @@ -392,8 +392,8 @@ def calc_parabola_vertex(x1, y1, x2, y2, x3, y3): midpoint = x2 deltax = x2 - x3 yscale = y2 - (x1, x2, x3) = [(x - x2) / deltax for x in (x1, x2, x3)] # slide spectrum to zero - (y1, y2, y3) = [y / yscale for y in (y1, y2, y3)] + x1, x2, x3 = [(x - x2) / deltax for x in (x1, x2, x3)] # slide spectrum to zero + y1, y2, y3 = [y / yscale for y in (y1, y2, y3)] D = (x1 - x2) * (x1 - x3) * (x2 - x3) A = (x3 * (y2 - y1) + x2 * (y1 - y3) + x1 * (y3 - y2)) / D @@ -589,7 +589,7 @@ def renormalize_StokesI_model( UserWarning, ) - (a, b, c, d, f, g) = fit_result.params + a, b, c, d, f, g = fit_result.params # Modify fit parameters to new reference frequency. # I have derived all these conversion equations analytically for the diff --git a/tests/QA_test.py b/tests/QA_test.py index 2cf5e48..64ef8a1 100644 --- a/tests/QA_test.py +++ b/tests/QA_test.py @@ -15,6 +15,7 @@ Created on Fri Oct 25 10:00:24 2019 @author: Cameron Van Eck """ + import json import os import shutil