Skip to content
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

Wrong logic excluding event codes with just one event in read_raw_egi #11626

Open
jackz314 opened this issue Apr 13, 2023 · 1 comment · May be fixed by #11627
Open

Wrong logic excluding event codes with just one event in read_raw_egi #11626

jackz314 opened this issue Apr 13, 2023 · 1 comment · May be fixed by #11627
Labels

Comments

@jackz314
Copy link
Contributor

jackz314 commented Apr 13, 2023

Description of the problem

I believe when creating a RawMFF object, the logic for excluding events with just one event is wrong (line 434), it rejects them if event.sum() <= 1, but event.sum() could be more than 1 since it contains the event id (1 to n_events), a more appropriate to do this would be something like np.count_nonzero(event) <= 1

Also, in the documentation for read_raw_egi, which uses RawMFF, it says

The event channels to be ignored when creating the synthetic trigger. Defaults to None. If None, channels that have more than one event and the sync and TREV channels will be ignored.

which I believe is also wrong.

I can submit a PR once this is confirmed.

Related, I think it might be helpful to keep events that only occur once, they could be important tags that indicate start/end of experiments for example, a suitable place might be in the annotations.

Steps to reproduce

Import raw mff files

Link to data

No response

Expected results

All one-shot events excluded

Actual results

Only the first one-shot event (with ID 0) is excluded

Additional information

Draft PR #11627

@jackz314 jackz314 added the BUG label Apr 13, 2023
@jackz314 jackz314 linked a pull request Apr 13, 2023 that will close this issue
@jackz314
Copy link
Contributor Author

I also find the warning "Did not find any event code with more than one event." a bit confusing, I'm not sure why these one-shot events are preserved if none of the event codes have more than one event, maybe someone more familiar with behavior could help me understand? cc @ramonapariciog @agramfort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant