Lambda¶
Create an anonymous (lambda) function.
This node expresses that any named placeholders in the graph that it receives (i.e., the function body of the node) have a specific order. As a result, a graph that ends in a Lambda node can be passed into a Function Call node as the "function" argument, alongside any positional arguments. As such, a graph ending in a Lambda function represents an anonyomous (nameless) function that can be invoked with positional arguments just the same way as a named function (which is declared using the Function node). More Info... Version 0.1.0
Ports/Properties¶
graph¶
Graph that defines the function.
- verbose name: Graph
- default value: None
- port type: GraphPort
- value type: Graph
graph__signature¶
Positional arguments accepted by the lambda function. Lambda nodes are rarely needed in NeuroPype since a pairing of a Placeholder and a (name, ...) signature in a node defines a lambda function. However, the Lambda node can be used to return a function from a function, or to declare a order to the arguments of a graph when that graph is invoked with positional arguments. The graph preceding your lambda node must contain one or more Placeholder nodes for each of the arguments listed here, with their respective slotnames set to the argument names listed here. Then, anything downstream of these placeholders collectively constitutes your lambda function body, and the final node of your lambda function body is expected to return the function result. You can also have additional unlisted placeholders in your lambda function body, which are only assignable when the lambda function is invoked with additional keyword arguments. This final node is then connected to the lambda node itself by wiring the desired output port of your final lambda function body node to the "graph" input port of the lambda node. In graphical UIs, this edge will be displayed in dotted style to indicate that this is not normal forward data flow but that the function body (graph) itself is passed to the Lambda node. The Lambda node follows the lambda function body in the graph.
- verbose name: Graph [Signature]
- default value: (myargument1,myargument2)
- port type: Port
- value type: object (can be None)
function¶
Resulting lambda function.
- verbose name: Function
- default value: None
- port type: DataPort
- value type: object (can be None)
- data direction: OUT
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)