Open toddrjen opened 4 months ago
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴
this is where on_missing
would need to be added: https://github.com/mne-tools/mne-python/blob/43fb9d8c28193ad2c0e11c9282e65338e02f98b7/mne/channels/channels.py#L1970-L1978
Description of the problem
When using
mne.channels.combine_channels
onmne.Epochs
ormne.EpochsArray
objects with missing channels where the user had previously usedon_missing='ignore'
oron_missing='warn'
it will raise an exception. There does not appear to be a way withinmne.channels.combine_channels
to avoid the exception.Steps to reproduce
Link to data
No response
Expected results
Ideally the previous use of
on_missing='ignore'
oron_missing='warn'
would be stored and used again for constructing the newmne.EpochsArray
object, but at least having anon_missing
argument inmne.channels.combine_channels
would allow this problem to be avoided.Actual results
The following exception is raised, with apparently no way to avoid it other than manually removing the unused events:
Additional information
Platform Linux-5.15.0-105-generic-x86_64-with-glibc2.31 Python 3.10.11 (main, May 16 2023, 00:28:57) [GCC 11.2.0] Executable /home/toddrjen/bin/anaconda3/envs/mne/bin/python3 CPU x86_64 (16 cores) Memory 31.2 GB
Core ├☑ mne 1.7.0 (latest release) ├☑ numpy 1.26.4 (OpenBLAS 0.3.23.dev with 16 threads) ├☑ scipy 1.13.0 └☑ matplotlib 3.8.4 (backend=TkAgg)
Numerical (optional) ├☑ sklearn 1.4.2 ├☑ numba 0.59.1 ├☑ nibabel 5.2.1 ├☑ pandas 2.2.1 └☐ unavailable nilearn, dipy, openmeeg, cupy, h5io, h5py
Visualization (optional) ├☑ ipympl 0.9.4 ├☑ ipywidgets 8.1.2 └☐ unavailable pyvista, pyvistaqt, vtk, qtpy, pyqtgraph, mne-qt-browser, trame_client, trame_server, trame_vtk, trame_vuetify
Ecosystem (optional) └☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv