herostools.flow.dummy

Classes

Logger

Log incoming flow data and forward it unchanged.

AddConstant

Add a constant value to incoming flow data.

Sqrt

Apply the square root to incoming flow data.

ToPower

Raise incoming flow data to a configured exponent.

Module Contents

class herostools.flow.dummy.Logger(inputs: collections.abc.Mapping[str, heros.HERORef | str] | collections.abc.Sequence[heros.HERORef | str] | None = None, identifier_key: str = 'identifier', subscriber: herostools.flow._subscriber.FlowSubscriber | None = None, queue_warn_threshold: int = 100)[source]

Bases: herostools.flow.Node

Log incoming flow data and forward it unchanged.

Every message is logged at INFO on purpose, since showing the data is the point of this node.

_process(inputs: dict[str, Any], metadata: dict) → tuple[Any, dict][source]

Log and return incoming data.

Parameters:
  • inputs – Input data keyed by input name.

  • metadata – Input metadata.

Returns:

The single input value and empty metadata.

class herostools.flow.dummy.AddConstant(constant: float = 5, **kwargs)[source]

Bases: herostools.flow.Node

Add a constant value to incoming flow data.

constant: float
_process(inputs: dict[str, Any], metadata: dict) → tuple[Any, dict][source]

Add the configured constant to incoming data.

Parameters:
  • inputs – Input data keyed by input name.

  • metadata – Input metadata.

Returns:

Transformed data and empty metadata.

class herostools.flow.dummy.Sqrt(inputs: collections.abc.Mapping[str, heros.HERORef | str] | collections.abc.Sequence[heros.HERORef | str] | None = None, identifier_key: str = 'identifier', subscriber: herostools.flow._subscriber.FlowSubscriber | None = None, queue_warn_threshold: int = 100)[source]

Bases: herostools.flow.Node

Apply the square root to incoming flow data.

_process(inputs: dict[str, Any], metadata: dict) → tuple[Any, dict][source]

Calculate the square root of incoming data.

Parameters:
  • inputs – Input data keyed by input name.

  • metadata – Input metadata.

Returns:

Transformed data and empty metadata.

class herostools.flow.dummy.ToPower(exponent: float = 2, **kwargs)[source]

Bases: herostools.flow.Node

Raise incoming flow data to a configured exponent.

exponent: float
_process(inputs: dict[str, Any], metadata: dict) → tuple[Any, dict][source]

Raise incoming data to the configured exponent.

Parameters:
  • inputs – Input data keyed by input name.

  • metadata – Input metadata.

Returns:

Transformed data and empty metadata.