Skip to content

Create SortingAnalyzer object directly during create_sorting_analyzer#4705

Open
ecobost wants to merge 4 commits into
SpikeInterface:mainfrom
ecobost:create_sa_directly
Open

Create SortingAnalyzer object directly during create_sorting_analyzer#4705
ecobost wants to merge 4 commits into
SpikeInterface:mainfrom
ecobost:create_sa_directly

Conversation

@ecobost

@ecobost ecobost commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Three changes (separated in 3 commits):

  • Drop support for analyzers without settings.json file. Comment says support will be dropped in "0.102.0/0.103.0" so seems due.
  • Check all required input files are present before trying to load a sorting analyzer.
  • Create a SortingAnalyzer object directly as the last step of create_binary_folder/create_zarr rather than re-reloading it

Last one might be the more contentious change. I imagine the reloading during the creation was there to make sure everything could be reloaded fine but everything in the folder is already in memory during create_*() so there isn't really a need to save and reload them into memory, it seems more logical to create the SortingAnalyzer right away.

Closes #4410.

@ecobost

ecobost commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Another change I would propose is to drop saving sorting_provenance.json during SortingAnalyzer.create_binary_folder. create_binary_folder already saves the entire sorting object (including a provenance.json) in sorting/ so no need to save the provenance again with a diff name.
For SortingAnalyzer.create_zarr the provenance still needs to be saved because currently the sorting.zarr objects do not save provenance, we could
a) leave create_zarr untouched (saving sorting as a group and sorting_provenance as a diff group); or
b) save the sorting_provenance as "provenance" subgroup inside the "sorting" group to mimic the structure of the binary_folder analyzer; (and additionally consider modifying BaseSorting.create_zarr so it also saves provenance though that's a diff discussion)

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

Successfully merging this pull request may close these issues.

Sorting analyzer removes _recording from sorting object

1 participant