ezmsg-sigproc 2.5.0__py3-none-any.whl → 2.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. ezmsg/sigproc/__version__.py +2 -2
  2. ezmsg/sigproc/activation.py +5 -11
  3. ezmsg/sigproc/adaptive_lattice_notch.py +11 -29
  4. ezmsg/sigproc/affinetransform.py +13 -38
  5. ezmsg/sigproc/aggregate.py +13 -30
  6. ezmsg/sigproc/bandpower.py +7 -15
  7. ezmsg/sigproc/base.py +141 -1276
  8. ezmsg/sigproc/butterworthfilter.py +8 -16
  9. ezmsg/sigproc/butterworthzerophase.py +7 -16
  10. ezmsg/sigproc/cheby.py +4 -10
  11. ezmsg/sigproc/combfilter.py +5 -8
  12. ezmsg/sigproc/decimate.py +2 -6
  13. ezmsg/sigproc/denormalize.py +6 -11
  14. ezmsg/sigproc/detrend.py +3 -4
  15. ezmsg/sigproc/diff.py +8 -17
  16. ezmsg/sigproc/downsample.py +6 -14
  17. ezmsg/sigproc/ewma.py +11 -27
  18. ezmsg/sigproc/ewmfilter.py +1 -1
  19. ezmsg/sigproc/extract_axis.py +3 -4
  20. ezmsg/sigproc/fbcca.py +31 -56
  21. ezmsg/sigproc/filter.py +19 -45
  22. ezmsg/sigproc/filterbank.py +33 -70
  23. ezmsg/sigproc/filterbankdesign.py +5 -12
  24. ezmsg/sigproc/fir_hilbert.py +13 -30
  25. ezmsg/sigproc/fir_pmc.py +5 -10
  26. ezmsg/sigproc/firfilter.py +12 -14
  27. ezmsg/sigproc/gaussiansmoothing.py +5 -9
  28. ezmsg/sigproc/kaiser.py +11 -15
  29. ezmsg/sigproc/math/abs.py +1 -3
  30. ezmsg/sigproc/math/add.py +121 -0
  31. ezmsg/sigproc/math/clip.py +1 -1
  32. ezmsg/sigproc/math/difference.py +98 -36
  33. ezmsg/sigproc/math/invert.py +1 -3
  34. ezmsg/sigproc/math/log.py +2 -6
  35. ezmsg/sigproc/messages.py +1 -2
  36. ezmsg/sigproc/quantize.py +2 -4
  37. ezmsg/sigproc/resample.py +13 -34
  38. ezmsg/sigproc/rollingscaler.py +12 -37
  39. ezmsg/sigproc/sampler.py +17 -35
  40. ezmsg/sigproc/scaler.py +8 -18
  41. ezmsg/sigproc/signalinjector.py +6 -16
  42. ezmsg/sigproc/slicer.py +9 -28
  43. ezmsg/sigproc/spectral.py +3 -3
  44. ezmsg/sigproc/spectrogram.py +12 -19
  45. ezmsg/sigproc/spectrum.py +12 -32
  46. ezmsg/sigproc/transpose.py +7 -18
  47. ezmsg/sigproc/util/asio.py +25 -156
  48. ezmsg/sigproc/util/axisarray_buffer.py +10 -26
  49. ezmsg/sigproc/util/buffer.py +18 -43
  50. ezmsg/sigproc/util/message.py +17 -31
  51. ezmsg/sigproc/util/profile.py +23 -174
  52. ezmsg/sigproc/util/sparse.py +5 -15
  53. ezmsg/sigproc/util/typeresolution.py +17 -83
  54. ezmsg/sigproc/wavelets.py +6 -15
  55. ezmsg/sigproc/window.py +24 -78
  56. {ezmsg_sigproc-2.5.0.dist-info → ezmsg_sigproc-2.6.0.dist-info}/METADATA +3 -2
  57. ezmsg_sigproc-2.6.0.dist-info/RECORD +63 -0
  58. ezmsg/sigproc/synth.py +0 -774
  59. ezmsg_sigproc-2.5.0.dist-info/RECORD +0 -63
  60. {ezmsg_sigproc-2.5.0.dist-info → ezmsg_sigproc-2.6.0.dist-info}/WHEEL +0 -0
  61. /ezmsg_sigproc-2.5.0.dist-info/licenses/LICENSE.txt → /ezmsg_sigproc-2.6.0.dist-info/licenses/LICENSE +0 -0
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '2.5.0'
32
- __version_tuple__ = version_tuple = (2, 5, 0)
31
+ __version__ = version = '2.6.0'
32
+ __version_tuple__ = version_tuple = (2, 6, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,10 +1,10 @@
1
- import scipy.special
2
1
  import ezmsg.core as ez
2
+ import scipy.special
3
3
  from ezmsg.util.messages.axisarray import AxisArray
4
4
  from ezmsg.util.messages.util import replace
5
5
 
6
- from .spectral import OptionsEnum
7
6
  from .base import BaseTransformer, BaseTransformerUnit
7
+ from .spectral import OptionsEnum
8
8
 
9
9
 
10
10
  class ActivationFunction(OptionsEnum):
@@ -50,20 +50,14 @@ class ActivationTransformer(BaseTransformer[ActivationSettings, AxisArray, AxisA
50
50
  # str type handling
51
51
  function = self.settings.function.lower()
52
52
  if function not in ActivationFunction.options():
53
- raise ValueError(
54
- f"Unrecognized activation function {function}. Must be one of {ACTIVATIONS.keys()}"
55
- )
56
- function = list(ACTIVATIONS.keys())[
57
- ActivationFunction.options().index(function)
58
- ]
53
+ raise ValueError(f"Unrecognized activation function {function}. Must be one of {ACTIVATIONS.keys()}")
54
+ function = list(ACTIVATIONS.keys())[ActivationFunction.options().index(function)]
59
55
  func = ACTIVATIONS[function]
60
56
 
61
57
  return replace(message, data=func(message.data))
62
58
 
63
59
 
64
- class Activation(
65
- BaseTransformerUnit[ActivationSettings, AxisArray, AxisArray, ActivationTransformer]
66
- ):
60
+ class Activation(BaseTransformerUnit[ActivationSettings, AxisArray, AxisArray, ActivationTransformer]):
67
61
  SETTINGS = ActivationSettings
68
62
 
69
63
 
@@ -1,11 +1,11 @@
1
+ import ezmsg.core as ez
1
2
  import numpy as np
2
3
  import numpy.typing as npt
3
4
  import scipy.signal
4
- import ezmsg.core as ez
5
5
  from ezmsg.util.messages.axisarray import AxisArray, CoordinateAxis
6
6
  from ezmsg.util.messages.util import replace
7
7
 
8
- from .base import processor_state, BaseStatefulTransformer
8
+ from .base import BaseStatefulTransformer, processor_state
9
9
 
10
10
 
11
11
  class AdaptiveLatticeNotchFilterSettings(ez.Settings):
@@ -76,9 +76,7 @@ class AdaptiveLatticeNotchFilterTransformer(
76
76
 
77
77
  fs = 1 / message.axes[self.settings.axis].gain
78
78
  init_f = (
79
- self.settings.init_notch_freq
80
- if self.settings.init_notch_freq is not None
81
- else 0.07178314656435313 * fs
79
+ self.settings.init_notch_freq if self.settings.init_notch_freq is not None else 0.07178314656435313 * fs
82
80
  )
83
81
  init_omega = init_f * (2 * np.pi) / fs
84
82
  init_k1 = -np.cos(init_omega)
@@ -91,9 +89,7 @@ class AdaptiveLatticeNotchFilterTransformer(
91
89
  self._state.k1 = init_k1 + np.zeros(sample_shape, dtype=float)
92
90
  self._state.freq_template = CoordinateAxis(
93
91
  data=np.zeros((0,) + sample_shape, dtype=float),
94
- dims=[self.settings.axis]
95
- + message.dims[:ax_idx]
96
- + message.dims[ax_idx + 1 :],
92
+ dims=[self.settings.axis] + message.dims[:ax_idx] + message.dims[ax_idx + 1 :],
97
93
  unit="Hz",
98
94
  )
99
95
 
@@ -147,9 +143,7 @@ class AdaptiveLatticeNotchFilterTransformer(
147
143
  for ix, k in enumerate(self._state.k1.flatten()):
148
144
  # Filter to get s_n (notch filter state)
149
145
  a_s = [1, k * gamma_plus_1, gamma]
150
- s_n[:, ix], self._state.zi[:, ix] = scipy.signal.lfilter(
151
- [1], a_s, _x[:, ix], zi=self._state.zi[:, ix]
152
- )
146
+ s_n[:, ix], self._state.zi[:, ix] = scipy.signal.lfilter([1], a_s, _x[:, ix], zi=self._state.zi[:, ix])
153
147
 
154
148
  # Apply output filter to get y_out
155
149
  b_y = [1, 2 * k, 1]
@@ -159,17 +153,11 @@ class AdaptiveLatticeNotchFilterTransformer(
159
153
  s_n_reshaped = s_n.reshape((s_n.shape[0],) + x_data.shape[1:])
160
154
  s_final = s_n_reshaped[-1] # Current s_n
161
155
  s_final_1 = s_n_reshaped[-2] # s_n_1
162
- s_final_2 = (
163
- s_n_reshaped[-3] if len(s_n_reshaped) > 2 else self._state.s_history[0]
164
- ) # s_n_2
156
+ s_final_2 = s_n_reshaped[-3] if len(s_n_reshaped) > 2 else self._state.s_history[0] # s_n_2
165
157
 
166
158
  # Update p and q using final values
167
- self._state.p = eta * self._state.p + one_minus_eta * (
168
- s_final_1 * (s_final + s_final_2)
169
- )
170
- self._state.q = eta * self._state.q + one_minus_eta * (
171
- 2 * (s_final_1 * s_final_1)
172
- )
159
+ self._state.p = eta * self._state.p + one_minus_eta * (s_final_1 * (s_final + s_final_2))
160
+ self._state.q = eta * self._state.q + one_minus_eta * (2 * (s_final_1 * s_final_1))
173
161
 
174
162
  # Update reflection coefficient
175
163
  new_k1 = -self._state.p / (self._state.q + 1e-8) # Avoid division by zero
@@ -199,17 +187,11 @@ class AdaptiveLatticeNotchFilterTransformer(
199
187
  y_out[sample_ix] = s_n + 2 * self._state.k1 * s_n_1 + s_n_2
200
188
 
201
189
  # Update filter parameters
202
- self._state.p = eta * self._state.p + one_minus_eta * (
203
- s_n_1 * (s_n + s_n_2)
204
- )
205
- self._state.q = eta * self._state.q + one_minus_eta * (
206
- 2 * (s_n_1 * s_n_1)
207
- )
190
+ self._state.p = eta * self._state.p + one_minus_eta * (s_n_1 * (s_n + s_n_2))
191
+ self._state.q = eta * self._state.q + one_minus_eta * (2 * (s_n_1 * s_n_1))
208
192
 
209
193
  # Update reflection coefficient
210
- new_k1 = -self._state.p / (
211
- self._state.q + 1e-8
212
- ) # Avoid division by zero
194
+ new_k1 = -self._state.p / (self._state.q + 1e-8) # Avoid division by zero
213
195
  new_k1 = np.clip(new_k1, -1, 1) # Clip to prevent instability
214
196
  self._state.k1 = mu * self._state.k1 + one_minus_mu * new_k1 # Smoothed
215
197
 
@@ -1,16 +1,16 @@
1
1
  import os
2
2
  from pathlib import Path
3
3
 
4
+ import ezmsg.core as ez
4
5
  import numpy as np
5
6
  import numpy.typing as npt
6
- import ezmsg.core as ez
7
7
  from ezmsg.util.messages.axisarray import AxisArray, AxisBase
8
8
  from ezmsg.util.messages.util import replace
9
9
 
10
10
  from .base import (
11
11
  BaseStatefulTransformer,
12
- BaseTransformerUnit,
13
12
  BaseTransformer,
13
+ BaseTransformerUnit,
14
14
  processor_state,
15
15
  )
16
16
 
@@ -38,15 +38,12 @@ class AffineTransformState:
38
38
 
39
39
 
40
40
  class AffineTransformTransformer(
41
- BaseStatefulTransformer[
42
- AffineTransformSettings, AxisArray, AxisArray, AffineTransformState
43
- ]
41
+ BaseStatefulTransformer[AffineTransformSettings, AxisArray, AxisArray, AffineTransformState]
44
42
  ):
45
43
  def __call__(self, message: AxisArray) -> AxisArray:
46
44
  # Override __call__ so we can shortcut if weights are None.
47
45
  if self.settings.weights is None or (
48
- isinstance(self.settings.weights, str)
49
- and self.settings.weights == "passthrough"
46
+ isinstance(self.settings.weights, str) and self.settings.weights == "passthrough"
50
47
  ):
51
48
  return message
52
49
  return super().__call__(message)
@@ -68,18 +65,12 @@ class AffineTransformTransformer(
68
65
  self._state.weights = weights
69
66
 
70
67
  axis = self.settings.axis or message.dims[-1]
71
- if (
72
- axis in message.axes
73
- and hasattr(message.axes[axis], "data")
74
- and weights.shape[0] != weights.shape[1]
75
- ):
68
+ if axis in message.axes and hasattr(message.axes[axis], "data") and weights.shape[0] != weights.shape[1]:
76
69
  in_labels = message.axes[axis].data
77
70
  new_labels = []
78
71
  n_in, n_out = weights.shape
79
72
  if len(in_labels) != n_in:
80
- ez.logger.warning(
81
- f"Received {len(in_labels)} for {n_in} inputs. Check upstream labels."
82
- )
73
+ ez.logger.warning(f"Received {len(in_labels)} for {n_in} inputs. Check upstream labels.")
83
74
  else:
84
75
  b_filled_outputs = np.any(weights, axis=0)
85
76
  b_used_inputs = np.any(weights, axis=1)
@@ -97,9 +88,7 @@ class AffineTransformTransformer(
97
88
  elif np.all(b_filled_outputs):
98
89
  new_labels = np.array(in_labels)[b_used_inputs]
99
90
 
100
- self._state.new_axis = replace(
101
- message.axes[axis], data=np.array(new_labels)
102
- )
91
+ self._state.new_axis = replace(message.axes[axis], data=np.array(new_labels))
103
92
 
104
93
  def _process(self, message: AxisArray) -> AxisArray:
105
94
  axis = self.settings.axis or message.dims[-1]
@@ -110,9 +99,7 @@ class AffineTransformTransformer(
110
99
  # The weights are stacked A|B where A is the transform and B is a single row
111
100
  # in the equation y = Ax + B. This supports NeuroKey's weights matrices.
112
101
  sample_shape = data.shape[:axis_idx] + (1,) + data.shape[axis_idx + 1 :]
113
- data = np.concatenate(
114
- (data, np.ones(sample_shape).astype(data.dtype)), axis=axis_idx
115
- )
102
+ data = np.concatenate((data, np.ones(sample_shape).astype(data.dtype)), axis=axis_idx)
116
103
 
117
104
  if axis_idx in [-1, len(message.dims) - 1]:
118
105
  data = np.matmul(data, self._state.weights)
@@ -128,11 +115,7 @@ class AffineTransformTransformer(
128
115
  return replace(message, **replace_kwargs)
129
116
 
130
117
 
131
- class AffineTransform(
132
- BaseTransformerUnit[
133
- AffineTransformSettings, AxisArray, AxisArray, AffineTransformTransformer
134
- ]
135
- ):
118
+ class AffineTransform(BaseTransformerUnit[AffineTransformSettings, AxisArray, AxisArray, AffineTransformTransformer]):
136
119
  SETTINGS = AffineTransformSettings
137
120
 
138
121
 
@@ -153,9 +136,7 @@ def affine_transform(
153
136
  :obj:`AffineTransformTransformer`.
154
137
  """
155
138
  return AffineTransformTransformer(
156
- AffineTransformSettings(
157
- weights=weights, axis=axis, right_multiply=right_multiply
158
- )
139
+ AffineTransformSettings(weights=weights, axis=axis, right_multiply=right_multiply)
159
140
  )
160
141
 
161
142
 
@@ -178,9 +159,7 @@ class CommonRereferenceSettings(ez.Settings):
178
159
  """Set False to exclude each channel from participating in the calculation of its reference."""
179
160
 
180
161
 
181
- class CommonRereferenceTransformer(
182
- BaseTransformer[CommonRereferenceSettings, AxisArray, AxisArray]
183
- ):
162
+ class CommonRereferenceTransformer(BaseTransformer[CommonRereferenceSettings, AxisArray, AxisArray]):
184
163
  def _process(self, message: AxisArray) -> AxisArray:
185
164
  if self.settings.mode == "passthrough":
186
165
  return message
@@ -188,9 +167,7 @@ class CommonRereferenceTransformer(
188
167
  axis = self.settings.axis or message.dims[-1]
189
168
  axis_idx = message.get_axis_idx(axis)
190
169
 
191
- func = {"mean": np.mean, "median": np.median, "passthrough": zeros_for_noop}[
192
- self.settings.mode
193
- ]
170
+ func = {"mean": np.mean, "median": np.median, "passthrough": zeros_for_noop}[self.settings.mode]
194
171
 
195
172
  ref_data = func(message.data, axis=axis_idx, keepdims=True)
196
173
 
@@ -213,9 +190,7 @@ class CommonRereferenceTransformer(
213
190
 
214
191
 
215
192
  class CommonRereference(
216
- BaseTransformerUnit[
217
- CommonRereferenceSettings, AxisArray, AxisArray, CommonRereferenceTransformer
218
- ]
193
+ BaseTransformerUnit[CommonRereferenceSettings, AxisArray, AxisArray, CommonRereferenceTransformer]
219
194
  ):
220
195
  SETTINGS = CommonRereferenceSettings
221
196
 
@@ -1,23 +1,23 @@
1
- from array_api_compat import get_namespace
2
1
  import typing
3
2
 
3
+ import ezmsg.core as ez
4
4
  import numpy as np
5
5
  import numpy.typing as npt
6
- import ezmsg.core as ez
6
+ from array_api_compat import get_namespace
7
7
  from ezmsg.util.messages.axisarray import (
8
8
  AxisArray,
9
- slice_along_axis,
10
9
  AxisBase,
11
10
  replace,
11
+ slice_along_axis,
12
12
  )
13
13
 
14
- from .spectral import OptionsEnum
15
14
  from .base import (
16
- BaseTransformer,
17
15
  BaseStatefulTransformer,
16
+ BaseTransformer,
18
17
  BaseTransformerUnit,
19
18
  processor_state,
20
19
  )
20
+ from .spectral import OptionsEnum
21
21
 
22
22
 
23
23
  class AggregationFunction(OptionsEnum):
@@ -89,9 +89,7 @@ class RangedAggregateState:
89
89
 
90
90
 
91
91
  class RangedAggregateTransformer(
92
- BaseStatefulTransformer[
93
- RangedAggregateSettings, AxisArray, AxisArray, RangedAggregateState
94
- ]
92
+ BaseStatefulTransformer[RangedAggregateSettings, AxisArray, AxisArray, RangedAggregateState]
95
93
  ):
96
94
  def __call__(self, message: AxisArray) -> AxisArray:
97
95
  # Override for shortcut passthrough mode.
@@ -118,16 +116,12 @@ class RangedAggregateTransformer(
118
116
  if hasattr(target_axis, "data"):
119
117
  self._state.ax_vec = target_axis.data
120
118
  else:
121
- self._state.ax_vec = target_axis.value(
122
- np.arange(message.data.shape[ax_idx])
123
- )
119
+ self._state.ax_vec = target_axis.value(np.arange(message.data.shape[ax_idx]))
124
120
 
125
121
  ax_dat = []
126
122
  slices = []
127
123
  for start, stop in self.settings.bands:
128
- inds = np.where(
129
- np.logical_and(self._state.ax_vec >= start, self._state.ax_vec <= stop)
130
- )[0]
124
+ inds = np.where(np.logical_and(self._state.ax_vec >= start, self._state.ax_vec <= stop))[0]
131
125
  slices.append(np.s_[inds[0] : inds[-1] + 1])
132
126
  if hasattr(target_axis, "data"):
133
127
  if self._state.ax_vec.dtype.type is np.str_:
@@ -164,8 +158,7 @@ class RangedAggregateTransformer(
164
158
  ]
165
159
  else:
166
160
  out_data = [
167
- agg_func(slice_along_axis(message.data, sl, axis=ax_idx), axis=ax_idx)
168
- for sl in self._state.slices
161
+ agg_func(slice_along_axis(message.data, sl, axis=ax_idx), axis=ax_idx) for sl in self._state.slices
169
162
  ]
170
163
 
171
164
  msg_out = replace(
@@ -187,11 +180,7 @@ class RangedAggregateTransformer(
187
180
  return msg_out
188
181
 
189
182
 
190
- class RangedAggregate(
191
- BaseTransformerUnit[
192
- RangedAggregateSettings, AxisArray, AxisArray, RangedAggregateTransformer
193
- ]
194
- ):
183
+ class RangedAggregate(BaseTransformerUnit[RangedAggregateSettings, AxisArray, AxisArray, RangedAggregateTransformer]):
195
184
  SETTINGS = RangedAggregateSettings
196
185
 
197
186
 
@@ -212,9 +201,7 @@ def ranged_aggregate(
212
201
  Returns:
213
202
  :obj:`RangedAggregateTransformer`
214
203
  """
215
- return RangedAggregateTransformer(
216
- RangedAggregateSettings(axis=axis, bands=bands, operation=operation)
217
- )
204
+ return RangedAggregateTransformer(RangedAggregateSettings(axis=axis, bands=bands, operation=operation))
218
205
 
219
206
 
220
207
  class AggregateSettings(ez.Settings):
@@ -242,9 +229,7 @@ class AggregateTransformer(BaseTransformer[AggregateSettings, AxisArray, AxisArr
242
229
  op = self.settings.operation
243
230
 
244
231
  if op == AggregationFunction.NONE:
245
- raise ValueError(
246
- "AggregationFunction.NONE is not supported for full-axis aggregation"
247
- )
232
+ raise ValueError("AggregationFunction.NONE is not supported for full-axis aggregation")
248
233
 
249
234
  if op == AggregationFunction.TRAPEZOID:
250
235
  # Trapezoid integration requires x-coordinates
@@ -276,9 +261,7 @@ class AggregateTransformer(BaseTransformer[AggregateSettings, AxisArray, AxisArr
276
261
  )
277
262
 
278
263
 
279
- class AggregateUnit(
280
- BaseTransformerUnit[AggregateSettings, AxisArray, AxisArray, AggregateTransformer]
281
- ):
264
+ class AggregateUnit(BaseTransformerUnit[AggregateSettings, AxisArray, AxisArray, AggregateTransformer]):
282
265
  """Unit that aggregates an entire axis using a specified operation."""
283
266
 
284
267
  SETTINGS = AggregateSettings
@@ -3,18 +3,18 @@ from dataclasses import field
3
3
  import ezmsg.core as ez
4
4
  from ezmsg.util.messages.axisarray import AxisArray
5
5
 
6
- from .spectrogram import SpectrogramSettings, SpectrogramTransformer
7
6
  from .aggregate import (
8
7
  AggregationFunction,
9
- RangedAggregateTransformer,
10
8
  RangedAggregateSettings,
9
+ RangedAggregateTransformer,
11
10
  )
12
11
  from .base import (
13
12
  BaseProcessor,
14
- CompositeProcessor,
15
13
  BaseStatefulProcessor,
16
14
  BaseTransformerUnit,
15
+ CompositeProcessor,
17
16
  )
17
+ from .spectrogram import SpectrogramSettings, SpectrogramTransformer
18
18
 
19
19
 
20
20
  class BandPowerSettings(ez.Settings):
@@ -22,16 +22,12 @@ class BandPowerSettings(ez.Settings):
22
22
  Settings for ``BandPower``.
23
23
  """
24
24
 
25
- spectrogram_settings: SpectrogramSettings = field(
26
- default_factory=SpectrogramSettings
27
- )
25
+ spectrogram_settings: SpectrogramSettings = field(default_factory=SpectrogramSettings)
28
26
  """
29
27
  Settings for spectrogram calculation.
30
28
  """
31
29
 
32
- bands: list[tuple[float, float]] | None = field(
33
- default_factory=lambda: [(17, 30), (70, 170)]
34
- )
30
+ bands: list[tuple[float, float]] | None = field(default_factory=lambda: [(17, 30), (70, 170)])
35
31
  """
36
32
  (min, max) tuples of band limits in Hz.
37
33
  """
@@ -46,9 +42,7 @@ class BandPowerTransformer(CompositeProcessor[BandPowerSettings, AxisArray, Axis
46
42
  settings: BandPowerSettings,
47
43
  ) -> dict[str, BaseProcessor | BaseStatefulProcessor]:
48
44
  return {
49
- "spectrogram": SpectrogramTransformer(
50
- settings=settings.spectrogram_settings
51
- ),
45
+ "spectrogram": SpectrogramTransformer(settings=settings.spectrogram_settings),
52
46
  "aggregate": RangedAggregateTransformer(
53
47
  settings=RangedAggregateSettings(
54
48
  axis="freq",
@@ -59,9 +53,7 @@ class BandPowerTransformer(CompositeProcessor[BandPowerSettings, AxisArray, Axis
59
53
  }
60
54
 
61
55
 
62
- class BandPower(
63
- BaseTransformerUnit[BandPowerSettings, AxisArray, AxisArray, BandPowerTransformer]
64
- ):
56
+ class BandPower(BaseTransformerUnit[BandPowerSettings, AxisArray, AxisArray, BandPowerTransformer]):
65
57
  SETTINGS = BandPowerSettings
66
58
 
67
59