Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/changes/dev/14210.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow :class:`mne.Epochs` to hold trials of different duration by passing ``tmin`` and/or ``tmax`` as arrays with one entry per event, with :meth:`mne.Epochs.as_fixed` to obtain a fixed-duration copy spanning their union together with the number of epochs contributing at each time point, and with :meth:`mne.Epochs.plot` browsing them at their own lengths rather than padding, demonstrated in :ref:`tut-variable-duration-epochs`, by `Sina Esmaeili`_.
1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@
.. _Simon Kornblith: https://simonster.com
.. _Simon M. Hofmann: https://github.com/SHEscher
.. _Simon-Shlomo Poil: https://github.com/simon-shlomo
.. _Sina Esmaeili: https://github.com/snesmaeili
.. _Sondre Foslien: https://github.com/sondrfos
.. _Sophie Herbst: https://github.com/SophieHerbst
.. _Sourav Singh: https://github.com/souravsingh
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
( # BaseRaw attributes are documented in Raw
"py:obj",
"(filename|metadata|proj|times|tmax|tmin|annotations|ch_names"
"|compensation_grade|duration|filenames|first_samp|first_time"
"|last_samp|n_times|proj|times|tmax|tmin)",
"|compensation_grade|duration|durations|filenames|first_samp|first_time"
"|last_samp|n_times|proj|times|tmax|tmin|variable_duration)",
),
]
suppress_warnings = [
Expand Down
7 changes: 6 additions & 1 deletion mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,12 @@ def _pick_drop_channels(self, idx, *, verbose=None):
else: # All others (Evoked, Epochs, Raw) have chs axis=-2
axis = -2
if hasattr(self, "_data"): # skip non-preloaded Raw
self._data = self._data.take(idx, axis=axis)
if isinstance(self._data, list):
# replacing the contents rather than the attribute keeps `_data`
# an ndarray everywhere else this mixin is used
self._data[:] = [epoch.take(idx, axis=axis) for epoch in self._data]
else:
self._data = self._data.take(idx, axis=axis)
else:
assert isinstance(self, BaseRaw) and not self.preload

Expand Down
Loading
Loading