Hello @YuZhou, this is an interesting and very valid question that recently came up in discussions with @virvw and @sophie as well. The short answer is, we currently support doing this, but it’s on our todo list. We’ll hopefully have something ready within the next two weeks, but I cannot make any promises here. I’ll open an issue on GitHub with this feature request.
Thanks a lot for your reply Looking forward to the implementation of the new feature. You guys are really really cool to develop such a handy and excellent tool
By the way, if this new feature is added, will it be updated to version 0.23.dev0 or other versions？
We’ll need to see what will need to be changed to get this to work. Typically, we’ll add new features for new releases only (in this case, this would probably be the upcoming 0.23.0); although sometimes we also backport small and important enhancements to the current “stable” tree. It really depends on how drastic the changes are, and I cannot tell you that with certainty now for this feature. Although my gut feeling is it will only land in 0.23 and not be backported to 0.22, but who knows.
And yes, once this is implemented, it will be merged into the current development tree, i.e., 0.23.dev0.
Great! Actually, that’s exactly what I’m hoping, because the version I’m using is 0.23.dev0. So if this feature is added, what I need to do is to type this in my terminal in the mne environment, right?
i see this issue is supposed to be solved, but i have the same problem. i’m using mne 1.2.3., macOS-13.5.2-x86_64-i386-64bit and Python 3.9.15.
For me the problem is that SOMEtimes epochs.equalize_event_counts( [condition1, condition2) ] works, and sometimes it doesn’t. It does this in the same project, so the same version of MNE and everything else. When it doesn’t, the error is "KeyError: "adj/dist not found in the epoch object's event_id." (adj/dist is the string in the variable condition1 and corresponds to the event metadata). However, when it gives this error, and just one line below in the notebook i ask it to find epochs[condition1] it finds it ok. Any advice on how i should address this because i have many many event codes associated with condition1 (adj/dist) and it would be annoying to have to use the codes instead of just the annotation keywords…