Skip to content

feat(itl-473): split spikeinterface into orcapod-extension-spikeinterface#220

Merged
eywalker merged 14 commits into
mainfrom
eywalker/itl-473-split-spikeinterface-extension-into-separate-orcapod
Jul 9, 2026
Merged

feat(itl-473): split spikeinterface into orcapod-extension-spikeinterface#220
eywalker merged 14 commits into
mainfrom
eywalker/itl-473-split-spikeinterface-extension-into-separate-orcapod

Conversation

@kurodo3

@kurodo3 kurodo3 Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds OrcapodExtension protocol and op.register_extension() for normalized extension registration (ITL-473)
  • Removes all SpikeInterface wiring from core orcapod: spikeinterface_types.py, v0.1.json entries, extension_types/__init__.py re-export, optional deps, and license check exclusion
  • Regenerates uv.lock without spikeinterface transitive deps
  • SI code moves to new nauticalab/orcapod-extension-spikeinterface package

Test plan

  • Core test suite passes without spikeinterface installed (uv run pytest -m "not postgres")
  • import orcapod as op; op.register_extension is accessible
  • from orcapod.contexts import get_default_context; get_default_context() works (no SI import errors)
  • License check passes without --ignore-packages quantities

Closes ITL-473

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/extensions.py 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR decouples SpikeInterface support from core orcapod by removing SI-specific wiring/dependencies and introducing a small, normalized extension registration surface (OrcapodExtension + register_extension) so SI support can live in a separate package.

Changes:

  • Added orcapod.extensions with OrcapodExtension (runtime-checkable protocol) and register_extension(); re-exported via orcapod.__init__.
  • Removed SpikeInterface integration from core (v0.1.json optional entries, extension_types re-export block, SI module + tests) and removed SI deps/extras + regenerated uv.lock.
  • Added design/plan documentation describing the split into orcapod-extension-spikeinterface.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/orcapod/extensions.py New normalized extension registration API.
src/orcapod/__init__.py Re-exports OrcapodExtension and register_extension on the public API.
src/orcapod/extension_types/__init__.py Removes conditional SpikeInterface re-export block.
src/orcapod/contexts/data/v0.1.json Removes SpikeInterface _optional logical type + handler registrations from the default context spec.
src/orcapod/extension_types/spikeinterface_types.py Deleted (SpikeInterface implementation removed from core).
tests/test_extensions.py New tests covering register_extension() behavior.
tests/test_utils/test_object_spec.py Removes tests tied to SI auto-registration in the default context.
tests/test_extension_types/test_spikeinterface_types.py Deleted (SI tests moved out of core).
pyproject.toml Removes spikeinterface extra and drops it from all + dev dependency group.
.github/workflows/_license-check.yml Removes --ignore-packages quantities from license check.
uv.lock Lockfile regenerated to remove SI and its transitive deps.
superpowers/specs/2026-07-09-itl-473-orcapod-extension-spikeinterface-split-design.md New design spec documenting the split and extension API.
superpowers/specs/2026-07-01-spikeinterface-baserecording-design.md Deleted (moved to the new extension package per design).
superpowers/specs/2026-07-02-si-sorting-logical-type-design.md Deleted (moved to the new extension package per design).
superpowers/specs/2026-07-02-spikeinterface-motion-design.md Deleted (moved to the new extension package per design).
superpowers/specs/2026-07-03-sorting-analyzer-logical-type-design.md Deleted (moved to the new extension package per design).
superpowers/plans/2026-07-09-itl-473-orcapod-extension-spikeinterface.md New implementation plan document for the split.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/orcapod/extensions.py
Comment on lines +75 to +79
from orcapod.contexts import get_default_context

if context is None:
context = get_default_context()
extension.register(context)
Comment on lines 46 to 50
"_class": "orcapod.extension_types.numpy_type.LogicalNumpyArray",
"_config": {}
},
{
"_class": "orcapod.extension_types.spikeinterface_types.LogicalSIRecording",
"_config": {},
"_optional": true
},
{
"_class": "orcapod.extension_types.spikeinterface_types.LogicalSISorting",
"_config": {},
"_optional": true
},
{
"_class": "orcapod.extension_types.spikeinterface_types.LogicalSIMotion",
"_config": {},
"_optional": true
},
{
"_class": "orcapod.extension_types.spikeinterface_types.LogicalSISortingAnalyzer",
"_config": {},
"_optional": true
},
{
"_class": "orcapod.extension_types.pandas_type.LogicalPandasDataFrame",
@kurodo3

kurodo3 Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Review response — Copilot comments

Both comments addressed in commit ca8a157.


Comment 1: v0.1.json changelog inconsistency

Fixed. A new changelog entry was appended to metadata.changelog:

"Moved SpikeInterface types (LogicalSIRecording, LogicalSISorting, LogicalSIMotion,
LogicalSISortingAnalyzer) and their handlers to the standalone
orcapod-extension-spikeinterface package; removed all SI _optional entries from this
spec and SI deps from pyproject.toml; introduced OrcapodExtension protocol and
op.register_extension() for normalized extension registration (ITL-473)"

The historical entries (documenting what was added at each point) are preserved — they are an accurate record of the past. The new entry documents the removal so any reader can see the current state without confusion.


Comment 2: register_extension() — no explicit protocol check

Fixed. Added an isinstance(extension, OrcapodExtension) guard at the top of register_extension(), before any context resolution:

if not isinstance(extension, OrcapodExtension):
    raise TypeError(
        f"extension must implement OrcapodExtension "
        f"(requires 'name: str' and 'register(context) -> None'); "
        f"got {type(extension)!r}"
    )

A new test test_register_extension_raises_type_error_for_non_extension was added to tests/test_extensions.py to cover this path. All 6 extension tests pass.

@eywalker eywalker merged commit 3c2329d into main Jul 9, 2026
11 checks passed
@eywalker eywalker deleted the eywalker/itl-473-split-spikeinterface-extension-into-separate-orcapod branch July 9, 2026 03:51
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.

2 participants