From e717335034f4a1797af9977e79e29a3316025e8f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:49:30 +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/pre-commit/pre-commit-hooks: v4.6.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v6.0.0) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 24.8.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/24.8.0...26.1.0) - [github.com/pycqa/isort: 5.13.2 → 7.0.0](https://github.com/pycqa/isort/compare/5.13.2...7.0.0) - [github.com/pycqa/flake8: 7.1.1 → 7.3.0](https://github.com/pycqa/flake8/compare/7.1.1...7.3.0) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1cdcb1..7905b60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -10,16 +10,16 @@ repos: - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict -- repo: https://github.com/psf/black - rev: 24.8.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort - repo: https://github.com/pycqa/flake8 - rev: 7.1.1 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/pycqa/pydocstyle From d6e980368e05c3e81d85556bdf7ffa897ef41d06 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:49:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- phys2denoise/cli/run.py | 1 - phys2denoise/metrics/cardiac.py | 24 ++++++++---------------- phys2denoise/metrics/chest_belt.py | 30 ++++++++++-------------------- phys2denoise/metrics/multimodal.py | 18 ++++++------------ versioneer.py | 4 +--- 5 files changed, 25 insertions(+), 52 deletions(-) diff --git a/phys2denoise/cli/run.py b/phys2denoise/cli/run.py index 62c78f4..dc48dcd 100644 --- a/phys2denoise/cli/run.py +++ b/phys2denoise/cli/run.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """Parser for phys2denoise.""" - import argparse from phys2denoise import __version__ diff --git a/phys2denoise/metrics/cardiac.py b/phys2denoise/metrics/cardiac.py index 7c87dc1..b03444e 100644 --- a/phys2denoise/metrics/cardiac.py +++ b/phys2denoise/metrics/cardiac.py @@ -89,22 +89,18 @@ def _cardiac_metrics( data = io.load_physio(data, fs=fs) data._metadata["peaks"] = peaks else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with existing peaks metadata (e.g. using the peakdet module), or by providing the physiological data timeseries, the sampling frequency, and the peak indices separately. - """ - ) + """) if data.peaks.size == 0: - raise ValueError( - """ + raise ValueError(""" Peaks must be a non-empty list. Make sure to run peak detection on your physiological data first, using the peakdet module, or other software of your choice. - """ - ) + """) # Convert window to samples, but halves it. halfwindow_samples = int(round(window * data.fs / 2)) @@ -384,22 +380,18 @@ def cardiac_phase(data, slice_timings, n_scans, t_r, peaks=None, fs=None, **kwar data = io.load_physio(data, fs=fs) data._metadata["peaks"] = peaks else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with existing peaks metadata (e.g. using the peakdet module), or by providing the physiological data timeseries, the sampling frequency, and the peak indices separately. - """ - ) + """) if data.peaks.size == 0: - raise ValueError( - """ + raise ValueError(""" Peaks must be a non-empty list. Make sure to run peak detection on your physiological data first, using the peakdet module, or other software of your choice. - """ - ) + """) assert slice_timings.ndim == 1, "Slice times must be a 1D array" n_slices = np.size(slice_timings) diff --git a/phys2denoise/metrics/chest_belt.py b/phys2denoise/metrics/chest_belt.py index 6551c57..51f2927 100644 --- a/phys2denoise/metrics/chest_belt.py +++ b/phys2denoise/metrics/chest_belt.py @@ -56,22 +56,18 @@ def respiratory_variance_time( data._metadata["peaks"] = peaks data._metadata["troughs"] = troughs else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with existing peaks and troughs metadata (e.g. using the peakdet module), or by providing the physiological data timeseries, the sampling frequency, and the peak and trough indices separately. - """ - ) + """) if data.peaks.size == 0 or data.troughs.size == 0: - raise ValueError( - """ + raise ValueError(""" Peaks and troughs must be non-empty lists. Make sure to run peak/trough detection on your physiological data first, using the peakdet module, or other software of your choice. - """ - ) + """) timestep = 1 / data.fs # respiration belt timing @@ -219,14 +215,12 @@ def _respiratory_pattern_variability(data, window): elif fs is not None: data = io.load_physio(data, fs=fs) else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with the sampling frequency encapsulated, or by providing the physiological data timeseries and the sampling frequency separately. - """ - ) + """) # Convert window to Hertz window = int(window * data.fs) @@ -288,14 +282,12 @@ def respiratory_variance(data, fs=None, window=6, **kwargs): elif fs is not None: data = io.load_physio(data, fs=fs) else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with the sampling frequency encapsulated, or by providing the physiological data timeseries and the sampling frequency separately. - """ - ) + """) # Convert window to Hertz halfwindow_samples = int(round(window * data.fs / 2)) @@ -338,14 +330,12 @@ def respiratory_phase(data, n_scans, slice_timings, t_r, fs=None, **kwargs): elif fs is not None: data = io.load_physio(data, fs=fs) else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with the sampling frequency encapsulated, or by providing the physiological data timeseries and the sampling frequency separately. - """ - ) + """) assert slice_timings.ndim == 1, "Slice times must be a 1D array" n_slices = np.size(slice_timings) diff --git a/phys2denoise/metrics/multimodal.py b/phys2denoise/metrics/multimodal.py index fa28bae..8889a66 100644 --- a/phys2denoise/metrics/multimodal.py +++ b/phys2denoise/metrics/multimodal.py @@ -66,13 +66,11 @@ def retroicor( if data.physio_type is None and physio_type is not None: data._physio_type = physio_type elif data.physio_type is None and physio_type is None: - raise ValueError( - """ + raise ValueError(""" Since the provided Physio object does not specify a `physio_type`, this function's `physio_type` parameter must be specified as a value from {'cardiac', 'respiratory'} - """ - ) + """) elif fs is not None and physio_type is not None: data = io.load_physio(data, fs=fs) @@ -80,23 +78,19 @@ def retroicor( if data.physio_type == "cardiac": data._metadata["peaks"] = cardiac_peaks else: - raise ValueError( - """ + raise ValueError(""" To use this function you should either provide a Physio object with existing peaks metadata if it describes a cardiac signal (e.g. using the peakdet module), or by providing the physiological data timeseries, the sampling frequency, the physio_type and the peak indices separately. - """ - ) + """) if not data.peaks and data.physio_type == "cardiac": - raise ValueError( - """ + raise ValueError(""" Peaks must be a non-empty list for cardiac data. Make sure to run peak detection on your cardiac data first, using the peakdet module, or other software of your choice. - """ - ) + """) n_slices = np.shape(slice_timings) # number of slices diff --git a/versioneer.py b/versioneer.py index 2b54540..1cd4726 100644 --- a/versioneer.py +++ b/versioneer.py @@ -427,9 +427,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= return stdout, p.returncode -LONG_VERSION_PY[ - "git" -] = ''' +LONG_VERSION_PY["git"] = ''' # This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build