Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] extend documentation for add_channels #13051

Open
wants to merge 1 commit into
base: maint/1.9
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
<https://mne.tools/mne-project-template/auto_examples/plot_mne_objects_from_arrays.html>`_
"""
# avoid circular imports
from ..epochs import BaseEpochs
Expand Down
Loading