-
Notifications
You must be signed in to change notification settings - Fork 248
Conversation
This PR makes a ChunkExecutor which is agnostic to the recording and applies to any chunkable BaseExtractor (which defines get_sample_size(), get_num_samples(), get_num_segments()
This is because we are working on a new "spikeinterface" for calcium imaging, and this refactor makes it suuuuper straightforward to use the same parallelization machinery for Imaging objects (which inherit from the BaseExtractor)
Update 29/11/25
Following up on trying to make SI tools as general as possible for its calcium imaging "clone" (photon-mosaic) I made some more dramatic refactoring:
- implemented a
ChunkableMixinabstract mixin that implements all method needed by theChunkExecutor- several
BaseRecordingspecific methods (e.g.,write_binary/write_memoryand more) are now in thechunkable_toolsand applicable to anyChunkableMixinobject - the
ChunkableMixinhas a generalget_datafunction, so it can be used by many derived classes (e.g.,get_tracesfor recordings,get_videos/seriesfor imaging) - another useful function to centralize things is the
get_shape(segment_index), which returns the buffer shape by segment
- several
- refactored "segments": I that we didn't have any proper structure for segments: recording objects had
_recording_segmentsand sorting objects_sorting_segments. Each class then implemented its ownadd_*function. Since segments are aBaseExtractorconcept, I centralized the definition (self.segments: List[BaseSegment] = []), added aself.segmentsproperty, and a centralizedadd_segmentfunction.
@samuelgarcia @chrishalcrow @yger @h-mayorquin @JoeZiminski @zm711
Let me know what you think!!!
|
|
||
|
|
||
| def get_random_recording_slices( | ||
| def get_random_slices( |
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.
This is too neutral no ? Lets find some thing like
get_random_slices_along_time
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.
get_random_time_slices?
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.
now renamed get_random_sample_slices
|
Lets discuss this in detail. This is lots some semantic changes. |
What about a
|