Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4c4c98
BaseChunkExecutor
alejoe91 Nov 14, 2025
bef0fce
Create BaseChunkExecutor class
alejoe91 Nov 14, 2025
c82eb32
Even better: just ChunkExecutor
alejoe91 Nov 14, 2025
7d1d64e
some more renaming
alejoe91 Nov 14, 2025
56baa5d
get_sample_size_in_bytes
alejoe91 Nov 21, 2025
3da238b
get_sample_size -> get_sample_size_in_bytes
alejoe91 Nov 26, 2025
31c7130
Merge branch 'main' into base-chunk-executor
alejoe91 Nov 27, 2025
adc0683
Make ChunkableMixin to generalize paralleization machinery
alejoe91 Nov 28, 2025
d92f22c
Add chunkable mixin and tools
alejoe91 Nov 28, 2025
13e1d38
Move more methods to chunkable_tools
alejoe91 Nov 28, 2025
42cace4
Make ChunkableMixin a proper abstract class
alejoe91 Nov 28, 2025
df347ee
fix kilosort4 write_binary call
alejoe91 Nov 28, 2025
4691004
Fix _preferred_mp_context resolution and deepinterpolation tests
alejoe91 Dec 2, 2025
6695d65
Fix conflicts
alejoe91 Dec 11, 2025
6d72750
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into …
alejoe91 Dec 11, 2025
998ba7c
Fix segments in operators
alejoe91 Dec 11, 2025
122d7c2
Fix add_segment
alejoe91 Dec 12, 2025
ec8e07a
Add __future__ annotations
alejoe91 Dec 12, 2025
7515bf5
Move chunkable to its own file and move time operations to chunkable …
alejoe91 Jan 19, 2026
d4ebe86
Solve conflicts
alejoe91 Jan 19, 2026
3ad3ef3
dolve conflicts 2
alejoe91 Jan 19, 2026
393ffe5
Move get_durations to chunkable mixin
alejoe91 Jan 19, 2026
04f44e8
Move get_memory_size to chunkable
alejoe91 Jan 19, 2026
8da015a
fix tests
alejoe91 Jan 20, 2026
9f270d1
Fix tests
alejoe91 Jan 20, 2026
b77a6e0
fix conflicts
alejoe91 Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Low-level
.. automodule:: spikeinterface.core
:noindex:

.. autoclass:: ChunkRecordingExecutor
.. autoclass:: ChunkExecutor


Back-compatibility with ``WaveformExtractor`` (version > 0.100.0)
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/comparison/multicomparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __init__(

for segment_index in range(multisortingcomparison._num_segments):
sorting_segment = AgreementSortingSegment(multisortingcomparison._spiketrains[segment_index])
self.add_sorting_segment(sorting_segment)
self.add_segment(sorting_segment)

self._kwargs = dict(
sampling_frequency=sampling_frequency,
Expand Down
4 changes: 2 additions & 2 deletions src/spikeinterface/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@
get_best_job_kwargs,
ensure_n_jobs,
ensure_chunk_size,
ChunkRecordingExecutor,
ChunkExecutor,
split_job_kwargs,
fix_job_kwargs,
)
from .chunkable_tools import write_binary, write_memory
from .recording_tools import (
write_binary_recording,
write_to_h5_dataset_format,
get_random_data_chunks,
get_channel_distances,
Expand Down
2 changes: 2 additions & 0 deletions src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* ComputeNoiseLevels which is very convenient to have
"""

from __future__ import annotations

import warnings
import numpy as np
from collections import namedtuple
Expand Down
27 changes: 16 additions & 11 deletions src/spikeinterface/core/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from pathlib import Path
import shutil
from typing import Any, Iterable, List, Optional, Sequence, Union
Expand Down Expand Up @@ -85,6 +86,9 @@ def __init__(self, main_ids: Sequence) -> None:
self._main_ids.dtype.kind in "uiSU"
), f"Main IDs can only be integers (signed/unsigned) or strings, not {self._main_ids.dtype}"

# segments
self._segments: List[BaseSegment] = []

# dict at object level
self._annotations = {}

Expand Down Expand Up @@ -140,9 +144,16 @@ def name(self, value):
# we remove the annotation if it exists
_ = self._annotations.pop("name", None)

@property
def segments(self) -> list:
return self._segments

def add_segment(self, segment: BaseSegment) -> None:
self._segments.append(segment)
segment.set_parent_extractor(self)

def get_num_segments(self) -> int:
# This is implemented in BaseRecording or BaseSorting
raise NotImplementedError
return len(self._segments)

def get_parent(self) -> Optional[BaseExtractor]:
"""Returns parent object if it exists, otherwise None"""
Expand Down Expand Up @@ -234,13 +245,6 @@ def set_annotation(self, annotation_key: str, value: Any, overwrite=False) -> No
else:
raise ValueError(f"{annotation_key} is already an annotation key. Use 'overwrite=True' to overwrite it")

def get_preferred_mp_context(self):
"""
Get the preferred context for multiprocessing.
If None, the context is set by the multiprocessing package.
"""
return self._preferred_mp_context

def get_annotation(self, key: str, copy: bool = True) -> Any:
"""
Get a annotation.
Expand Down Expand Up @@ -429,8 +433,9 @@ def copy_metadata(

other.extra_requirements.extend(self.extra_requirements)

if self._preferred_mp_context is not None:
other._preferred_mp_context = self._preferred_mp_context
# call all extra copy metadata if it exists (e.g., with chunkable mixin)
if hasattr(self, "_extra_copy_metadata"):
self._extra_copy_metadata(other, only_main=only_main, ids=ids, skip_properties=skip_properties)

def to_dict(
self,
Expand Down
Loading