Skip to content

Commit 5fec4e0

Browse files
authored
[DOC] extend documentation for add_channels (mne-tools#13051)
1 parent 2ae61ed commit 5fec4e0

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

mne/channels/channels.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,21 @@ def _pick_projs(self):
661661
return self
662662

663663
def add_channels(self, add_list, force_update_info=False):
664-
"""Append new channels to the instance.
664+
"""Append new channels from other MNE objects to the instance.
665665
666666
Parameters
667667
----------
668668
add_list : list
669-
A list of objects to append to self. Must contain all the same
670-
type as the current object.
669+
A list of MNE objects to append to the current instance.
670+
The channels contained in the other instances are appended to the
671+
channels of the current instance. Therefore, all other instances
672+
must be of the same type as the current object.
673+
See notes on how to add data coming from an array.
671674
force_update_info : bool
672675
If True, force the info for objects to be appended to match the
673-
values in ``self``. This should generally only be used when adding
674-
stim channels for which important metadata won't be overwritten.
676+
values of the current instance. This should generally only be
677+
used when adding stim channels for which important metadata won't
678+
be overwritten.
675679
676680
.. versionadded:: 0.12
677681
@@ -688,6 +692,12 @@ def add_channels(self, add_list, force_update_info=False):
688692
-----
689693
If ``self`` is a Raw instance that has been preloaded into a
690694
:obj:`numpy.memmap` instance, the memmap will be resized.
695+
696+
This function expects an MNE object to be appended (e.g. :class:`~mne.io.Raw`,
697+
:class:`~mne.Epochs`, :class:`~mne.Evoked`). If you simply want to add a
698+
channel based on values of an np.ndarray, you need to create a
699+
:class:`~mne.io.RawArray`.
700+
See <https://mne.tools/mne-project-template/auto_examples/plot_mne_objects_from_arrays.html>`_
691701
"""
692702
# avoid circular imports
693703
from ..epochs import BaseEpochs

0 commit comments

Comments
 (0)