Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Add spikeinterface support and and gin test for CEDRecordingInterface #582

Merged
merged 11 commits into from
Jul 1, 2022

Conversation

h-mayorquin
Copy link
Collaborator

Add spikeinterface support to CEDRecordingInterface. Part of catalystneuro/neuroconv#60

As discussed with @bendichter today, this did not have an associated gin test with spikeextractors so I am only adding spikeinterface support as it is.

I also had a problem running the old format (.smr) tests in my own system but spikeinterface testing suite indicates that it should be supported. I am adding it here to see if it is a problem of local dependencies exclusive to me. If not, then probably we will have to support only the new format ("smrx") for a while until we figure this out.

@h-mayorquin h-mayorquin added enhancement New feature or request testing labels Jun 30, 2022
@h-mayorquin h-mayorquin self-assigned this Jun 30, 2022
CodyCBakerPhD
CodyCBakerPhD previously approved these changes Jun 30, 2022
@CodyCBakerPhD CodyCBakerPhD self-requested a review July 1, 2022 00:18
@h-mayorquin
Copy link
Collaborator Author

This has the same error than the one in my personal system. It seems that at least temporary we will only be able to support the new format.

@CodyCBakerPhD
Copy link
Member

This has the same error than the one in my personal system. It seems that at least temporary we will only be able to support the new format.

Yup, that's fine. We've had trouble with sonpy before (hence the platform/PyVersion tests targeted at that) so it's not too much of a surprise

@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #582 (5413d32) into main (0cfc0d1) will increase coverage by 0.04%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     catalystneuro/nwb-conversion-tools#582      +/-   ##
==========================================
+ Coverage   88.34%   88.39%   +0.04%     
==========================================
  Files          59       59              
  Lines        3192     3196       +4     
==========================================
+ Hits         2820     2825       +5     
+ Misses        372      371       -1     
Flag Coverage Δ
unittests 88.39% <87.50%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ols/datainterfaces/ecephys/ced/ceddatainterface.py 79.41% <87.50%> (+6.07%) ⬆️

@CodyCBakerPhD CodyCBakerPhD merged commit fb3c58b into main Jul 1, 2022
@CodyCBakerPhD CodyCBakerPhD deleted the add_spikeinterface_and_test_for_ced branch July 1, 2022 13:07
@@ -37,6 +39,9 @@ def get_all_channels_info(cls, file_path: FilePathType):
assert HAVE_SONPY, INSTALL_MESSAGE
return cls.RX.get_all_channels_info(file_path=file_path)

def __init__(self, file_path: FilePathType, smrx_channel_ids: list, verbose: bool = True):
def __init__(self, file_path: FilePathType, verbose: bool = True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-mayorquin why did you remove this optional arg? iirc this was needed in a prior conversion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like due to

As discussed with @bendichter today, this did not have an associated gin test with spikeextractors so I am only adding spikeinterface support as it is.

SpikeInterface does not support this argument: https://github.com/SpikeInterface/spikeinterface/blob/master/spikeinterface/extractors/neoextractors/ced.py#L26

The prior conversion should be pinned to the older version of NCT+SpikeExtractors that supports it, so it should be fine.

Though one should probably go back and check if the new SpikeInterface version can resolve whatever the problem was with loading those channels - as I recall, the original SpikeExtractors version had to know which channels to read prior to __init__, but maybe they found a better workaround now (that was always a bit annoying to have to call a class method prior to instantiation). I'll see if I can dig those files up and send them to @h-mayorquin

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old data share no longer exists (wasn't copied to the LBNL drive but instead was a link to their share, which has since been deleted) but I have a hard copy that I'm sending now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-mayorquin Confirmed that the previous .smrx files can be loaded in the new SpikeInterface without needing the extra argument (or class method)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please look into recreating this feature in the new pipeline?

Copy link
Collaborator Author

@h-mayorquin h-mayorquin Jul 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selecting only the channels that you want to load, is that what you mean? (a form of channel stubbing?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting the names of the channels as a class method and selecting only the channels you want to load as the init

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, check:

#583

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants