-
Notifications
You must be signed in to change notification settings - Fork 23
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
Parse TRIAL_VARs #990
Comments
looks like an excellent addition to pymovements, would you be interested in providing an initial PR? |
Autoparsing trial vars is a great idea! But wouldn't be adding these as trial columns overkill for the memory consumption? This would add a string like Instead, let's separate these two functionalities:
(2.) would be quite helpful outside of parsing and would give the user some flexibility without adding many additional arguments to the |
Thanks for your feedback! I agree that adding all trial variables by default would be too much. But I also think that adding another data structure and a method for adding trial variables after loading might just make it more confusing to use, because it's not obvious and people would have to look for it in the documentation. Maybe we could have an optional argument like Data files exported with SMI's BeGaze also have built-in messages for trial IDs (but no other trial variables?), so I personally think adding trial IDs by default would be nice. |
I think your proposal is a great compromise between usability and performance. Probably the reason why I'm continually drawn towards a |
@dkrako I just looked it up, and that does look like a nice and simple structure for arbitrary messages -- much easier to handle than the custom metadata patterns introduced in #767 (I kind of regret that PR now 😅 I think the behavior is too specific and unintuitive, and #907 would just make it more complex). Maybe not a good fit for the trial variables, since they apply to an entire block and not a single timestamp, but I think a simple way to store user-defined messages would indeed be useful. 🤔 |
Ah don't worry, we're always smarter in hindsight. We will take care of the metadata dict step by step. I think both approaches can be supported. Your idea with the A message datastructure and a way to add specific messages to columns would then be a complementing feature. |
Description of the problem
EDF files usually contain DataViewer-compatible messages with trial variables (https://www.sr-research.com/support/thread-83.html). Example from RaCCooNS:
TRIALID
andTRIAL_RESULT
denote the start and end of a trial, this can be parsed with thepatterns
argument infrom_asc()
without problems. But currently theTRIAL_VAR
messages cannot easily be parsed and associated with the corresponding trial, since they can occur at any point betweenTRIALID
andTRIAL_RESULT
. In RaCCooNS and MultiplEYE, they occur at the end of the trial (right beforeTRIAL_RESULT
).Since this is a standard way of encoding trial starts, ends, and variables, I think it would be nice if these would be parsed by default, and trial variables are added as
additional_columns
automatically.Description of a solution
By default (or optionally?), samples between
TRIALID
andTRIAL_RESULT
messages should get additional column values:TRIALID
messageTRIAL_RESULT
message!V TRIAL_VAR
messagesThe values defined by the
TRIAL_RESULT
and!V TRIAL_VAR
messages would have to be "retroactively" added to previous samples as the ASC file is being parsed -- this is probably the main challenge, but shouldn't be too difficult.Minimum acceptance criteria
The text was updated successfully, but these errors were encountered: