Neuralyzer::TensorDesign
Neuralyzer::TensorDesign
Classes
Types
| Name | |
|---|---|
| enum class std::uint8_t | DesignPresetSource { BuiltIn, User} |
| enum class std::uint8_t | ColumnRecipePresetSource { BuiltIn, User} |
| enum class std::uint8_t | EffectiveRowType { Unchanged, Interval, Timestamp} |
| enum class std::uint8_t | ColumnOutputKind { ScalarFloat, GatheredDataObject} |
| enum class std::uint8_t | GatheredOutputType { Unspecified, DigitalEventSeries} |
| enum class std::uint8_t | RowType { None, Interval, Timestamp, Ordinal, DerivedFromSource, TimeFrame} Row source type for a tensor design specification. |
| enum class | IntervalProperty { } Property to extract from row intervals. |
Functions
| Name | |
|---|---|
| ColumnRecipePresetRegistry | createBuiltInColumnRecipePresetRegistry() |
| std::optional< ColumnRecipePresetArgs > | parseColumnRecipePresetArgs(nlohmann::json const & parameters) |
| RowModifierRegistry | createBuiltInRowModifierRegistry() |
| ColumnAggregatorRegistry | createBuiltInColumnAggregatorRegistry() |
| DesignPresetRegistry | createBuiltInDesignPresetRegistry() |
| std::optional< DesignPresetArgs > | parseDesignPresetArgs(nlohmann::json const & parameters) |
| std::size_t | createTensorColumnViews(DataManager & dm, std::string const & tensor_key, std::string const & prefix, std::vector< int > const & columns) Create AnalogTimeSeries column views from a TensorData in DataManager. |
| std::vector< AnalogKeyGroup > | discoverAnalogKeyGroups(DataManager & dm) Discover groups of AnalogTimeSeries keys sharing a common prefix. |
| bool | populateTensorFromAnalogKeys(DataManager & dm, std::string const & tensor_key, std::vector< std::string > const & analog_keys) Populate an existing TensorData from AnalogTimeSeries channels. |
| std::optional< TensorDesignSpec > | parseDesignJson(std::string const & json) Parse a TensorDesigner-compatible JSON envelope into a design spec. |
| std::string | serializeDesignJson(TensorDesignSpec const & spec) Serialize a design spec to a TensorDesigner-compatible JSON envelope. |
| std::optional< TensorData > | buildTensor(DataManager & dm, TensorDesignSpec const & spec) Build a lazy TensorData from a design spec without registering it. |
| std::optional< TensorData > | buildTensorFromDesignJson(DataManager & dm, std::string const & json) Parse JSON and build a lazy TensorData. |
| std::optional< TimeKey > | resolveOutputTimeKey(DataManager & dm, TensorDesignSpec const & spec) Resolve the TimeKey under which a designed tensor should be registered. |
| bool | populateDataManager(DataManager & dm, TensorDesignSpec const & spec) Build a tensor from a design spec and register it in DataManager. |
| 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. |
| 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. |
| 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. |
Types Documentation
enum DesignPresetSource
| Enumerator | Value | Description |
|---|---|---|
| BuiltIn | ||
| User |
enum ColumnRecipePresetSource
| Enumerator | Value | Description |
|---|---|---|
| BuiltIn | ||
| User |
enum EffectiveRowType
| Enumerator | Value | Description |
|---|---|---|
| Unchanged | ||
| Interval | ||
| Timestamp |
enum ColumnOutputKind
| Enumerator | Value | Description |
|---|---|---|
| ScalarFloat | ||
| GatheredDataObject |
enum GatheredOutputType
| Enumerator | Value | Description |
|---|---|---|
| Unspecified | ||
| DigitalEventSeries |
enum RowType
| Enumerator | Value | Description |
|---|---|---|
| None | ||
| Interval | ||
| Timestamp | ||
| Ordinal | ||
| DerivedFromSource | ||
| TimeFrame |
Row source type for a tensor design specification.
enum IntervalProperty
| Enumerator | Value | Description |
|---|
Property to extract from row intervals.
Used by buildIntervalPropertyProvider() to determine which scalar is produced for each interval row.
Functions Documentation
function createBuiltInColumnRecipePresetRegistry
ColumnRecipePresetRegistry createBuiltInColumnRecipePresetRegistry()function parseColumnRecipePresetArgs
std::optional< ColumnRecipePresetArgs > parseColumnRecipePresetArgs(
nlohmann::json const & parameters
)function createBuiltInRowModifierRegistry
RowModifierRegistry createBuiltInRowModifierRegistry()function createBuiltInColumnAggregatorRegistry
ColumnAggregatorRegistry createBuiltInColumnAggregatorRegistry()function createBuiltInDesignPresetRegistry
DesignPresetRegistry createBuiltInDesignPresetRegistry()function parseDesignPresetArgs
std::optional< DesignPresetArgs > parseDesignPresetArgs(
nlohmann::json const & parameters
)function createTensorColumnViews
std::size_t createTensorColumnViews(
DataManager & dm,
std::string const & tensor_key,
std::string const & prefix,
std::vector< int > const & columns
)Create AnalogTimeSeries column views from a TensorData in DataManager.
Parameters:
- dm DataManager containing the tensor
- tensor_key DataManager key of the source TensorData
- prefix Prefix for generated AnalogTimeSeries keys
- columns 0-based column indices to extract (empty = all columns)
Return: Number of views successfully created
Precondition:
- dm must contain a TensorData at
tensor_key - The TensorData must be 2D
- All column indices must be in [0, numColumns())
For each selected column (or all columns if columns is empty), creates a zero-copy AnalogTimeSeries view backed by TensorColumnAnalogStorage and inserts it into the DataManager under “{prefix}/{column_name}”.
function discoverAnalogKeyGroups
std::vector< AnalogKeyGroup > discoverAnalogKeyGroups(
DataManager & dm
)Discover groups of AnalogTimeSeries keys sharing a common prefix.
Parameters:
- dm DataManager to scan for AnalogTimeSeries keys
Return: Vector of key groups, sorted by prefix
Scans all AnalogTimeSeries keys in the DataManager, extracts the prefix before the last ’_’ character, and groups keys by that prefix. Only groups with 2 or more keys are returned.
function populateTensorFromAnalogKeys
bool populateTensorFromAnalogKeys(
DataManager & dm,
std::string const & tensor_key,
std::vector< std::string > const & analog_keys
)Populate an existing TensorData from AnalogTimeSeries channels.
Parameters:
- dm DataManager containing the tensor and analog data
- tensor_key Key of the TensorData to populate
- analog_keys Ordered list of AnalogTimeSeries keys to pack as columns
Return: true if the tensor was successfully populated
Precondition:
- dm must contain a TensorData at
tensor_key - All analog_keys must exist and contain AnalogTimeSeries
- All channels must share the same TimeFrame and sample count
Gathers the specified AnalogTimeSeries channels, packs them into a 2D TensorData via analogToTensor(), and replaces the data at tensor_key. The TimeKey is inherited from the first analog channel.
function parseDesignJson
std::optional< TensorDesignSpec > parseDesignJson(
std::string const & json
)Parse a TensorDesigner-compatible JSON envelope into a design spec.
Parameters:
- json JSON string with row_source and columns fields
Return: Parsed spec, or nullopt if parsing fails
function serializeDesignJson
std::string serializeDesignJson(
TensorDesignSpec const & spec
)Serialize a design spec to a TensorDesigner-compatible JSON envelope.
Parameters:
- spec Design specification to serialize
Return: JSON string (pretty-printed with 2-space indent)
function buildTensor
std::optional< TensorData > buildTensor(
DataManager & dm,
TensorDesignSpec const & spec
)Build a lazy TensorData from a design spec without registering it.
Parameters:
- dm DataManager containing row source and column source data
- spec Design specification
Return: Built tensor, or nullopt on failure
Precondition:
- spec.row_type must not be None or Ordinal
- spec.columns must not be empty
function buildTensorFromDesignJson
std::optional< TensorData > buildTensorFromDesignJson(
DataManager & dm,
std::string const & json
)Parse JSON and build a lazy TensorData.
Parameters:
- dm DataManager containing source data
- json TensorDesigner-compatible JSON envelope
Return: Built tensor, or nullopt on failure
function resolveOutputTimeKey
std::optional< TimeKey > resolveOutputTimeKey(
DataManager & dm,
TensorDesignSpec const & spec
)Resolve the TimeKey under which a designed tensor should be registered.
Parameters:
- dm DataManager containing row source and timeframe registrations
- spec Design specification
Return: Resolved TimeKey, or nullopt when no valid timeframe exists
Uses an explicit non-default spec.output_time_key when present and valid, otherwise the row source’s TimeKey, then "time" or "default" if registered.
function populateDataManager
bool populateDataManager(
DataManager & dm,
TensorDesignSpec const & spec
)Build a tensor from a design spec and register it in DataManager.
Parameters:
- dm DataManager to populate
- spec Design specification (tensor_key required)
Return: true if the tensor was built and registered
Precondition: spec.tensor_key must not be empty
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 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.
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.
Updated on 2026-11-13 at 20:25:41 +0000