From 2de20b76980972316deb20edd9993315952a65bb Mon Sep 17 00:00:00 2001 From: Simon Kern <14980558+skjerns@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:21:25 +0100 Subject: [PATCH] extend documentation for add_channels --- mne/channels/channels.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mne/channels/channels.py b/mne/channels/channels.py index 8fbff33c13e..bb390059753 100644 --- a/mne/channels/channels.py +++ b/mne/channels/channels.py @@ -661,17 +661,21 @@ def _pick_projs(self): return self def add_channels(self, add_list, force_update_info=False): - """Append new channels to the instance. + """Append new channels from other MNE objects to the instance. Parameters ---------- add_list : list - A list of objects to append to self. Must contain all the same - type as the current object. + A list of MNE objects to append to the current instance. + The channels contained in the other instances are appended to the + channels of the current instance. Therefore, all other instances + must be of the same type as the current object. + See notes on how to add data coming from an array. force_update_info : bool If True, force the info for objects to be appended to match the - values in ``self``. This should generally only be used when adding - stim channels for which important metadata won't be overwritten. + values of the current instance. This should generally only be + used when adding stim channels for which important metadata won't + be overwritten. .. versionadded:: 0.12 @@ -688,6 +692,11 @@ def add_channels(self, add_list, force_update_info=False): ----- If ``self`` is a Raw instance that has been preloaded into a :obj:`numpy.memmap` instance, the memmap will be resized. + + This function expects a MNE object to be appended. If you simply want + to add a channel based on values of an array, you need to create a + :class:`~mne.io.RawArray` first. See + `_ """ # avoid circular imports from ..epochs import BaseEpochs