|
seq
2.0.0
|
Public Member Functions | |
| def | __attrs_post_init__ (self) |
| Assigns node's name and id. More... | |
| def | end_step (self) |
| def | make_sequence (self) |
| Creates the Loop execution graph. More... | |
| def | set_block (self, *args) |
| Assigns the sequence to the loop's block. More... | |
| def | make_task (self, node, input_list, resume) |
| Creates the task object that executes the node. More... | |
| def | nodes (self) |
| Return nodes from Graph. More... | |
| def | get_node (self, node_id) |
| Get node by id. More... | |
| def | __attrs_post_init__ (self) |
| Assigns node's name and id. More... | |
| def | end_step (self) |
| def | make_sequence (self) |
| Creates the Loop execution graph. More... | |
| def | set_block (self, *args) |
| Assigns the sequence to the loop's block. More... | |
| def | make_task (self, node, input_list, resume) |
| Creates the task object that executes the node. More... | |
| def | nodes (self) |
| Return nodes from Graph. More... | |
| def | get_node (self, node_id) |
| Get node by id. More... | |
Public Member Functions inherited from lib.nodes.sequence.Sequence | |
| def | __iter__ (self) |
| def | context (self) |
| Get context dictionary, preferably from root node. More... | |
| def | context (self, ctx) |
| def | seq (self) |
| Retrieves the sequence list. More... | |
| def | seq (self, s) |
| List used to create the Sequence's graph. More... | |
| def | G (self) |
| returns the graph object More... | |
| def | start_step (self) |
| def | start_node (self) |
| Returns the start node. More... | |
| def | end_node (self) |
| Returns the end node. More... | |
| def | append (self, s) |
| Appends a node to the Sequence. 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) |
| def | execute (self, resume=False) |
| def | resume (self) |
| 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 | get_task (self, node_id) |
| Get task by node_id. More... | |
| def | state (self) |
| Gets the node state. More... | |
| def | state (self, value) |
| Sets the node state. More... | |
| def | publish_state (self) |
| def | state (self, value) |
| Sets the node state. More... | |
| def | __iter__ (self) |
| def | context (self) |
| Get context dictionary, preferably from root node. More... | |
| def | context (self, ctx) |
| def | seq (self) |
| Retrieves the sequence list. More... | |
| def | seq (self, s) |
| List used to create the Sequence's graph. More... | |
| def | G (self) |
| returns the graph object More... | |
| def | start_step (self) |
| def | start_node (self) |
| Returns the start node. More... | |
| def | end_node (self) |
| Returns the end node. More... | |
| def | append (self, s) |
| Appends a node to the Sequence. 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) |
| def | execute (self, resume=False) |
| def | resume (self) |
| 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 | get_task (self, node_id) |
| Get task by node_id. More... | |
| def | state (self) |
| Gets the node state. More... | |
| def | state (self, value) |
| Sets the node state. More... | |
| def | publish_state (self) |
| def | state (self, value) |
| Sets the node state. More... | |
Public Member Functions inherited from lib.nodes.interface._BaseNode | |
| def | result (self) |
| Node's result. More... | |
| def | result (self, val) |
| def | full_state (self) |
| Gets the node state. More... | |
| def | in_error (self) |
| def | skip (self) |
| def | skip (self, flag=True) |
| def | in_error (self, flag=True) |
| def | pause (self) |
| def | result (self) |
| Node's result. More... | |
| def | result (self, val) |
| def | full_state (self) |
| Gets the node state. More... | |
| def | in_error (self) |
| def | skip (self) |
| def | skip (self, flag=True) |
| def | in_error (self, flag=True) |
| def | pause (self) |
Static Public Member Functions | |
| def | create (*args, **kw) |
Creates a :class:Loop node. More... | |
| def | create (*args, **kw) |
Creates a :class:Loop node. More... | |
Static Public Member Functions inherited from lib.nodes.sequence.Sequence | |
| def | get_context () |
| def | get_context () |
Public Attributes | |
| name | |
| state | |
| in_error | |
Public Attributes inherited from lib.nodes.sequence.Sequence | |
| name | |
| id | |
| serial_number | |
| state | |
| node state More... | |
| in_error | |
| runtime_flags | |
| t_start | |
| skip | |
| exception | |
| t_end | |
Static Public Attributes | |
| block_args = attr.ib(kw_only=True, default=attr.Factory(list), repr=False) | |
| condition = attr.ib(kw_only=True, default=None, repr=False) | |
| init = attr.ib(kw_only=True, default=None, repr=False) | |
| block = attr.ib(init=False, default=None, repr=False) | |
| index = cv.ContextVar("index", default=0) | |
Static Public Attributes inherited from lib.nodes.sequence.Sequence | |
| graph = attr.ib(init=False, default=attr.Factory(nx.DiGraph), repr=False) | |
| debug = attr.ib(init=False, default=False, repr=False) | |
| current_tpl = cv.ContextVar("current_tpl", default=None) | |
| root = cv.ContextVar("root", default=None) | |
Static Public Attributes inherited from lib.nodes.interface._BaseNode | |
| serial_number = attr.ib(default=0, kw_only=True) | |
| id = attr.ib(default=None, kw_only=True) | |
| name = attr.ib(default=None, kw_only=True) | |
| runtime_flags = attr.ib(default=0, init=False) | |
| 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 | |
Loop node definition.
Use the :meth:create method to build properly :class:Loop node. Since it inherits from :class:Sequence it has access to the same context variables.
============ =======================================================
Name Desc ============ ======================================================= current_tpl The parent of the current node (from :class:Sequence) root Top level DAG's root (from :class:Sequence) index The Loop's current index (starts at 0) ============ =======================================================
id (Optional str): Node id.
name (Optional str): Node name.
| init | Initialization node. |
| condition | A Python method that returns a boolean value. |
| block | The loop's body. |
Use the :meth:create method to build properly :class:Loop node. Since it inherits from :class:Sequence it has access to the same context variables.
============ =======================================================
Name Desc ============ ======================================================= current_tpl The parent of the current node (from :class:Sequence) root Top level DAG's root (from :class:Sequence) index The Loop's current index (starts at 0) ============ =======================================================
id (Optional str): Node id.
name (Optional str): Node name.
| init | Initialization node. |
| condition | A Python method that returns a boolean value. |
| block | The loop's body. |
| def lib.nodes.loop.Loop.__attrs_post_init__ | ( | self | ) |
Assigns node's name and id.
Reimplemented from lib.nodes.sequence.Sequence.
Reimplemented in lib.nodes.recover.RLoop, and lib.nodes.recover.RLoop.
| def lib.nodes.loop.Loop.__attrs_post_init__ | ( | self | ) |
Assigns node's name and id.
Reimplemented from lib.nodes.sequence.Sequence.
Reimplemented in lib.nodes.recover.RLoop, and lib.nodes.recover.RLoop.
|
static |
Creates a :class:Loop node.
*args: Variable length list of nodes or coroutines that comprises the Loop`s body.
| id | Node id |
| name | node name |
| init | initialization node :class:Action or :class:ActionInThread. |
| condition | condition node :class:Action or :class:ActionInThread. |
Loop objectExamples
Creating a loop.
.. code-block:: python
def eval_condition():
return False
class Tpl:
def initialize(self, context):
async def a(): pass async def b(): pass
@staticmethod def create()
Reimplemented from lib.nodes.sequence.Sequence.
|
static |
Creates a :class:Loop node.
*args: Variable length list of nodes or coroutines that comprises the Loop`s body.
| id | Node id |
| name | node name |
| init | initialization node :class:Action or :class:ActionInThread. |
| condition | condition node :class:Action or :class:ActionInThread. |
Loop objectExamples
Creating a loop.
.. code-block:: python
def eval_condition():
return False
class Tpl:
def initialize(self, context):
async def a(): pass async def b(): pass
@staticmethod def create()
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.end_step | ( | self | ) |
Standard Loop's end step. Evaluates the Loop's final state.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.end_step | ( | self | ) |
Standard Loop's end step. Evaluates the Loop's final state.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.get_node | ( | self, | |
| node_id | |||
| ) |
Get node by id.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.get_node | ( | self, | |
| node_id | |||
| ) |
Get node by id.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.make_sequence | ( | self | ) |
Creates the Loop execution graph.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.make_sequence | ( | self | ) |
Creates the Loop execution graph.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.make_task | ( | self, | |
| node, | |||
| input_list, | |||
| resume | |||
| ) |
Creates the task object that executes the node.
Reimplemented from lib.nodes.interface._BaseNode.
Reimplemented in lib.nodes.recover.RLoop, and lib.nodes.recover.RLoop.
| def lib.nodes.loop.Loop.make_task | ( | self, | |
| node, | |||
| input_list, | |||
| resume | |||
| ) |
Creates the task object that executes the node.
Reimplemented from lib.nodes.interface._BaseNode.
Reimplemented in lib.nodes.recover.RLoop, and lib.nodes.recover.RLoop.
| def lib.nodes.loop.Loop.nodes | ( | self | ) |
Return nodes from Graph.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.nodes | ( | self | ) |
Return nodes from Graph.
Reimplemented from lib.nodes.sequence.Sequence.
| def lib.nodes.loop.Loop.set_block | ( | self, | |
| * | args | ||
| ) |
Assigns the sequence to the loop's block.
| def lib.nodes.loop.Loop.set_block | ( | self, | |
| * | args | ||
| ) |
Assigns the sequence to the loop's block.
|
static |
|
static |
|
static |
| lib.nodes.loop.Loop.in_error |
|
static |
|
static |
| lib.nodes.loop.Loop.name |
| lib.nodes.loop.Loop.state |