Extend preprocessing pipeline by defining a BasePipeline - #4755
Conversation
…extend-preprocessing-pipeline
| 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 |
There was a problem hiding this comment.
@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"): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
Accepted all suggestions. Should we update the How to in this PR? |
| # name: python3 | ||
| # --- | ||
|
|
||
| # # Build a full Sorting pipeline with dicts |
There was a problem hiding this comment.
We somehow had added two copies of the how to page...
BasePipelineto allow inherited classes to define their own dictionary of steps to check against