Extract Flows as Lambdas¶
Extract top level Flows as Lambda functions matching datatype in flows
Documentation¶
Extracts a Lambda node saved in a .syx file.
The Lambda node should be saved as a flow, i.e. the only contents of the file should be that of the Lambda node. It should have defined input and output ports.
Input and output datatypes needs to be specified in configuration. The default value: ‘() -> ()’ represents the generic (? symbol in the GUI) type that can be any type. Examples of other datatypes are: - datasource - table - adaf - figure - text
List datatype is represented by ‘[<datatype>]’. For example, if the lambda node takes a list of tables and returns one figure, the datatype specification should be ‘[table] -> figure’ in the configuration.
The Lambda node will change its type to reflect the choosen datatype as long as it is a non-generic function type and can be matched against connected nodes. Datatypes configured that fail to satisfy the above are simply ignored.
Definition¶
Input ports¶
- Filenames
Type: [datasource]Description: Flow filenames containing Lambdas
Output ports¶
- Functions
Type: [() -> ()]Description: Lambda functions
Configuration¶
- Datatype (datatype)
Non-generic datatype to match against lambda functions in input
- Strategy for handling extraction issues (fail_strategy)
How should the node handle the situation when the extract fails?
Examples¶
Example flows demonstrating this node:
Implementation¶
- class node_lambda.ExtractFlowsLambdas[source]