Skip to content

← formatting package

AxisToStream

Promote one or more axes in a packet to their own stream(s).

For any matching axis in the given packet, this will create a new stream whose block receives the numeric data of the axis (e.g., the TargetValue and other fields in case of an instance axis). The block will be indexed by a feature axis that names these fields as one dimension, and a copy of the promoted axis along the other dimension, for a total of two dimensions. This alternative representation is useful for general-purpose processing of axis data, such as using elementwise operations or applying filters. The operation is subject to the following caveats: 1) string-valued axis arrays are not representable in the data array and will not be included in the new stream; 2) axis arrays that were themselves multi-dimensional (e.g., the positions array of the space axis) will be flattened and named as in 'positions[0]', 'positions[1]', and so forth in the feature axis. 3) in case of the instance axis, the features are named after the fields in the .data array of the axis (e.g., 'TargetValue', 'IsGood', etc.) and no feature named 'data' will be generated; however, a 'times' feature and any other user-defined axis arrays will still be included in the feature axis. It is also possible to clear the original axes to their default (blank) contents to eliminate this redundancy. This is mostly useful when the axis data is meant to be processed in a GPU-accelerated context, such as the DeepModel, ConvexModel, or Inference nodes, where differences in axis data from one run to another can cause slowdowns due to spurious recompilations of the graph codel typically these nodes will invoke this node as a pre-processing step, but this can be disabled if the user wishes to have manual control over this process. The node also returns a 'recovery' output that can be used to reconstitute the original axes after having processed the streams. The internal makeup of this data structure is considered an implementation detail and should not be relied upon for any purpose other than to pass it back to the Stream To Axis node. Version 0.9.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
AnyNumeric (can be None)
data direction
INOUT

recovery

Recovery information.

verbose name
Recovery
default value
None
port type
DataPort
value type
object (can be None)
data direction
OUT

axis

Axis to promote to a stream. If there are multiple axes of the same type in the data, you can specify the axis label (which can be set with SetAxisLabel node), using the following syntax: axis.label (i.e., space.mylabel).

verbose name
Axis To Promote
default value
instance
port type
ComboPort
value type
str (can be None)

source_stream

If given, apply to streams whose name starts with this prefix.

verbose name
Source Stream Starting With
default value
None
port type
StringPort
value type
str (can be None)

nonempty

If True, only process non-empty streams. Note that this can still mean that the axis in question in such a stream is non-empty, but the data array can be empty due to another axis having zero length.

verbose name
Nonempty
default value
True
port type
BoolPort
value type
bool (can be None)

only_features

Optionally a list of features to which to restrict the output. An example for the instance axis is ['TargetValue', 'Weight', 'times']. For the space axis, this may be ['positions', 'positions_source']. If a feature is listed here that is string-typed or not present, it will be ignored.

verbose name
Only Features
default value
[]
port type
ListPort
value type
list (can be None)

exclude_features

Optionally a list of features to exclude from the output. This is useful when you want to exclude specific features without otherwise restricting the output.

verbose name
Exclude Features
default value
[]
port type
ListPort
value type
list (can be None)

dest_stream

Name of the destination stream(s). If this contains a {streamname} and/or {axisname} placeholder, these will be replaced by the original stream name (e.g., 'eeg') and/or the name of the axis (e.g., instance), respectively, i.e., of the form 'eeg-instance'. If multiple axes map onto the same name (e.g., if the name has no placeholders and there are multiple matching source streams), then the affected axes must all be equal (an error is raised otherwise).

verbose name
Dest Stream
default value
{streamname}-{axisname}
port type
StringPort
value type
str (can be None)

clear_axes

If True, clear the original axes to their default (blank) contents. Note that the axes themselves persist, but their array data will be null values.

verbose name
Clear Axes
default value
False
port type
BoolPort
value type
bool (can be None)

verbose

If True, print verbose output.

verbose name
Verbose
default value
True
port type
BoolPort
value type
bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)