New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: fix for empty event durations #8384
FIX: fix for empty event durations #8384
Conversation
It works. Thank you! |
@cbrnr Thanks for the comments, I'll return to this tomorrow. |
@mmagnuski can you add a what's new? thx +1 for MRG |
Can we add a test for this please? :) |
@agramfort Sure! |
Great, looking forward! |
Friendly poke @mmagnuski :) |
Thanks for reminding @hoechenberger, I'm on low time budget recently, sorry for delays (but, hey, it's been only 18 days! ;) ) |
@mmagnuski Great! And no worries, I can very much relate. |
4f055d6
to
88ccbc6
Compare
I don't understand why codecov is angry at me... :( |
ff37287
to
8359319
Compare
@larsoner - less smoke now and we can see the green CI fields. :) |
shutil.copyfile(op.join(base_dir, 'test_raw.fdt'), | ||
empty_dur_fname.replace('.set', '.fdt')) | ||
raw = read_raw_eeglab(input_fname=empty_dur_fname, preload=True) | ||
assert (raw.annotations.duration == 0).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't some or all of these been np.nan
based on the conditional in eeglab.py
and the ev.duration = np.array([], dtype='float')
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the eeglab reader turns np.nan
somewhere later into zeros. I can use zeros instead of nans if you think this would be better. But we may also decide to expose the nan durations in annotations at some time in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
I killed most CIs as we can safely ignore them (I just changed |
Thanks for the corrections! |
Thanks @mmagnuski ! |
Thanks @larsoner @cbrnr @agramfort @hoechenberger ! |
@ociepkam - Try if this works for you.
Reference issue
Fixes #8383.
What does this implement/fix?
It seems some eeglab files contain empty durations - these are read as empty errays from matlab files and cause error when trying to set the
durations
array.I'll add a test later.