Package: control_flow¶
Control flow nodes.
These nodes can be used to implement non-linear control flow such as looping, conditional processing, and functions. These features are mostly for lightweight glue code, while complex logic is best written in Python. All control flow nodes receive a subgraph that they control (that is, evaluate zero or more times in case of loops or conditionally in case of If/Else) as an input. As such, the controlling node typically follows the nodes being controlled in the graph or when used in script from, the controlling node receives the subgraph as an argument.
Nodes in this package:
-
For Each (Array)
Apply the loop body to each slice of an array or packet along some axis and stack the results along some axis. -
Break (Loop)
Break out of the current loop. -
Continue / Skip (Loop)
Skip the rest of the current loop cycle and continue with the next loop iteration, if any. -
Catch Exception(s)
Evaluate the try body while guarding for exceptions. -
Fold Loop
Fold elements of a collection or iterable using a function that successively combines (reduces) the elements with an initial value. -
Fold Loop (Collecting)
A variant of the Fold loop node that additionally collects a secondary output of the loop body in each iteration and stacks them into an array or Packet. -
For Each
Apply a function or loop body to each item in a collection or iterator. -
Function Call
Call/apply a function with some positional arguments and/or named ("keyword") arguments. -
Function Definition
Define a function. -
Graph Placeholder
A placeholder that can accept a graph or callable function. -
If / Else
If-else conditional control flow aka conditional computation. -
Import
Import definitions from another pipeline. -
Lambda Function
Create an anonymous (lambda) function. -
For Each (Parallel)
Parallel version of the For Each node. -
Placeholder
Declare a named placeholder in a graph. -
Result
Declare an output as the result of the graph. -
Sequential
Ensure that the paths wired into the node are evaluated in a specified order. -
Switch
Switch expression for conditional control. -
Throw Exception
Throw an Exception. -
While Loop
Evaluate the loop body while the condition holds.