Skip to content

Commit b9e9076

Browse files
author
Mathieu Scheltienne
authored
Correctly prune channel-specific annotations when creating Epochs (mne-tools#12010)
1 parent 7a91c47 commit b9e9076

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

doc/changes/devel.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Bugs
5555
- Fix bug with ``subject_info`` when loading data from and exporting to EDF file (:gh:`11952` by `Paul Roujansky`_)
5656
- Fix handling of channel information in annotations when loading data from and exporting to EDF file (:gh:`11960` by `Paul Roujansky`_)
5757
- Add missing ``overwrite`` and ``verbose`` parameters to :meth:`Transform.save() <mne.transforms.Transform.save>` (:gh:`12004` by `Marijn van Vliet`_)
58+
- Correctly prune channel-specific :class:`~mne.Annotations` when creating :class:`~mne.Epochs` without the channel(s) included in the channel specific annotations (:gh:`12010` by `Mathieu Scheltienne`_)
5859

5960
API changes
6061
~~~~~~~~~~~

mne/annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def set_annotations(self, annotations, on_missing="raise", *, verbose=None):
817817
"disk) before 1.0 will yield incorrect results if "
818818
"decimation or resampling was performed on the instance, "
819819
"we recommend regenerating the Epochs and re-saving them "
820-
"to disk"
820+
"to disk."
821821
)
822822
new_annotations = annotations.copy()
823823
new_annotations._prune_ch_names(self.info, on_missing)

mne/epochs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def __init__(
691691
raw_sfreq = self.info["sfreq"]
692692
self._raw_sfreq = raw_sfreq
693693
self._check_consistency()
694-
self.set_annotations(annotations)
694+
self.set_annotations(annotations, on_missing="ignore")
695695

696696
def _check_consistency(self):
697697
"""Check invariants of epochs object."""

0 commit comments

Comments
 (0)