Skip to content

Extend preprocessing pipeline by defining a BasePipeline - #4755

Merged
alejoe91 merged 13 commits into
SpikeInterface:mainfrom
alejoe91:extend-preprocessing-pipeline
Sep 15, 2026
Merged

alejoe91 merged 13 commits into
SpikeInterface:mainfrom
alejoe91:extend-preprocessing-pipeline

Conversation

@alejoe91

@alejoe91 alejoe91 commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • create a BasePipeline to allow inherited classes to define their own dictionary of steps to check against
  • switched dict to lists, to allow for duplicated steps

@alejoe91 alejoe91 added the preprocessing Related to preprocessing module label Sep 3, 2026
source_class_or_dict_of_sources_classes.__doc__ = source_class.__doc__
source_class_or_dict_of_sources_classes.__name__ = name
# propagate the _precomputable_kwarg_names attribute from the source class to the wrapper function
source_class_or_dict_of_sources_classes._precomputable_kwarg_names = source_class._precomputable_kwarg_names

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@chrishalcrow doing this allows us to get rid of the pp_names_to_classes

precomputable_kwarg_names = preprocessor_class._precomputable_kwarg_names
dont_apply_kwargs += precomputable_kwarg_names
preprocessor_function = self.function_names_to_functions[preprocessor_name]
if hasattr(preprocessor_function, "_precomputable_kwarg_names"):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here we added _precomputed_kwarg_names to the function, but we still protect against not having the attrs

See https://github.com/SpikeInterface/spikeinterface/pull/4755/changes#r3932091422

@alejoe91
alejoe91 marked this pull request as ready for review September 4, 2026 08:04
@alejoe91 alejoe91 added this to the 0.105.0 milestone Sep 4, 2026
Comment thread src/spikeinterface/preprocessing/tests/test_pipeline.py Outdated
Comment thread src/spikeinterface/preprocessing/pipeline.py Outdated
Comment thread src/spikeinterface/preprocessing/pipeline.py Outdated
Comment thread src/spikeinterface/preprocessing/pipeline.py Outdated

@chrishalcrow chrishalcrow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we're going to deprecate the passing of dicts, we need to update this: https://spikeinterface.readthedocs.io/en/stable/how_to/build_pipeline_with_dicts.html

Otherwise, looks good!

Co-authored-by: Chris Halcrow <57948917+chrishalcrow@users.noreply.github.com>
@alejoe91

Copy link
Copy Markdown
Member Author

If we're going to deprecate the passing of dicts, we need to update this: https://spikeinterface.readthedocs.io/en/stable/how_to/build_pipeline_with_dicts.html

Otherwise, looks good!

Accepted all suggestions. Should we update the How to in this PR?

# name: python3
# ---

# # Build a full Sorting pipeline with dicts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We somehow had added two copies of the how to page...

@alejoe91
alejoe91 merged commit f6a7305 into SpikeInterface:main Sep 15, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preprocessing Related to preprocessing module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants