From 06154409cbba43fa15e7627fe4b03da04dc774d1 Mon Sep 17 00:00:00 2001 From: Brian Gow Date: Tue, 29 Oct 2024 10:52:45 -0400 Subject: [PATCH] formatted with black package --- wfdb/io/_signal.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/wfdb/io/_signal.py b/wfdb/io/_signal.py index db878bc..e600dd4 100644 --- a/wfdb/io/_signal.py +++ b/wfdb/io/_signal.py @@ -830,7 +830,9 @@ def calc_adc_params(self): maxvals = np.nanmax(self.p_signal, axis=0) for ch in range(np.shape(self.p_signal)[1]): - adc_gain, baseline = self.calc_adc_gain_baseline(ch, minvals, maxvals) + adc_gain, baseline = self.calc_adc_gain_baseline( + ch, minvals, maxvals + ) adc_gains.append(adc_gain) baselines.append(baseline) @@ -841,16 +843,22 @@ def calc_adc_params(self): minvals.append(min(x for x in ch if not math.isnan(x))) maxvals.append(max(x for x in ch if not math.isnan(x))) - if any(x == math.inf for x in minvals) or any(x == math.inf for x in maxvals): + if any(x == math.inf for x in minvals) or any( + x == math.inf for x in maxvals + ): raise ValueError("Signal contains inf. Cannot perform adc.") for ch, _ in enumerate(self.e_p_signal): - adc_gain, baseline = self.calc_adc_gain_baseline(ch, minvals, maxvals) + adc_gain, baseline = self.calc_adc_gain_baseline( + ch, minvals, maxvals + ) adc_gains.append(adc_gain) baselines.append(baseline) else: - raise Exception('Must supply p_signal or e_p_signal to calc_adc_params') + raise Exception( + "Must supply p_signal or e_p_signal to calc_adc_params" + ) return (adc_gains, baselines)