meshed.composition
Specific use of FuncNode and DAG
- meshed.composition.func_node_name_trans(name_trans: Callable[[str], str | None], *, also_apply_to_func_label: bool = False)[source]
- Parameters:
name_trans – A function taking a str and returning a str, or None (to indicate that no transformation should take place).
also_apply_to_func_label –
- Returns:
- meshed.composition.get_param(func)[source]
Find the name of the parameter of a function with exactly one parameter. Raise an error if more or less parameters. :param func: callable, the function to inspect :return: str, the name of the single parameter of func
- meshed.composition.is_func_node_kwargs_trans(func: Callable) bool [source]
Returns True iff the only required params of func are FuncNode field names. This ensures that the func will be able to be bound to FuncNode fields and therefore used as a func_node (kwargs) transformer.
- meshed.composition.line_with_dag(*steps)[source]
Emulate a Line object with a DAG :param steps: an iterable of callables, the steps of the pipeline. Each step should have exactly one parameter and the output of each step is fed into the next :return: a DAG instance computing the composition of all the functions in steps, in the provided order