ENH: Add the ids='all' as an option for mne.event.shift_time_events#6143
ENH: Add the ids='all' as an option for mne.event.shift_time_events#6143massich merged 12 commits intomne-tools:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6143 +/- ##
==========================================
+ Coverage 88.64% 89.01% +0.37%
==========================================
Files 407 410 +3
Lines 73764 73891 +127
Branches 12233 12256 +23
==========================================
+ Hits 65386 65774 +388
+ Misses 5512 5222 -290
- Partials 2866 2895 +29 |
larsoner
left a comment
There was a problem hiding this comment.
Any chance to add some small test? We might not have any tests for this function, in which case a 5-10 liner based on manually creating an ndarray should do it
mne/event.py
Outdated
| events[:, 0] += int(tshift * sfreq) | ||
| elif isinstance(ids, list): | ||
| for ii in ids: | ||
| events[events[:, 2] == ii, 0] += int(tshift * sfreq) |
There was a problem hiding this comment.
A nice DRY change would be to change the above branch mask=slice(None) and this one mask=np.in1d(events[:,2],IDs), then do the += below.
There was a problem hiding this comment.
(on mobile so please forgive the errors, hopefully you get the idea)
|
@Nichalas I pushed a few commits to clean things a bit. Can you add an entry to the |
|
@Nichalas tell us if you approved these changes so we can merge. Thx |
|
@agramfort yes, I approve! |
|
@Nichalas do you have a name/URL we should point to? We still need to update |
…thon into fix_shift_no_ids
|
thx @Nichalas !! |
I added this option so that I can call
shift_time_eventsin this manner: