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_counter()[source]

Get the current counter value of the Node.

Returns:

The counter value of the Node.

Return type:

int

get_load()[source]

Get the current load of the Node.

Returns:

The load value of the Node.

Return type:

float

get_name()[source]

Get the name of the Node.

Returns:

The name of the Node.

Return type:

str

get_state()[source]

Get the current state of the Node.

Returns:

The current state of the Node.

Return type:

Constants.States

set_logger(logger)[source]

Set the logger for the Node.

Parameters:

logger (Logger) – The Logger instance to set for the Node.

abstract setup(data, port_metadata_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_metadata_in (dict) – Metadata 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.

abstract 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.