-
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
add set_probe method to BaseRecordingExtractorInterface #639
Conversation
src/neuroconv/datainterfaces/ecephys/baserecordingextractorinterface.py
Outdated
Show resolved
Hide resolved
Just need some unit tests for this; would you be willing to add a general tutorial in the user guide section as well in this PR or would you prefer that in a follow-up? Basically, what a user would need is a clear way to 'how' to get that probe object. I know SI/PI has a couple of ways (including some predefined that can be loaded? But they can also be set entirely in-memory, as well as that CSV approach you used) |
Yeah I think we can include the tutorial in this PR. Will probably need help from @alejoe91 I know Alessio also wanted to add a set_probe_group |
Co-authored-by: Cody Baker <[email protected]>
Is there a way to get the test data on my local machine so I can run the tests that require access to that data? |
Yep, just give our Developer Guide a perusal I would say though, that some cleaner unit tests might use the mock class (which uses randomly generated data via SI) https://github.com/catalystneuro/neuroconv/blob/main/src/neuroconv/tools/testing/mock_interfaces.py#L121 and belong in approximately this location of the testing suite: https://github.com/catalystneuro/neuroconv/blob/main/tests/test_ecephys/test_ecephys_interfaces.py The tutorial could (probably should) use some of the real testing data however; but the only testing dataset I actually know the probe of would be https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/src/master/neuroscope/dataset_1 which became dandiset 000003 and has probe models defined in the paper |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@CodyCBakerPhD I added a call to This is only for the Intan interface, because when I did this for all interfaces, then I get into trouble with other tests that expect that the number of groups is 1. And then I make sure the nwb recording matches with the properties rel_x, rel_y, rel_z, and group: |
src/neuroconv/datainterfaces/ecephys/baserecordingextractorinterface.py
Outdated
Show resolved
Hide resolved
…erface.py Co-authored-by: Ben Dichter <[email protected]>
for more information, see https://pre-commit.ci
src/neuroconv/datainterfaces/ecephys/baserecordingextractorinterface.py
Outdated
Show resolved
Hide resolved
@magland Thanks for working on this! The core function is nice and simple, but we should really make sure it can be used without error on as many formats as possible notwithstanding highly specific issues to be propagated up to SI/neo |
for more information, see https://pre-commit.ci
self.recording_extractor.set_probe( | ||
probe, | ||
in_place=True, | ||
group_mode=group_mode, |
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.
just one note: if the probe has less channels than the recording (e.g., you want to only select the A
channels from an Intan recording), the set_probe(..., in_place=True)
will fail.
We can't do anything about it, just something to keep in mind :)
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.
@alejoe91 What would this represent in a real world case?
Would it be indicative of a bad probe definition by the user?
Or are there cases where the user might actually specify a probe correctly, but extra channels show up (possibly from auxiliary sources or a mistake in SI/neo)?
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.
yes I think the second option is what I had in mind. You have a recording with Ephys + Aux channels and you might want to select ephys channels with the probe slicing
Thanks @CodyCBakerPhD I think I've addressed all of your comments, except possibly the location of the |
Thanks, looking a lot better!
That place is fine, we can move later if we want
Great! One last comment about where the probe injection occurs in the Mixin class |
@CodyCBakerPhD I have moved the set_probe() test code to the RecordingExtractorInterfaceTestMixin class, and I have used the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #639 +/- ##
==========================================
+ Coverage 91.65% 91.72% +0.07%
==========================================
Files 107 108 +1
Lines 5653 5703 +50
==========================================
+ Hits 5181 5231 +50
Misses 472 472
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Looks great to me! Thanks for all the hard work on this |
@alejoe91 @CodyCBakerPhD as we were discussing in #634