seq  1.1.0
 All Classes Namespaces Files Functions Variables Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
seqlib.nodes.sequence.Sequence Class Reference

Basic sequencer node. More...

Inheritance diagram for seqlib.nodes.sequence.Sequence:

Public Member Functions

def __attrs_post_init__
 Assigns node's name and id. More...
 
def context
 Get context dictionary, preferably from root node. More...
 
def context
 
def seq
 Retrieves the sequence list. More...
 
def seq
 List used to create the Sequence's graph. More...
 
def G
 returns the graph object More...
 
def start_step
 
def end_step
 
def start_node
 Returns the start node. More...
 
def end_node
 Returns the end node. More...
 
def append
 Appends a node to the Sequence. More...
 
def make_sequence
 Builds this sequence execution graph. More...
 
def create_node_tasks
 Creates Task object associated to this node. More...
 
def reschedule_node
 Reschedule a node for execution. More...
 
def start
 This is the entry point for Sequence execution. More...
 
def run
 
def execute
 
def resume
 
def main_task
 Returns the objective node of the sequence – the end node. More...
 
def __call__
 
def abort
 Aborts the sequence. More...
 
def nodes
 Return nodes from Graph. More...
 
def get_node
 Get node by id. More...
 
def get_task
 Get task by node_id. More...
 
def state
 
def publish_state
 
def state
 Sets the node state. More...
 
def __attrs_post_init__
 Assigns node's name and id. More...
 
def context
 Get context dictionary, preferably from root node. More...
 
def context
 
def seq
 Retrieves the sequence list. More...
 
def seq
 List used to create the Sequence's graph. More...
 
def G
 returns the graph object More...
 
def start_step
 
def end_step
 
def start_node
 Returns the start node. More...
 
def end_node
 Returns the end node. More...
 
def append
 Appends a node to the Sequence. More...
 
def make_sequence
 Builds this sequence execution graph. More...
 
def create_node_tasks
 Creates Task object associated to this node. More...
 
def reschedule_node
 Reschedule a node for execution. More...
 
def start
 This is the entry point for Sequence execution. More...
 
def run
 
def execute
 
def resume
 
def main_task
 Returns the objective node of the sequence – the end node. More...
 
def __call__
 
def abort
 Aborts the sequence. More...
 
def nodes
 Return nodes from Graph. More...
 
def get_node
 Get node by id. More...
 
def get_task
 Get task by node_id. More...
 
def state
 
def publish_state
 
def state
 Sets the node state. More...
 

Static Public Member Functions

def get_context
 
def create
 Sequence node constructor. More...
 
def get_context
 
def create
 Sequence node constructor. More...
 

Public Attributes

 name
 
 id
 
 state
 node state More...
 
 in_error
 
 t_start
 
 t_end
 
 exception
 

Static Public Attributes

tuple graph = attr.ib(init=False, default=attr.Factory(nx.DiGraph), repr=False)
 
tuple debug = attr.ib(init=False, default=False, repr=False)
 
tuple current_tpl = cv.ContextVar("current_tpl", default=None)
 
tuple root = cv.ContextVar("root", default=None)
 

Detailed Description

Basic sequencer node.

Use :meth:create to build poperly :class:Sequence objects.

============ ===============================

Context Variables

Name Desc ============ =============================== current_tpl The parent of the current node root Top level DAG's root ============ ===============================

Examples

1 >>> s = Sequence.create(a,b, name="my sequence")
2 # execute Sequence
3 >>> await s.start()
4 # Get running Sequence from Inside function a():
5 >>> def a():

... current_tpl = Sequence.current_tpl

1 ... # now current_tpl is the node s

... assert current_tpl == s

Member Function Documentation

def seqlib.nodes.sequence.Sequence.__attrs_post_init__ (   self)

Assigns node's name and id.

def seqlib.nodes.sequence.Sequence.__attrs_post_init__ (   self)

Assigns node's name and id.

def seqlib.nodes.sequence.Sequence.__call__ (   self,
  resume = False 
)
def seqlib.nodes.sequence.Sequence.__call__ (   self,
  resume = False 
)
def seqlib.nodes.sequence.Sequence.abort (   self)

Aborts the sequence.

Goes trough the full graph and aborts the tasks associated to nodes (if any).

def seqlib.nodes.sequence.Sequence.abort (   self)

Aborts the sequence.

Goes trough the full graph and aborts the tasks associated to nodes (if any).

def seqlib.nodes.sequence.Sequence.append (   self,
  s 
)

Appends a node to the Sequence.

def seqlib.nodes.sequence.Sequence.append (   self,
  s 
)

Appends a node to the Sequence.

def seqlib.nodes.sequence.Sequence.context (   self)

Get context dictionary, preferably from root node.

def seqlib.nodes.sequence.Sequence.context (   self)

Get context dictionary, preferably from root node.

def seqlib.nodes.sequence.Sequence.context (   self,
  ctx 
)
def seqlib.nodes.sequence.Sequence.context (   self,
  ctx 
)
def seqlib.nodes.sequence.Sequence.create (   args,
  kw 
)
static

Sequence node constructor.

       *args: Variable length list of nodes or coroutines that compose the sequence.
Parameters
idNode id
namenode name
def seqlib.nodes.sequence.Sequence.create (   args,
  kw 
)
static

Sequence node constructor.

       *args: Variable length list of nodes or coroutines that compose the sequence.
Parameters
idNode id
namenode name
def seqlib.nodes.sequence.Sequence.create_node_tasks (   self,
  resume = False 
)

Creates Task object associated to this node.

def seqlib.nodes.sequence.Sequence.create_node_tasks (   self,
  resume = False 
)

Creates Task object associated to this node.

def seqlib.nodes.sequence.Sequence.end_node (   self)

Returns the end node.

If it does not exist, it creates it.

def seqlib.nodes.sequence.Sequence.end_node (   self)

Returns the end node.

If it does not exist, it creates it.

def seqlib.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.
def seqlib.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.
def seqlib.nodes.sequence.Sequence.execute (   self,
  resume = False 
)
Executes node -- this just creates the asyncio task
def seqlib.nodes.sequence.Sequence.execute (   self,
  resume = False 
)
Executes node -- this just creates the asyncio task
def seqlib.nodes.sequence.Sequence.G (   self)

returns the graph object

def seqlib.nodes.sequence.Sequence.G (   self)

returns the graph object

def seqlib.nodes.sequence.Sequence.get_context ( )
static
def seqlib.nodes.sequence.Sequence.get_context ( )
static
def seqlib.nodes.sequence.Sequence.get_node (   self,
  node_id 
)

Get node by id.

def seqlib.nodes.sequence.Sequence.get_node (   self,
  node_id 
)

Get node by id.

def seqlib.nodes.sequence.Sequence.get_task (   self,
  node_id 
)

Get task by node_id.

def seqlib.nodes.sequence.Sequence.get_task (   self,
  node_id 
)

Get task by node_id.

def seqlib.nodes.sequence.Sequence.main_task (   self)

Returns the objective node of the sequence – the end node.

def seqlib.nodes.sequence.Sequence.main_task (   self)

Returns the objective node of the sequence – the end node.

def seqlib.nodes.sequence.Sequence.make_sequence (   self)

Builds this sequence execution graph.

def seqlib.nodes.sequence.Sequence.make_sequence (   self)

Builds this sequence execution graph.

def seqlib.nodes.sequence.Sequence.nodes (   self)

Return nodes from Graph.

def seqlib.nodes.sequence.Sequence.nodes (   self)

Return nodes from Graph.

def seqlib.nodes.sequence.Sequence.publish_state (   self)
def seqlib.nodes.sequence.Sequence.publish_state (   self)
def seqlib.nodes.sequence.Sequence.reschedule_node (   self,
  node_id 
)

Reschedule a node for execution.

def seqlib.nodes.sequence.Sequence.reschedule_node (   self,
  node_id 
)

Reschedule a node for execution.

def seqlib.nodes.sequence.Sequence.resume (   self)
Resume node execution
def seqlib.nodes.sequence.Sequence.resume (   self)
Resume node execution
def seqlib.nodes.sequence.Sequence.run (   self)
Runs the node -- This executes the task
def seqlib.nodes.sequence.Sequence.run (   self)
Runs the node -- This executes the task
def seqlib.nodes.sequence.Sequence.seq (   self)

Retrieves the sequence list.

:meta private:

def seqlib.nodes.sequence.Sequence.seq (   self)

Retrieves the sequence list.

:meta private:

def seqlib.nodes.sequence.Sequence.seq (   self,
  s 
)

List used to create the Sequence's graph.

Parameters
-----------

s Sequence list.

Members of 's' represents sequence nodes. If they are coroutines
they are automagically converted to :class:'Action' nodes.
def seqlib.nodes.sequence.Sequence.seq (   self,
  s 
)

List used to create the Sequence's graph.

Parameters
-----------

s Sequence list.

Members of 's' represents sequence nodes. If they are coroutines
they are automagically converted to :class:'Action' nodes.
def seqlib.nodes.sequence.Sequence.start (   self,
  make_sequence = True,
  resume = False 
)

This is the entry point for Sequence execution.

Returns
Returns the :class:SeqTask object that executes the sequence
Exceptions
ExceptionAny exception received is re-raised and the sequence is aborted.
def seqlib.nodes.sequence.Sequence.start (   self,
  make_sequence = True,
  resume = False 
)

This is the entry point for Sequence execution.

Returns
Returns the :class:SeqTask object that executes the sequence
Exceptions
ExceptionAny exception received is re-raised and the sequence is aborted.
def seqlib.nodes.sequence.Sequence.start_node (   self)

Returns the start node.

If it does not exist, it creates it.

def seqlib.nodes.sequence.Sequence.start_node (   self)

Returns the start node.

If it does not exist, it creates it.

def seqlib.nodes.sequence.Sequence.start_step (   self)
Standard sequence's start step.

Sets the sequence's state to RUNNING
def seqlib.nodes.sequence.Sequence.start_step (   self)
Standard sequence's start step.

Sets the sequence's state to RUNNING
def seqlib.nodes.sequence.Sequence.state (   self)
def seqlib.nodes.sequence.Sequence.state (   self)
def seqlib.nodes.sequence.Sequence.state (   self,
  value 
)

Sets the node state.

def seqlib.nodes.sequence.Sequence.state (   self,
  value 
)

Sets the node state.

Member Data Documentation

tuple seqlib.nodes.sequence.Sequence.current_tpl = cv.ContextVar("current_tpl", default=None)
static
tuple seqlib.nodes.sequence.Sequence.debug = attr.ib(init=False, default=False, repr=False)
static
seqlib.nodes.sequence.Sequence.exception
tuple seqlib.nodes.sequence.Sequence.graph = attr.ib(init=False, default=attr.Factory(nx.DiGraph), repr=False)
static
seqlib.nodes.sequence.Sequence.id
seqlib.nodes.sequence.Sequence.in_error
seqlib.nodes.sequence.Sequence.name
tuple seqlib.nodes.sequence.Sequence.root = cv.ContextVar("root", default=None)
static
seqlib.nodes.sequence.Sequence.state

node state

seqlib.nodes.sequence.Sequence.t_end
seqlib.nodes.sequence.Sequence.t_start

The documentation for this class was generated from the following files: