-
Notifications
You must be signed in to change notification settings - Fork 45
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
Auto-detect the trigger channel based on retrieved channel names #306
Conversation
Hello, @eurunuela, @tsalo, @smoia. I have implemented the auto option for the |
I'll leave the discussion of the proper index for the trigger channel (i.e., 0 or 1) and where that switch happens to others, but I had some minor code edits/comments. Thanks for this! |
Co-authored-by: Taylor Salo <[email protected]>
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 can't wait to see this implemented and working!
However, I have few comments and changes to ask (see comments).
There's another thing: I like the fact that this functionality is implemented in the object methods, but I don't know if it's actually good to have it there, and in any case I wouldn't put it in the initialisation of the object.
The reason for which I'm not sure it's good to have it in the object is that I think we're using the trigger channel to extract the time array when we deal with acq files (in the respective interface script), and that's a step that takes place before the initialisation of the object.
Maybe a better place would be the (refactored) interfaces script/folder, with this step taking place before the input processing. It's not vital though, we can just specify the change in the initialisation of acq files.
If we want to leave it as an object method (and I see why), I would make it a separate method and call it in case chtrig is zero, even after the initialisation of the object. It just means updating its properties.
Hi @vinferrer , thanks a lot for this! I agree with the comments from @tsalo and @smoia . My other concern would be the linting not passing the test. I think once the comments are added we can merge it. Thanks again! |
Co-authored-by: Stefano Moia <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
==========================================
+ Coverage 94.63% 94.77% +0.14%
==========================================
Files 8 8
Lines 839 862 +23
==========================================
+ Hits 794 817 +23
Misses 45 45
|
Okay i have
I see what you mean about acq files. Is it critical that you use the chtrig channel to obtain the frequency and the time index? |
So guys I have implemented the partial match thingy as you can see, if you don't want me to have this in physio_obj.py we could put it as a utils function that is used in each of the interfaces.py script but i think that would make more duplicities. Is there a way we can avoid using |
I agree that not using |
You're right. It would require a couple of changes to the CLI, although we have a good template for that kind of argument in If it seems like too much work, or otherwise just not a good idea, what about |
Okay, actually I do have a very strong opinion about using |
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.
LGTM!
I checked again the regex comparison, and came up with the alternative solution (see this comment) that doesn't have the issue of matching wrong channel names due to empty strings in the channel name split. |
Co-authored-by: Stefano Moia <[email protected]>
Co-authored-by: Stefano Moia <[email protected]>
Co-authored-by: Stefano Moia <[email protected]>
…into auto_chtrig
Propose less elegant but more specific comparison
Well I think we are ready to merge this @smoia |
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.
LGTM, but I'm biased!
@tsalo @eurunuela do you want to give a second look? If so, the last one can merge this in!
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.
LGTM
🚀 PR was released in |
Closes #257
auto-detect the trigger channel comparing
ch_name
list to a of possible trigger namesProposed Changes