-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Allow automated compilation of metadata #8834
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
Conversation
ff955a8 to
3d52637
Compare
3d52637 to
44e5c08
Compare
|
WIP: Handling repeated events within the same time period |
agramfort
left a comment
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.
@hoechenberger can you make / update an example that gets rendered in the doc so people can get a quick way to get started?
I am personally super excited about this. It makes certain things suddenly so much easier to do !
|
I will add it to a tutorial @agramfort |
Agree, this looks like a very useful addition |
larsoner
left a comment
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.
Looks like a useful addition to me. Probably worth adding to an example or two to see how it's useful. Maybe an epochs tutorial and/or metadata tutorial, then also maybe the reaction times example if it actually helps there?
agramfort
left a comment
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.
besides some documentation I think it's good to go. I've already seen a successful use of this code for data with reaction times.
dd6fabb to
5384b34
Compare
538fa99 to
2573630
Compare
|
@larsoner @drammock @agramfort I suggest you start with the tutorial I created to get an idea of how the various parameters work: The tutorial can probably be made more concise and its language can certainly be improved. Any suggestions welcome! |
drammock
left a comment
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've reviewed only the docstring so far.
|
Thank you for your review, @drammock! I will try to address your comments very soon. |
d128586 to
d406f0f
Compare
Co-authored-by: Clemens Brunner <clemens.brunner@gmail.com>
b7fbf66 to
9985e86
Compare
Co-authored-by: Daniel McCloy <dan@mccloy.info>
|
Sorry I have to bug you all again, but when implementing the discussed changes and playing through the tutorial several times, I now feel the urge to add a slight modification. In the beginning, we had two columns per stimulus:
We then decided to drop the boolean columns due to their redundancy, as absence can be indicated by But we also opted to rename to drop the epochs['response < 1.5 & first_response == "left"']And I think this is semantically less … pleasant than: epochs['response_time < 1.5 & first_response == "left"']So here is my simple question: Can we have the Looking forward to hearing your thoughts! 😇🦄🥸 |
it doesn't bother me as much as it seems to bother you. For me, downsides that outweigh it are:
If users really want a suffix there is pandas.DataFrame.add_suffix. If we really can't reach agreement I would settle for a |
|
I have no opinion :)
… |
|
I agree with @drammock. It's pretty clear without |
|
let's remove the _time then and l merge during the day :)
… |
|
Whoops, day is almost over, sorry ;) I'll finish it up within the next hours. Thanks for your feedback! |
… into epochs-metadata
|
thx @hoechenberger |
|
Many thanks for this! I think it will be really useful for a lot of people and I appreciate your patience with all the API back-and-forth. |
This PR adds
mne.epochs.make_metadata(), which allows for the automated construction of metadata for use in Epochs.The users passes an events array, an event name -> event ID mapping, a time period and a sampling frequency. The function will then
It will then return the constructed metadata and a matching subset of the events array. These values can then be readily used to construct Epochs of arbitrary durations, while ensuring all of them will be assigned the desired metadata (which may or may not contain events from a different time range around the time-locked event)
Example:
Conditionally selecting a subset of Epochs is easy thanks to Pandas query strings:
This sort-of addresses #8360 as well.
I'd like to hear your opinions on this.
I've specifically tried to create a function that produces very generic data to ensure maximum versatility. I believe this set of metadata can also serve as a skeleton / starting point for users, as they're free to manipulate the data further before adding it to their Epochs.
cc @SophieHerbst