Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
23cef31
wip: load_analyzer_from_nwb function
alejoe91 Dec 16, 2025
6aaac55
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into …
alejoe91 Dec 23, 2025
fcba7d3
Make dtype/is_filtered optional attrs and suggestions from code review
alejoe91 Dec 23, 2025
e0a551a
Merge branch 'main' into load_analyzer_from_nwb
alejoe91 Dec 23, 2025
b72a39d
fix ibl tests
alejoe91 Dec 23, 2025
f65f2ce
Merge branch 'load_analyzer_from_nwb' of github.com:alejoe91/spikeint…
alejoe91 Dec 23, 2025
951df99
merge
h-mayorquin Jul 7, 2026
8146139
Merge branch 'main' into load_analyzer_nwb_heberto
h-mayorquin Jul 7, 2026
8e9e12d
fix file references
h-mayorquin Jul 7, 2026
97a6d23
fix main indices
h-mayorquin Jul 7, 2026
9de7773
Merge branch 'main' into load_analyzer_nwb_heberto
h-mayorquin Jul 8, 2026
20d3845
Fix performance
h-mayorquin Jul 8, 2026
5558f79
Merge branch 'improve_property_reading_performance' into load_analyze…
h-mayorquin Jul 8, 2026
8888b60
more performance fixes
h-mayorquin Jul 8, 2026
b15964b
spike vector
h-mayorquin Jul 8, 2026
a90b018
Spike vector alterantive construction on nwb sorting
h-mayorquin Jul 8, 2026
572b44d
Merge branch 'main' into load_analyzer_nwb_heberto
h-mayorquin Jul 8, 2026
beaad9d
Merge branch 'make_nwb_sorting_lazy' into load_analyzer_nwb_heberto
h-mayorquin Jul 8, 2026
66af315
nwb extractors
h-mayorquin Jul 8, 2026
c53e336
stream improvements
h-mayorquin Jul 8, 2026
469dc9b
fix channel indices
h-mayorquin Jul 8, 2026
47f9fc7
better std behavior
h-mayorquin Jul 9, 2026
d010d13
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 9, 2026
2c7ffa5
better naming
h-mayorquin Jul 9, 2026
aa01d29
Merge remote-tracking branch 'refs/remotes/origin/load_analyzer_nwb_h…
h-mayorquin Jul 9, 2026
bdbbe86
zach comments
h-mayorquin Jul 9, 2026
ee97e9c
mapping
h-mayorquin Jul 9, 2026
3a42237
tests
h-mayorquin Jul 9, 2026
5e67961
Merge branch 'main' into make_nwb_sorting_lazy
h-mayorquin Jul 9, 2026
8d02074
review
h-mayorquin Jul 9, 2026
0ed9153
add comments
h-mayorquin Jul 9, 2026
57c955d
Merge branch 'make_nwb_sorting_lazy' into load_analyzer_nwb_heberto
h-mayorquin Jul 9, 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
16 changes: 12 additions & 4 deletions src/spikeinterface/core/sortinganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,9 @@ def load(cls, folder, recording=None, load_extensions=True, format="auto", backe
return sorting_analyzer

@classmethod
def create_memory(cls, sorting, recording, sparsity, return_in_uV, peak_sign, peak_mode, rec_attributes):
def create_memory(
cls, sorting, recording, sparsity, return_in_uV, peak_sign, peak_mode, rec_attributes, copy_sorting=True
):
# used by create and save_as

if rec_attributes is None:
Expand All @@ -589,11 +591,17 @@ def create_memory(cls, sorting, recording, sparsity, return_in_uV, peak_sign, pe
# a copy is done to avoid shared dict between instances (which can block garbage collector)
rec_attributes = rec_attributes.copy()

# a copy of sorting is copied in memory for fast access
sorting_copy = NumpySorting.from_sorting(sorting, with_metadata=True, copy_spike_vector=True)
if copy_sorting:
# a copy of sorting is materialized in memory for fast access
analyzer_sorting = NumpySorting.from_sorting(sorting, with_metadata=True, copy_spike_vector=True)
else:
# keep the given (possibly lazy) sorting as-is: its spike times are read on demand rather
# than materialized up front. Useful for large streamed sortings where a view may need only
# a few units' trains (e.g. curation from stored templates + metrics).
analyzer_sorting = sorting

sorting_analyzer = SortingAnalyzer(
sorting=sorting_copy,
sorting=analyzer_sorting,
recording=recording,
rec_attributes=rec_attributes,
format="memory",
Expand Down
1 change: 1 addition & 0 deletions src/spikeinterface/extractors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from .neoextractors import get_neo_num_blocks, get_neo_streams
from .phykilosortextractors import read_kilosort_as_analyzer
from .nwbextractors import read_nwb_sorting_analyzer

from warnings import warn

Expand Down
Loading
Loading