timeflux.core.node


Node base class.

node

class timeflux.core.node.Node[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

Instantiate the node.

bind(source, target)[source]

Create an alias of a port

Parameters:
  • source (string) – The name of the source port

  • target (string) – The name of the target port

iterate(name='*')[source]

Iterate through ports.

If name ends with the globbing character (*), the generator iterates through all existing ports matching that pattern. Otherwise, only one port is returned. If it does not already exist, it is automatically created.

Parameters:

name (string) – The matching pattern.

Yields:

(tupple) – A tupple containing:

  • name (string): The full port name.

  • suffix (string): The part of the name matching the globbing character.

  • port (Port): The port object.

clear()[source]

Reset all ports.

It is assumed that numbered ports (i.e. those with a name ending with an underscore followed by numbers) are temporary and must be completely removed. The only exception is when they are bound to a default or named port. All other ports are simply emptied to avoid the cost of reinstanciating a new Port object before each update.

abstract update()[source]

Update the input and output ports.

terminate()[source]

Perform cleanup upon termination.