Nodifying

The act of nodifying is performed by users mainly through the Node.from_func and Workflow.from_func methods.

Creating a workflow is particularly difficult, since one must split the function’s code into pieces of computation. This is done by getting the function’s code and parsing it into an Abstract Syntax Tree (AST), with python’s built-in ast module. The AST is then transformed and then converted back into code, which we execute to generate the workflow. The class that we use for the transformation is:

NodeConverter(*args[, assign_fn, ...])

AST transformer that converts a function into a workflow.

This class is used by the utility functions:

nodify_func(func[, transformer_cls, ...])

Converts all calculations of a function into nodes.

nodify_code(code[, transformer_cls, ...])

to transform python code and python functions into workflows.

Finally, we have a function to convert all the functions of a module into nodes:

nodify_module(module[, node_class])

Returns a copy of a module where all functions are replaced with nodes.