Pipeline Module
Pipeline
Class to sequentially process an arbitrary number of functions.
Source code in dpipes/pipeline.py
funcs = funcs
instance-attribute
kwargs = kwargs
instance-attribute
__call__(x)
__init__(funcs, kwargs=None)
Instantiate a Pipeline object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
funcs |
T.Sequence[T.Callable]
|
A sequence of callable functions. |
required |
kwargs |
T.Optional[T.Union[T.Dict[str, T.Any], T.Sequence[T.Optional[T.Dict[str, T.Any]]]]]
|
An iterable collection of kwargs to apply respective functions to. If a single set of
kwargs is passed they will be broadcast across the sequence of functions.
Use |
None
|
Source code in dpipes/pipeline.py
make_pipeline(funcs, kwargs=None)
Compose a pipeline from a sequence of functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
funcs |
T.Sequence[T.Callable]
|
A sequence of callable functions. |
required |
kwargs |
T.Optional[T.Union[T.Dict[str, T.Any], T.Sequence[T.Optional[T.Dict[str, T.Any]]]]]
|
An iterable collection of kwargs to apply respective functions to. If a single set of
kwargs is passed they will be broadcast across the sequence of functions.
Use |
None
|
Returns:
Type | Description |
---|---|
Callable
|
A pipeline composition function. |
Source code in dpipes/pipeline.py
make_partials(funcs, kwargs)
Create a sequence of partial functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
funcs |
T.Sequence[T.Callable]
|
A sequence of callable functions. |
required |
kwargs |
T.Union[T.Dict[str, T.Any], T.Sequence[T.Optional[T.Dict[str, T.Any]]]]
|
An iterable collection of kwargs to apply respective functions to. If a single set of
kwargs is passed they will be broadcast across the sequence of functions.
Use |
required |
Returns:
Type | Description |
---|---|
Sequence[Callable]
|
A sequence of partial functions. |