Skip to main content

Neuralyzer::TensorBuilders

Neuralyzer::TensorBuilders

Classes

Name
struct Neuralyzer::TensorBuilders::PipelineValueBindingRecipe
Row-aligned DataObject source used to populate one PipelineValueStore key.
struct Neuralyzer::TensorBuilders::ColumnRecipe
Describes how one tensor column is computed.

Types

Name
enum class std::uint8_t IntervalProperty { Start, End, Duration}
Property to extract from row intervals.

Functions

Name
ColumnProviderFn buildIntervalPropertyProvider(std::shared_ptr< DigitalIntervalSeries const > intervals, IntervalProperty property)
Build a ColumnProviderFn that extracts a property (start, end, or duration) from the row intervals.
ColumnProviderFn buildAnalogSampleAtOffsetProvider(DataManager & dm, std::string const & source_key, std::vector< TimeFrameIndex > const & row_times, int64_t offset)
Build a ColumnProviderFn that samples an AnalogTimeSeries at each row timestamp plus a fixed offset.
ColumnProviderFn buildPipelineColumnProvider(DataManager & dm, std::string const & source_key, std::vector< TimeFrameIndex > const & row_times, Neuralyzer::Transforms::V2::TransformPipeline pipeline)
Build a generic ColumnProviderFn for timestamp-row tensors from any source type.
ColumnProviderFn buildIntervalPipelineProvider(DataManager & dm, std::string const & source_key, std::shared_ptr< DigitalIntervalSeries const > intervals, Neuralyzer::Transforms::V2::TransformPipeline pipeline)
Build a generic ColumnProviderFn for interval-row tensors from any source type.
ColumnProviderFn buildIntervalPipelineProvider(DataManager & dm, std::string const & source_key, std::shared_ptr< DigitalIntervalSeries const > intervals, Neuralyzer::Transforms::V2::TransformPipeline pipeline, std::vector< Neuralyzer::Transforms::V2::PipelineValueStore > row_stores)
Build an interval-row provider with one PipelineValueStore per row.
ColumnProviderFn buildProviderFromRecipe(DataManager & dm, ColumnRecipe const & recipe, std::vector< TimeFrameIndex > const & row_times, std::shared_ptr< DigitalIntervalSeries const > const & intervals)
Build a ColumnProviderFn from a ColumnRecipe.
InvalidationWiringFn buildInvalidationWiringFn(DataManager & dm, std::vector< std::string > const & source_keys)
Build an InvalidationWiringFn that registers DataManager observers to invalidate tensor columns when source data changes.

Types Documentation

enum IntervalProperty

Enumerator Value Description
Start Returns the start time of the interval.
End Returns the end time of the interval.
Duration Returns the duration (end − start) of the interval.

Property to extract from row intervals.

Used by buildIntervalPropertyProvider() to determine which scalar is produced for each interval row.

Functions Documentation

function buildIntervalPropertyProvider

ColumnProviderFn buildIntervalPropertyProvider(
    std::shared_ptr< DigitalIntervalSeries const > intervals,
    IntervalProperty property
)

Build a ColumnProviderFn that extracts a property (start, end, or duration) from the row intervals.

Parameters:

  • intervals Row intervals
  • property Which property to extract

Return: ColumnProviderFn producing one float per interval

This does NOT consult any DataManager source — the values come entirely from the interval endpoints.

function buildAnalogSampleAtOffsetProvider

ColumnProviderFn buildAnalogSampleAtOffsetProvider(
    DataManager & dm,
    std::string const & source_key,
    std::vector< TimeFrameIndex > const & row_times,
    int64_t offset
)

Build a ColumnProviderFn that samples an AnalogTimeSeries at each row timestamp plus a fixed offset.

Parameters:

Exceptions:

Return: ColumnProviderFn producing one float per row

For each row i the provider reads source.getAtTime(row_times[i] + offset). Returns NaN for any sample that falls outside the source range.

This replaces the old AnalogTimestampOffsetsMultiComputer — each offset produces one call to this function, yielding one column.

function buildPipelineColumnProvider

ColumnProviderFn buildPipelineColumnProvider(
    DataManager & dm,
    std::string const & source_key,
    std::vector< TimeFrameIndex > const & row_times,
    Neuralyzer::Transforms::V2::TransformPipeline pipeline
)

Build a generic ColumnProviderFn for timestamp-row tensors from any source type.

Parameters:

Exceptions:

  • std::runtime_error if the pipeline does not produce float output, has a terminal range reduction, or the source is unavailable

See: buildIntervalPipelineProvider() for interval-row tensors with reductions

Return: ColumnProviderFn producing one float per row

Works with any DataManager source type (AnalogTimeSeries, MaskData, LineData, PointData, etc.) as long as the pipeline transforms the source into float output (AnalogTimeSeries or RaggedAnalogTimeSeries).

Empty pipeline (passthrough): The source must already be a float type (AnalogTimeSeries or RaggedAnalogTimeSeries). Samples the source directly at each row timestamp.

Non-empty pipeline: Calls executePipeline() on the full source DataTypeVariant, then samples the resulting AnalogTimeSeries or RaggedAnalogTimeSeries at each row timestamp.

Terminal range reductions are rejected — they collapse the entire series to a single scalar, which is not meaningful for timestamp-row columns. For interval-row columns that need range reductions, use buildIntervalPipelineProvider() instead.

Validation is performed at build time via pipelineProducesFloat().

function buildIntervalPipelineProvider

ColumnProviderFn buildIntervalPipelineProvider(
    DataManager & dm,
    std::string const & source_key,
    std::shared_ptr< DigitalIntervalSeries const > intervals,
    Neuralyzer::Transforms::V2::TransformPipeline pipeline
)

Build a generic ColumnProviderFn for interval-row tensors from any source type.

Parameters:

Exceptions:

  • std::runtime_error if the pipeline does not produce float output, lacks a range reduction, or the source is unavailable

See: buildPipelineColumnProvider() for timestamp-row tensors without reductions

Return: ColumnProviderFn producing one float per interval

Note: RaggedAnalogTimeSeries sources are not supported (no GatherResult specialisation exists). Passing one will throw at materialization time.

Works with any DataManager source type that satisfies HasDataTraits (AnalogTimeSeries, MaskData, LineData, PointData, DigitalEventSeries, DigitalIntervalSeries) by delegating to gatherAndExecutePipeline().

For each interval row, the function:

  1. Gathers a view/copy of the source data within the interval boundaries
  2. Executes the pipeline on that gathered view
  3. Extracts a single float from the pipeline output via extractSingleFloat()

The pipeline must contain a range reduction that collapses each gathered view to a single scalar. Pipelines without a range reduction are rejected at build time.

Validation is performed at build time via pipelineProducesFloat().

function buildIntervalPipelineProvider

ColumnProviderFn buildIntervalPipelineProvider(
    DataManager & dm,
    std::string const & source_key,
    std::shared_ptr< DigitalIntervalSeries const > intervals,
    Neuralyzer::Transforms::V2::TransformPipeline pipeline,
    std::vector< Neuralyzer::Transforms::V2::PipelineValueStore > row_stores
)

Build an interval-row provider with one PipelineValueStore per row.

function buildProviderFromRecipe

ColumnProviderFn buildProviderFromRecipe(
    DataManager & dm,
    ColumnRecipe const & recipe,
    std::vector< TimeFrameIndex > const & row_times,
    std::shared_ptr< DigitalIntervalSeries const > const & intervals
)

Build a ColumnProviderFn from a ColumnRecipe.

Parameters:

  • dm DataManager that owns source data
  • recipe Column specification
  • row_times Row timestamps (for timestamp-row tensors; empty for interval-row)
  • intervals Row intervals (for interval-row tensors; nullptr for timestamp-row)

Return: ColumnProviderFn

This is the main entry point for building providers from serialized configurations. It dispatches to the appropriate builder based on the recipe’s fields.

function buildInvalidationWiringFn

InvalidationWiringFn buildInvalidationWiringFn(
    DataManager & dm,
    std::vector< std::string > const & source_keys
)

Build an InvalidationWiringFn that registers DataManager observers to invalidate tensor columns when source data changes.

Parameters:

  • dm DataManager that owns source data
  • source_keys Ordered list of DataManager keys, one per column. Empty strings mean “no source dependency” (e.g. interval property columns) and will be skipped.

Return: InvalidationWiringFn suitable for TensorData::createFromLazyColumns()

For each (column_index, source_key) pair, the wiring function registers an observer on the source data. When the source notifies, the wiring callback invalidates the corresponding column and notifies the tensor’s own observers.


Updated on 2026-11-13 at 20:25:41 +0000