Skip to content

Commit 56a2242

Browse files
committed
DOC, FIX: add example to docstring and explicitly call pick
1 parent da58c7b commit 56a2242

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pylossless/pipeline.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,24 @@ def find_outlier_chs(self, epochs, picks="eeg"):
795795
Notes
796796
-----
797797
- This method is used to detect channels that are so noisy that they
798-
should be left out of the robust average rereference process.
798+
should be left out of the robust average rereference process.
799+
800+
Examples
801+
--------
802+
>>> import mne
803+
>>> import pylossless as ll
804+
>>> config = ll.Config().load_default()
805+
>>> pipeline = ll.LosslessPipeline(config=config)
806+
>>> fname = mne.datasets.sample.data_path() / "MEG/sample/sample_audvis_raw.fif"
807+
>>> raw = mne.io.read_raw(fname)
808+
>>> epochs = mne.make_fixed_length_epochs(raw, preload=True)
809+
>>> chs_to_leave_out = pipeline.find_outlier_chs(epochs=epochs)
799810
"""
800811
# TODO: Reuse _detect_outliers here.
801812
logger.info("🔍 Detecting channels to leave out of reference.")
802813
if epochs is None:
803-
epochs = self.get_epochs(rereference=False, picks=picks)
814+
epochs = self.get_epochs(rereference=False)
815+
epochs = epochs.copy().pick(picks=picks)
804816
epochs_xr = epochs_to_xr(epochs, kind="ch")
805817

806818
# Determines comically bad channels,

0 commit comments

Comments
 (0)