Skip to content
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 spikeextractors: "data generators"? #13

Open
3 tasks
yarikoptic opened this issue Apr 1, 2021 · 4 comments
Open
3 tasks

add spikeextractors: "data generators"? #13

yarikoptic opened this issue Apr 1, 2021 · 4 comments

Comments

@yarikoptic
Copy link
Member

an immediate use case is to support tests from spikeextractors: https://github.com/SpikeInterface/spikeextractors/blob/master/tests/test_gin_repo.py

  • as a first step we could just copy those "parametrizations" over here
    • for the longer run I think we should submit a PR which would place those parametrizations into consts/variables within their module so we could just import and use from so we could just update a version of spikeextractors environment and create expanded collection of test cases
  • our helper here then should produce multiple test files (not just one like core/simple1.py does) and tests should be ran against them all

In the original (before #11) state of things I was thinking that create could be converted to a generator which would yield (testsuite: str, test_case: str, nwbfile: NWBFile) tuples. So the simple1.py:create could have yielded a singular ("core", "simple1", nwbfile). Then in case of spikeextractors it could have yielded records like
("spikeextractors", "recording/BlackrockRecordingExtractor/blackrock/blackrock_2_1", nwbfile), ... ("spikeextractors", "sorting/BlackrockSortingExtractor/blackrock/blackrock_2_1", nwbfile), .... Do you see a nice way to have it implemented?

The idea of duplicating the leading testsuite record to be able in the future to extend to having a singular generator for extensions, where then leading record would include extension name then.

@jwodder
Copy link
Member

jwodder commented Apr 1, 2021

@yarikoptic I'm not clear on how to adapt the spikeextractor code to produce NWBFile instances instead of writing the data directly to files. There's also the issue of how to pass the ephy_testing_data to the create() methods, including how the caller should know whether to do that in the first place (I'm imagining re-implementing pytest's fixtures).

@yarikoptic
Copy link
Member Author

@yarikoptic I'm not clear on how to adapt the spikeextractor code to produce NWBFile instances instead of writing the data directly to files.

hm... looking at the code I think you can create an instance of NWBFile and pass it as nwbfile argument and it will be changed in place by that write_recording and then you return that file (I guess their interface could be improved to separate those two modes of operation)

@yarikoptic
Copy link
Member Author

There's also the issue of how to pass the ephy_testing_data to the create() methods, including how the caller should know whether to do that in the first place (I'm imagining re-implementing pytest's fixtures).

test class itself should have those copy pasted for now etc... I will submit a quick PR which would mimic what I had in mind in original description

@yarikoptic
Copy link
Member Author

@yarikoptic I'm not clear on how to adapt the spikeextractor code to produce NWBFile instances instead of writing the data directly to files.

hm... looking at the code I think you can create an instance of NWBFile and pass it as nwbfile argument and it will be changed in place by that write_recording and then you return that file (I guess their interface could be improved to separate those two modes of operation)

argh -- NwbSortingExtractor doesn't have write_recording and the only way is through the file. So I will implement a workaround -- saving into temp file and reloading to return NWBFile instance for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants