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.
A proposal to add a
PreprocessingPipeline
class, which contains ordered preprocessing steps and their kwargs in a dictionary.You can apply the class to a
recording
, or use the helper functioncreate_preprocessed
to make a preprocessed recording:Also adds a function which takes in a
recording.json
provenance file and make apreprocessor_dict
:This allow for some cool things:
run_sorter_jobs
, and postprocessing incompute
.recording.json
file without the original recording (and worrying about paths).Note that 3. only works for preprocessing steps that are in some sense “global” i.e. can be applied to any recording. This doesn’t apply for all preprocessing steps e.g.
interpolate_bad_channels
needs thebad_unit_ids
which are recording dependent. However, many of these functions can be modified to be applied more globally e.g. ifbad_unit_ids
isNone
,interpolate_bad_channels
could detect bad channels, then interpolate these. This would be apply-able to any recording, so is “global”.No rush on this and I’m not 100% set on it being implemented. Important to get the names right. I read this: https://melevir.medium.com/python-functions-naming-tips-376f12549f9. I think it’s important that
create_preprocessed
doesn’t sound in-place, after the number of problems withset_probe
. Hence I’m against something likeapply_preprocessing(recording)
, and would rather havemake
,create
,construct
,produce
or something in the function name. I also like the idea (from the article) that you don’t need to include e.g.recording
in the name ifrecording
is a required argument. Hence I like something likemy_pipeline.apply_to(recording)
rather than something likemy_pipeline.apply_pipeline_to_recording(recording)
.To do:
get_preprocessing_dict_from_json