Node

class ioiocore.node.Node(name=None, **kwargs)[source]

Bases: ABC, Portable

Abstract base class representing a node in a signal processing pipeline.

Inherits from ABC and Portable, and provides the core structure for setting up and running the Node, including managing its configuration, implementation, logger, and state.

Parameters:

name (str)

_IMP_CLASS

The implementation class for the Node.

Type:

type

_imp

The instance of the implementation class for the Node.

Type:

_IMP_CLASS

config

The configuration object for the Node.

Type:

Configuration

class Configuration(name=None, **kwargs)[source]

Bases: Configuration

Configuration class for the Node

Parameters:

name (str)

Keys[source]

The configuration keys.

class Keys[source]

Bases: Keys

Configuration keys.

NAME = 'name'
__init__(name=None, **kwargs)[source]

Initialize the Node configuration.

Parameters:
  • name (str, optional) – The name of the Node (default is the class name).

  • kwargs (additional keyword arguments) – Other configuration parameters passed to the base class.

__init__(name=None, **kwargs)[source]

Initialize the Node.

Parameters:
  • name (str, optional) – The name of the Node (default is None).

  • kwargs (additional keyword arguments) – Other parameters passed to create the Node configuration.

config: Configuration
get_context()[source]
Return type:

Context

get_counter()[source]

Get the current counter value of the Node.

Returns:

The counter value of the Node.

Return type:

int

get_state()[source]

Get the current state of the Node.

Returns:

The current state of the Node.

Return type:

Constants.States

log(msg, type=None)[source]
Parameters:
property name: str
set_logger(logger)[source]
Parameters:

logger (Logger)

abstractmethod setup(data, port_context_in)[source]

Abstract method to setup the Node.

This method should be implemented to define the setup logic for the Node.

Parameters:
  • data (dict) – The input data to configure the Node.

  • port_context_in (dict) – Context for the input ports.

Returns:

The configuration of the output ports.

Return type:

dict

start()[source]

Start the Node.

Starts the internal implementation of the Node.

abstractmethod step(data)[source]

Abstract method for the Node’s step function.

This method should be implemented to define the processing logic for each step of the Node.

Parameters:

data (dict) – The input data to process.

Returns:

The processed data after applying the step logic.

Return type:

dict

stop()[source]

Stop the Node.

Stops the internal implementation of the Node.