Open yarikoptic opened 3 years ago
@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 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)
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 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 thatwrite_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.
an immediate use case is to support tests from spikeextractors: https://github.com/SpikeInterface/spikeextractors/blob/master/tests/test_gin_repo.py
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 thesimple1.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.