seq
4.0.0-pre3
|
Basic sequencer node. More...
Public Member Functions | |
def | __attrs_post_init__ (self) |
Assigns node's name and id. More... | |
def | __iter__ (self) |
def | start_step (self) |
Standard sequence's start step. More... | |
def | end_step (self) |
Standard sequence's end step. More... | |
def | append (self, s) |
Appends a node to the Sequence. More... | |
def | make_sequence (self, parent_tpl=None) |
Builds this sequence execution graph. More... | |
def | create_node_tasks (self, resume=False) |
Creates Task object associated to this node. More... | |
def | reschedule_node (self, node_id) |
Reschedule a node for execution. More... | |
def | start (self, make_sequence=True, resume=False) |
This is the entry point for Sequence execution. More... | |
def | run (self) |
Runs the node – This executes the task. More... | |
def | execute (self, resume=False, propagate=False) |
Executes this just creates the asyncio task. More... | |
def | resume (self) |
Resume node execution. More... | |
def | main_task (self) |
Returns the objective node of the sequence – the end node. More... | |
def | __call__ (self, resume=False) |
def | abort (self) |
Aborts the sequence. More... | |
def | nodes (self) |
Return nodes from Graph. More... | |
def | get_node (self, node_id) |
Get node by id. More... | |
def | get_task (self, node_id) |
Get task by node_id. More... | |
def | par (self, k) |
Get a parameter value. More... | |
def | set (self, p) |
Sets the value of a parameter. More... | |
![]() | |
def | make_sequence (self) |
does nothing More... | |
def | make_task (self, node, input_list, resume) |
Creates the task object that executes the node. More... | |
def | pause (self) |
Static Public Member Functions | |
def | get_context () |
def | create (*args, **kw) |
Sequence node constructor. More... | |
Public Attributes | |
name | |
id | |
in_error | |
runtime_flags | |
t_start | |
skip | |
exception | |
t_end | |
Static Public Attributes | |
graph = attr.ib(init=False, default=attr.Factory(nx.DiGraph), repr=False) | |
debug = attr.ib(init=False, default=False, repr=False) | |
current_seq = cv.ContextVar("current_seq", default=None) | |
root = cv.ContextVar("root", default=None) | |
![]() | |
id = attr.ib(default=None, kw_only=True) | |
name = attr.ib(default=None, kw_only=True) | |
runtime_flags = attr.ib(default=0, kw_only=True) | |
deps = attr.ib(default=attr.Factory(list), repr=False, kw_only=True, init=False) | |
description = attr.ib(default="", kw_only=True) | |
exception = attr.ib(init=False, default=None, repr=False) | |
can_skip = attr.ib(default=True, init=False) | |
hide = attr.ib(default=False, init=False) | |
t_start = attr.ib(init=False, default=None, repr=False) | |
t_end = attr.ib(init=False, default=None, repr=False) | |
running_checkpoint | |
serial_number = attr.ib(init=False) | |
Properties | |
context = property | |
Get context dictionary, preferably from root node. More... | |
seq = property | |
Retrieves the sequence list. More... | |
G = property | |
returns the graph object More... | |
start_node = property | |
Returns the start node. More... | |
end_node = property | |
Returns the end node. More... | |
parameters = property | |
Return parameters. More... | |
state = property | |
node state More... | |
full_state = property | |
![]() | |
result = property | |
Node's result. More... | |
end_node = property | |
start_node = property | |
state = property | |
Gets the node state. More... | |
full_state = property | |
Gets the node state. More... | |
in_error = property | |
skip = property | |
Basic sequencer node.
Use :meth:create
to properly build :class:Sequence
objects.
Table 1 Context Variables --------------------------------------------- Name | Desc - | - current_seq | The parent of the current node root | Top level DAG's root - | -
Examples
... assert current_seq == s
def lib.nodes.sequence.Sequence.__attrs_post_init__ | ( | self | ) |
Assigns node's name and id.
Reimplemented in lib.nodes.template.Template, lib.nodes.recover.RLoop, lib.nodes.parallel.Parallel, lib.nodes.observing_block.ObservingBlock, and lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.__call__ | ( | self, | |
resume = False |
|||
) |
def lib.nodes.sequence.Sequence.__iter__ | ( | self | ) |
def lib.nodes.sequence.Sequence.abort | ( | self | ) |
Aborts the sequence.
Goes trough the full graph and aborts the tasks associated to nodes (if any). Do not allow nodes to run by taking away its running_checkpoint attribute.
def lib.nodes.sequence.Sequence.append | ( | self, | |
s | |||
) |
Appends a node to the Sequence.
|
static |
Sequence node constructor.
*args: Variable length list of nodes or coroutines that compose the
sequence. | |
id | Node id |
name | node name |
Reimplemented in lib.nodes.parallel.Parallel, and lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.create_node_tasks | ( | self, | |
resume = False |
|||
) |
Creates Task object associated to this node.
def lib.nodes.sequence.Sequence.end_step | ( | self | ) |
Standard sequence's end step.
Evaluates the sequence's final state. Collects node's result and put them in the sequence's result attribute.
Reimplemented in lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.execute | ( | self, | |
resume = False , |
|||
propagate = False |
|||
) |
Executes this just creates the asyncio task.
Reimplemented in lib.nodes.template.Template.
|
static |
def lib.nodes.sequence.Sequence.get_node | ( | self, | |
node_id | |||
) |
Get node by id.
Reimplemented in lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.get_task | ( | self, | |
node_id | |||
) |
Get task by node_id.
def lib.nodes.sequence.Sequence.main_task | ( | self | ) |
Returns the objective node of the sequence – the end node.
def lib.nodes.sequence.Sequence.make_sequence | ( | self, | |
parent_tpl = None |
|||
) |
Builds this sequence execution graph.
Joins the Sequence's nodes together.
Reimplemented in lib.nodes.template.Template, lib.nodes.parallel.Parallel, and lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.nodes | ( | self | ) |
Return nodes from Graph.
Reimplemented in lib.nodes.loop.Loop.
def lib.nodes.sequence.Sequence.par | ( | self, | |
k | |||
) |
Get a parameter value.
def lib.nodes.sequence.Sequence.reschedule_node | ( | self, | |
node_id | |||
) |
Reschedule a node for execution.
def lib.nodes.sequence.Sequence.resume | ( | self | ) |
Resume node execution.
Reimplemented from lib.nodes.interface._BaseNode.
def lib.nodes.sequence.Sequence.run | ( | self | ) |
Runs the node – This executes the task.
def lib.nodes.sequence.Sequence.set | ( | self, | |
p | |||
) |
Sets the value of a parameter.
def lib.nodes.sequence.Sequence.start | ( | self, | |
make_sequence = True , |
|||
resume = False |
|||
) |
This is the entry point for Sequence execution.
SeqTask
object that executes the sequenceException | Any exception received is re-raised and the sequence is aborted. |
def lib.nodes.sequence.Sequence.start_step | ( | self | ) |
Standard sequence's start step.
Sets the sequence's state to RUNNING
|
static |
|
static |
lib.nodes.sequence.Sequence.exception |
|
static |
lib.nodes.sequence.Sequence.id |
lib.nodes.sequence.Sequence.in_error |
lib.nodes.sequence.Sequence.name |
|
static |
lib.nodes.sequence.Sequence.runtime_flags |
lib.nodes.sequence.Sequence.skip |
lib.nodes.sequence.Sequence.t_end |
lib.nodes.sequence.Sequence.t_start |
|
static |
Get context dictionary, preferably from root node.
|
static |
Returns the end node.
If it does not exist, it creates it.
|
static |
|
static |
returns the graph object
|
static |
Return parameters.
|
static |
Retrieves the sequence list.
:meta private:
|
static |
Returns the start node.
If it does not exist, it creates it.
|
static |
node state