Skip to content

Commit d6e9803

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e717335 commit d6e9803

File tree

5 files changed

+25
-52
lines changed

5 files changed

+25
-52
lines changed

phys2denoise/cli/run.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""Parser for phys2denoise."""
33

4-
54
import argparse
65

76
from phys2denoise import __version__

phys2denoise/metrics/cardiac.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,18 @@ def _cardiac_metrics(
8989
data = io.load_physio(data, fs=fs)
9090
data._metadata["peaks"] = peaks
9191
else:
92-
raise ValueError(
93-
"""
92+
raise ValueError("""
9493
To use this function you should either provide a Physio object
9594
with existing peaks metadata (e.g. using the peakdet module), or
9695
by providing the physiological data timeseries, the sampling frequency,
9796
and the peak indices separately.
98-
"""
99-
)
97+
""")
10098
if data.peaks.size == 0:
101-
raise ValueError(
102-
"""
99+
raise ValueError("""
103100
Peaks must be a non-empty list.
104101
Make sure to run peak detection on your physiological data first,
105102
using the peakdet module, or other software of your choice.
106-
"""
107-
)
103+
""")
108104

109105
# Convert window to samples, but halves it.
110106
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
384380
data = io.load_physio(data, fs=fs)
385381
data._metadata["peaks"] = peaks
386382
else:
387-
raise ValueError(
388-
"""
383+
raise ValueError("""
389384
To use this function you should either provide a Physio object
390385
with existing peaks metadata (e.g. using the peakdet module), or
391386
by providing the physiological data timeseries, the sampling frequency,
392387
and the peak indices separately.
393-
"""
394-
)
388+
""")
395389
if data.peaks.size == 0:
396-
raise ValueError(
397-
"""
390+
raise ValueError("""
398391
Peaks must be a non-empty list.
399392
Make sure to run peak detection on your physiological data first,
400393
using the peakdet module, or other software of your choice.
401-
"""
402-
)
394+
""")
403395

404396
assert slice_timings.ndim == 1, "Slice times must be a 1D array"
405397
n_slices = np.size(slice_timings)

phys2denoise/metrics/chest_belt.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,18 @@ def respiratory_variance_time(
5656
data._metadata["peaks"] = peaks
5757
data._metadata["troughs"] = troughs
5858
else:
59-
raise ValueError(
60-
"""
59+
raise ValueError("""
6160
To use this function you should either provide a Physio object
6261
with existing peaks and troughs metadata (e.g. using the peakdet module), or
6362
by providing the physiological data timeseries, the sampling frequency,
6463
and the peak and trough indices separately.
65-
"""
66-
)
64+
""")
6765
if data.peaks.size == 0 or data.troughs.size == 0:
68-
raise ValueError(
69-
"""
66+
raise ValueError("""
7067
Peaks and troughs must be non-empty lists.
7168
Make sure to run peak/trough detection on your physiological data first,
7269
using the peakdet module, or other software of your choice.
73-
"""
74-
)
70+
""")
7571

7672
timestep = 1 / data.fs
7773
# respiration belt timing
@@ -219,14 +215,12 @@ def _respiratory_pattern_variability(data, window):
219215
elif fs is not None:
220216
data = io.load_physio(data, fs=fs)
221217
else:
222-
raise ValueError(
223-
"""
218+
raise ValueError("""
224219
To use this function you should either provide a Physio object
225220
with the sampling frequency encapsulated, or
226221
by providing the physiological data timeseries and the sampling
227222
frequency separately.
228-
"""
229-
)
223+
""")
230224

231225
# Convert window to Hertz
232226
window = int(window * data.fs)
@@ -288,14 +282,12 @@ def respiratory_variance(data, fs=None, window=6, **kwargs):
288282
elif fs is not None:
289283
data = io.load_physio(data, fs=fs)
290284
else:
291-
raise ValueError(
292-
"""
285+
raise ValueError("""
293286
To use this function you should either provide a Physio object
294287
with the sampling frequency encapsulated, or
295288
by providing the physiological data timeseries and the sampling
296289
frequency separately.
297-
"""
298-
)
290+
""")
299291

300292
# Convert window to Hertz
301293
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):
338330
elif fs is not None:
339331
data = io.load_physio(data, fs=fs)
340332
else:
341-
raise ValueError(
342-
"""
333+
raise ValueError("""
343334
To use this function you should either provide a Physio object
344335
with the sampling frequency encapsulated, or
345336
by providing the physiological data timeseries and the sampling
346337
frequency separately.
347-
"""
348-
)
338+
""")
349339

350340
assert slice_timings.ndim == 1, "Slice times must be a 1D array"
351341
n_slices = np.size(slice_timings)

phys2denoise/metrics/multimodal.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,31 @@ def retroicor(
6666
if data.physio_type is None and physio_type is not None:
6767
data._physio_type = physio_type
6868
elif data.physio_type is None and physio_type is None:
69-
raise ValueError(
70-
"""
69+
raise ValueError("""
7170
Since the provided Physio object does not specify a `physio_type`,
7271
this function's `physio_type` parameter must be specified as a
7372
value from {'cardiac', 'respiratory'}
74-
"""
75-
)
73+
""")
7674

7775
elif fs is not None and physio_type is not None:
7876
data = io.load_physio(data, fs=fs)
7977
data._physio_type = physio_type
8078
if data.physio_type == "cardiac":
8179
data._metadata["peaks"] = cardiac_peaks
8280
else:
83-
raise ValueError(
84-
"""
81+
raise ValueError("""
8582
To use this function you should either provide a Physio object
8683
with existing peaks metadata if it describes a cardiac signal
8784
(e.g. using the peakdet module), or
8885
by providing the physiological data timeseries, the sampling frequency,
8986
the physio_type and the peak indices separately.
90-
"""
91-
)
87+
""")
9288
if not data.peaks and data.physio_type == "cardiac":
93-
raise ValueError(
94-
"""
89+
raise ValueError("""
9590
Peaks must be a non-empty list for cardiac data.
9691
Make sure to run peak detection on your cardiac data first,
9792
using the peakdet module, or other software of your choice.
98-
"""
99-
)
93+
""")
10094

10195
n_slices = np.shape(slice_timings) # number of slices
10296

versioneer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
427427
return stdout, p.returncode
428428

429429

430-
LONG_VERSION_PY[
431-
"git"
432-
] = '''
430+
LONG_VERSION_PY["git"] = '''
433431
# This file helps to compute a version number in source trees obtained from
434432
# git-archive tarball (such as those provided by githubs download-from-tag
435433
# feature). Distribution tarballs (built by setup.py sdist) and build

0 commit comments

Comments
 (0)