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.loop.Loop Class Reference

Loop node definition. More...

Inheritance diagram for seqlib.nodes.loop.Loop:

Public Member Functions

def __attrs_post_init__
 
def end_step
 
def make_sequence
 Creates the Loop execution graph. More...
 
def set_block
 Assigns the sequence to the loop's block. More...
 
def make_task
 
def nodes
 
def get_node
 
def __attrs_post_init__
 
def end_step
 
def make_sequence
 Creates the Loop execution graph. More...
 
def set_block
 Assigns the sequence to the loop's block. More...
 
def make_task
 
def nodes
 
def get_node
 

Static Public Member Functions

def create
 Creates a :class:Loop node. More...
 
def create
 Creates a :class:Loop node. More...
 

Public Attributes

 name
 
 condition
 
 init
 
 state
 
 in_error
 
 block
 

Static Public Attributes

tuple block_args = attr.ib(kw_only=True, default=attr.Factory(list), repr=False)
 
tuple condition = attr.ib(kw_only=True, default=None, repr=False)
 
tuple init = attr.ib(kw_only=True, default=None, repr=False)
 
tuple block = attr.ib(init=False, default=None, repr=False)
 
tuple index = cv.ContextVar("index", default=0)
 

Detailed Description

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.

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

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.
Parameters
initInitialization node.
conditionA Python method that returns a boolean value.
blockThe loop's body.

Member Function Documentation

def seqlib.nodes.loop.Loop.__attrs_post_init__ (   self)
def seqlib.nodes.loop.Loop.__attrs_post_init__ (   self)
def seqlib.nodes.loop.Loop.create (   args,
  kw 
)
static

Creates a :class:Loop node.

        *args: Variable length list of nodes or coroutines that comprises the Loop`s body.
Parameters
idNode id
namenode name
initinitialization node :class:Action or :class:ActionInThread.
conditioncondition node :class:Action or :class:ActionInThread.
Returns
A new :class:Loop object

Examples

Creating a loop.

.. code-block:: python

def eval_condition():
    return False

class Tpl:
    def initialize(self, context):
1 # performs some initialization
2 pass

async def a(): pass async def b(): pass

def create()

1 t = MyClass()
2 l = Loop.create(t.a, t.b, condition=eval_condition, init=t.initialize)
def seqlib.nodes.loop.Loop.create (   args,
  kw 
)
static

Creates a :class:Loop node.

        *args: Variable length list of nodes or coroutines that comprises the Loop`s body.
Parameters
idNode id
namenode name
initinitialization node :class:Action or :class:ActionInThread.
conditioncondition node :class:Action or :class:ActionInThread.
Returns
A new :class:Loop object

Examples

Creating a loop.

.. code-block:: python

def eval_condition():
    return False

class Tpl:
    def initialize(self, context):
1 # performs some initialization
2 pass

async def a(): pass async def b(): pass

def create()

1 t = MyClass()
2 l = Loop.create(t.a, t.b, condition=eval_condition, init=t.initialize)
def seqlib.nodes.loop.Loop.end_step (   self)
Standard Loop's end step.

 Evaluates the Loop's final state.
def seqlib.nodes.loop.Loop.end_step (   self)
Standard Loop's end step.

 Evaluates the Loop's final state.
def seqlib.nodes.loop.Loop.get_node (   self,
  node_id 
)
def seqlib.nodes.loop.Loop.get_node (   self,
  node_id 
)
def seqlib.nodes.loop.Loop.make_sequence (   self)

Creates the Loop execution graph.

def seqlib.nodes.loop.Loop.make_sequence (   self)

Creates the Loop execution graph.

def seqlib.nodes.loop.Loop.make_task (   self,
  node,
  input_list,
  resume 
)
def seqlib.nodes.loop.Loop.make_task (   self,
  node,
  input_list,
  resume 
)
def seqlib.nodes.loop.Loop.nodes (   self)
def seqlib.nodes.loop.Loop.nodes (   self)
def seqlib.nodes.loop.Loop.set_block (   self,
  args 
)

Assigns the sequence to the loop's block.

def seqlib.nodes.loop.Loop.set_block (   self,
  args 
)

Assigns the sequence to the loop's block.

Member Data Documentation

tuple seqlib.nodes.loop.Loop.block = attr.ib(init=False, default=None, repr=False)
static
seqlib.nodes.loop.Loop.block
tuple seqlib.nodes.loop.Loop.block_args = attr.ib(kw_only=True, default=attr.Factory(list), repr=False)
static
tuple seqlib.nodes.loop.Loop.condition = attr.ib(kw_only=True, default=None, repr=False)
static
seqlib.nodes.loop.Loop.condition
seqlib.nodes.loop.Loop.in_error
tuple seqlib.nodes.loop.Loop.index = cv.ContextVar("index", default=0)
static
tuple seqlib.nodes.loop.Loop.init = attr.ib(kw_only=True, default=None, repr=False)
static
seqlib.nodes.loop.Loop.init
seqlib.nodes.loop.Loop.name
seqlib.nodes.loop.Loop.state

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