|
1 | 1 | """functions of referencing part of PREP."""
|
| 2 | + |
2 | 3 | import logging
|
3 | 4 |
|
4 | 5 | import numpy as np
|
@@ -214,7 +215,7 @@ def robust_reference(self, max_iterations=4):
|
214 | 215 | noisy_detector.find_all_bads(**self.ransac_settings)
|
215 | 216 | self.noisy_channels_original = noisy_detector.get_bads(as_dict=True)
|
216 | 217 | self._extra_info["initial_bad"] = noisy_detector._extra_info
|
217 |
| - logger.info("Bad channels: {}".format(self.noisy_channels_original)) |
| 218 | + logger.info(f"Bad channels: {self.noisy_channels_original}") |
218 | 219 |
|
219 | 220 | # Determine channels to use/exclude from initial reference estimation
|
220 | 221 | self.unusable_channels = _union(
|
@@ -279,7 +280,7 @@ def robust_reference(self, max_iterations=4):
|
279 | 280 | if bad_type not in ignore:
|
280 | 281 | bad_chans.update(noisy[bad_type])
|
281 | 282 | noisy["bad_all"] = list(bad_chans)
|
282 |
| - logger.info("Bad channels: {}".format(noisy)) |
| 283 | + logger.info(f"Bad channels: {noisy}") |
283 | 284 |
|
284 | 285 | if (
|
285 | 286 | iterations > 1
|
@@ -313,7 +314,7 @@ def robust_reference(self, max_iterations=4):
|
313 | 314 | signal, self.reference_signal, reference_index
|
314 | 315 | )
|
315 | 316 | iterations = iterations + 1
|
316 |
| - logger.info("Iterations: {}".format(iterations)) |
| 317 | + logger.info(f"Iterations: {iterations}") |
317 | 318 |
|
318 | 319 | return self.noisy_channels, self.reference_signal
|
319 | 320 |
|
@@ -356,9 +357,7 @@ def remove_reference(signal, reference, index=None):
|
356 | 357 | else:
|
357 | 358 | if not isinstance(index, list):
|
358 | 359 | raise TypeError(
|
359 |
| - "RemoveReference: Expected type list, got {} instead".format( |
360 |
| - type(index) |
361 |
| - ) |
| 360 | + f"RemoveReference: Expected type list, got {type(index)} instead" |
362 | 361 | )
|
363 | 362 | signal_referenced = signal.copy()
|
364 | 363 | signal_referenced[np.asarray(index), :] = (
|
|
0 commit comments