feat(extension_types): support SpikeInterface BaseSorting objects (ITL-468)#205
Merged
eywalker merged 11 commits intoJul 2, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… ITL-468 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds SISortingHandler class between SIRecordingHandler and register_spikeinterface_types, mirroring the recording handler pattern. Hashes BaseSorting via SHA-256 of its JSON dump; raises ValueError for in-memory sortings. Includes three new tests covering hash stability, content sensitivity, and in-memory rejection.
…mpy_recording (ITL-468) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tests (ITL-468) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eSorting (ITL-468) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n v0.1.json (ITL-468)
…odule docstring (ITL-468)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
eywalker
approved these changes
Jul 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class orcapod support for SpikeInterface BaseSorting objects by introducing a new logical type + hashing handler, wiring them into the default context (optionally, when spikeinterface is installed), and extending the SpikeInterface extension test suite to cover round-trips and hash behavior.
Changes:
- Implemented
LogicalSISorting(Arrowlarge_stringJSON envelope viato_dict()/load()), andSISortingHandler(SHA-256 over the same JSON bytes). - Extended
register_spikeinterface_types()and default context config (v0.1.json) to register sorting support alongside recording support (optional, idempotent). - Added comprehensive tests for sorting serialization, round-trip, handler hashing, and context integration; added accompanying design spec + implementation plan docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/orcapod/extension_types/spikeinterface_types.py |
Adds LogicalSISorting + SISortingHandler; extends SI registration to include sortings. |
src/orcapod/extension_types/__init__.py |
Exports LogicalSISorting conditionally when SpikeInterface is available. |
src/orcapod/contexts/data/v0.1.json |
Auto-registers sorting logical type + handler via _optional: true; adds changelog entry. |
tests/test_extension_types/test_spikeinterface_types.py |
Adds sorting-focused test coverage (importability, errors, round-trips, hashing, registration integration). |
superpowers/specs/2026-07-02-si-sorting-logical-type-design.md |
Design spec documenting goals, architecture, error behavior, and tests for SI sorting support. |
superpowers/plans/2026-07-02-si-sorting-logical-type.md |
Step-by-step implementation plan for adding SI sorting support (tasks, commands, expected outcomes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LogicalSISortinglogical type mappingspikeinterface.core.BaseSorting↔ Arrowlarge_stringvia SpikeInterface'sto_dict()JSON dump, mirroring the existingLogicalSIRecordingpatternSISortingHandlerfor SHA-256 content hashing of sortings (phase 1)register_spikeinterface_types()to also wire inLogicalSISortingandSISortingHandler(idempotent, same pattern as recording registration)LogicalSISortingfromextension_types/__init__.pyv0.1.jsonwith_optional: true— activates automatically whenspikeinterfaceis installedValueErrorfor in-memoryNumpySortingin both serialization and hashing paths, with save instructionsTests
test_logical_si_sorting_importable— extension name, python_type, Arrow storage typetest_in_memory_sorting_raises— NumpySorting raises ValueError with "not JSON-serializable" and "file-backed"test_folder_sorting_round_trip— numpy_folder-backed round-trip viaget_unit_spike_traintest_zarr_sorting_round_trip— zarr-backed round-triptest_si_sorting_handler_hash_stability— same sorting → same ContentHashtest_si_sorting_handler_hash_changes_with_content— different sortings → different hashestest_si_sorting_handler_in_memory_raises— ValueError for in-memory sortingtest_register_spikeinterface_types_includes_sorting— full context integration: type lookup, handler lookup, round-tripFull test suite: 4028 passed, 56 skipped, 6 xfailed — zero failures
Closes ITL-468
🤖 Generated with Claude Code