Node class
Definition
Represents a basic unit in a graph, for example, it could be any datasource or step.
Node(graph, node_id, name=None, module=None, module_builder=None, datasource=None, datasource_builder=None, module_wiring=None)
- Inheritance
-
builtins.objectNode
Parameters
- graph
- Graph
The graph this node belongs to.
- node_id
- str
The ID of the node.
- name
- str
The name of the graph.
- module
- Module
The module associated with the Node.
- module_builder
- _ModuleBuilder
The module builder associated with the Node.
- datasource
- DataSource
The datasource associated with the Node.
- datasource_builder
- _DatasourceBuilder
The datasource builder associated with the Node.
- module_wiring
- {}
mapping between the node's inputs/outputs and the module inputs/outputs. Holds two keys,inputs and outputs, each mapped to a dict whose keys are the module's inputs/outputs names, and the values are the node's ports
Methods
get_input(name) |
Return an InputPort by name. |
get_output(name) |
Return an OutputPort by name. |
get_param(name) |
Return a parameter by name. |
run_after(node) |
Run this node after the given node. If you want to run a step, say, step3 after both step1 and step2 are completed, you can use:
|
sequence(nodes) |
Configure a list of nodes to run in sequence after this node. |
get_input(name)
Return an InputPort by name.
get_input(name)
Parameters
- name
- str
Name of the input port.
Returns
The input port with the matching name.
Return type
get_output(name)
Return an OutputPort by name.
get_output(name)
Parameters
- name
- str
Name of the output port
Returns
The output port
Return type
get_param(name)
Return a parameter by name.
get_param(name)
Parameters
- name
- str
Name of the parameter.
Returns
The parameter.
Return type
run_after(node)
Run this node after the given node.
If you want to run a step, say, step3 after both step1 and step2 are completed, you can use:
step3.run_after(step1)
step3.run_after(step2)
run_after(node)
Parameters
- node
- Node
The node to run before this node.
sequence(nodes)
Configure a list of nodes to run in sequence after this node.
sequence(nodes)
Parameters
- nodes
- list
The list of nodes.
Attributes
datasource_def
input_dict
inputs
module_def
name
node_id
output_dict
Get a dictionary containing all outputs.
Returns
Dictionary of {output name, OutputPort}
Return type
outputs
params
Feedback
Loading feedback...