- vivarium.engine.framework.values.combiners.replace_combiner(value, mutator, *args, **kwargs)[source]
Replaces the previous pipeline output with the output of the mutator.
This is the default combiner.
- Return type:
- Parameters:
value (Any) – The value from the previous step in the pipeline.
mutator (Callable[[...], Any]) – A callable that takes in all arguments that the pipeline source takes in plus an additional last positional argument for the value from the previous stage in the pipeline.
args (Any) – The same args and kwargs provided during the invocation of the pipeline.
kwargs (Any) – The same args and kwargs provided during the invocation of the pipeline.
- Returns:
A modified version of the input value.
- vivarium.engine.framework.values.combiners.list_combiner(value, mutator, *args, **kwargs)[source]
Aggregates source and mutator output into a list.
This combiner is meant to be used with a post-processor that does some kind of reduce operation like summing all values in the list.
- Return type:
- Parameters:
value (list[Any]) – A list of all values provided by the source and prior mutators in the pipeline.
mutator (Callable[[...], Any]) – A callable that returns some portion of this pipeline’s final value.
args (Any) – The same args and kwargs provided during the invocation of the pipeline.
kwargs (Any) – The same args and kwargs provided during the invocation of the pipeline.
- Returns:
The input list with new mutator portion of the pipeline value appended to it.
- vivarium.engine.framework.values.combiners.multiplication_combiner(value, mutator, *args, **kwargs)[source]
Multiplies the previous pipeline output with the output of the mutator.
This combiner is meant to be used when the pipeline’s final value is the product of all intermediate values.
When
valueis apd.Seriesand the pipeline is invoked with theAttributePipelinecalling convention (a single positionalpd.Indexand no kwargs), the mutator is evaluated only on the non-zero entries ofvalue. Entries that are already zero will multiply to zero regardless of the mutator’s output.- Return type:
Union[ndarray[Any,dtype[number[NBitBase]]],Series,DataFrame,float,int]- Parameters:
value (ndarray[Any, dtype[number[NBitBase]]] | Series | DataFrame | float | int) – The value from the previous step in the pipeline.
mutator (Callable[[...], ndarray[Any, dtype[number[NBitBase]]] | Series | DataFrame | float | int]) – A callable that takes in all arguments that the pipeline source takes in plus an additional last positional argument for the value from the previous stage in the pipeline.
args (Any) – The same args and kwargs provided during the invocation of the pipeline.
kwargs (Any) – The same args and kwargs provided during the invocation of the pipeline.
- Returns:
A modified version of the input value.
- vivarium.engine.framework.values.combiners.addition_combiner(value, mutator, *args, **kwargs)[source]
Adds the previous pipeline output with the output of the mutator.
This combiner is meant to be used when the pipeline’s final value is the sum of all intermediate values.
- Return type:
Union[ndarray[Any,dtype[number[NBitBase]]],Series,DataFrame,float,int]- Parameters:
value (ndarray[Any, dtype[number[NBitBase]]] | Series | DataFrame | float | int) – The value from the previous step in the pipeline.
mutator (Callable[[...], ndarray[Any, dtype[number[NBitBase]]] | Series | DataFrame | float | int]) – A callable that takes in all arguments that the pipeline source takes in plus an additional last positional argument for the value from the previous stage in the pipeline.
args (Any) – The same args and kwargs provided during the invocation of the pipeline.
kwargs (Any) – The same args and kwargs provided during the invocation of the pipeline.
- Returns:
A modified version of the input value.