brain_pipe.pipeline.wrapper.Wrapper¶
- class Wrapper(function_, key=None, *extra_args, copy_data_dict: bool = False, **extra_kwargs)¶
Bases:
PipelineStep
A preprocessing step that calls a function on the data_dict.
- __init__(function_, key=None, *extra_args, copy_data_dict: bool = False, **extra_kwargs)¶
Create a new LambdaPreprocessingStep instance.
Methods
__init__
(function_[, key, copy_data_dict])Create a new LambdaPreprocessingStep instance.
parse_dict_keys
(key[, name, ...])Parse a key or a sequence of keys.
- parse_dict_keys(key: str | Sequence[str] | Mapping[str, str], name='key', require_ordered_dict=False) OrderedDict[str, str] ¶
Parse a key or a sequence of keys.
- Parameters:
- Returns:
A mapping of input keys to output keys.
- Return type:
- Raises:
TypeError – If the key is not a string, a sequence of strings or a mapping of strings. If the key is a mapping but require_ordered_dict is True and the mapping is not an OrderedDict.