-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow passing list of dict as argument to events parameter (=allow writing mne.annotations to VMRK) #86
Conversation
Codecov Report
@@ Coverage Diff @@
## main #86 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 3 3
Lines 431 535 +104
==========================================
+ Hits 431 535 +104
Continue to review full report at Codecov.
|
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.
in general I should probably make it so that "under the hood", everything is using the "list of dict" API 🤔 --> when array is being passed, this is quickly converted inside the func
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.
Hey @hoechenberger @cbrnr @adam2392 note this feature :-)
I hope this will allow us to add pybv as an "export" module to mne-python soon.
Feel free to review and let me know if you have suggestions for improvements.
Test failures are unrelated / due to some Internet issue
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.
I didn't run and test your changes myself, but I assume that your tests cover these additions. Apart from my comments, one of the issues is the use of single or double backticks, which is currently inconsistent.
Furthermore, I was wondering if passing a pandas.DataFrame
to the events
parameter might be a good idea. I'd think that it would be easier to create and maintain than a list of dicts. I'm not saying that we should get rid of the list of dicts, but we could support dataframes as another option.
+1 to that. |
Co-authored-by: Clemens Brunner <[email protected]>
Fine by me if someone wants to add this in a future PR, we'd need to then add pandas as a dependency, which is okay. |
Thanks for the review @cbrnr I addressed all your comments except the one for "single" precision, where I am unsure what to do. |
Great! Forget about it, it's just that single-precision floats can represent 7 decimal places (at least), not 6. |
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.
Looked good to me, but I didn't thoroughly look thru everything. Just skimmed.
Thanks for the reviews |
closes #77
this is what's needed to make pybv a "writer" in the MNE-Python export module.
It will allow writing more detailed events to VMRK (everything 100% in line with the spec).
Specifically we will support:
One caveat is, that in principle the BrainVision format does not restrict the event type to "Stimulus", "Response", "Comment. --> in fact, one could have any type, see #24 (comment)
Yet in practice, we most often see:
Here I implement Stimulus and Response as previously for only Stimulus --> writing integer code "event descriptions".
Comment can then be used for free form strings ... I think this suffices for now and we can see whether users will need additional stuff in the future. Let's go step by step.