streamsim.src.features.simple module

Simple Feature Deriver for Streaming Data

This module provides a minimal feature derivation class that implements the StreamingFeatureDeriver interface. It serves as a passthrough component, treating raw samples directly as feature values without transformation.

This class is useful for:
  • Testing and debugging streaming pipelines

  • Scenarios where raw signal values are the desired features

  • As a template for implementing more complex feature derivers

Dependencies:
  • streamsim.src.core.interfaces.StreamingFeatureDeriver: Base interface

Author: F.Feenstra

class streamsim.src.features.simple.SimpleFeature[source]

Bases: StreamingFeatureDeriver

add_sample(sample, timestamp=None)[source]

Add a new sample to the processor.

Processes the incoming data point and updates internal state. This method is called frequently in the streaming loop.

Parameters:
  • sample (float) – The new data value to process.

  • timestamp (float, optional) – The timestamp associated with the sample. Used for time-based calculations if supported.

get_feature()[source]

Get the latest derived feature value.

Returns the most recently computed feature based on the samples processed so far. Returns None if insufficient data exists to compute a feature.

Returns:

The calculated feature value, or None if unavailable.

Return type:

Optional[float]