Skip to content

← tensor_math package

SetAxisValues

Set values for the fields of an axis.

For example, set channel names on a space axis, timestamps on a time axis, feature names on a feature axis, frequencies on a frequency axis. The number of new values must equal the current number of values in the axis (the length of the axis). This node does not shrink or expand the axis to match the number of values. If the axis is an instance axis, array will by default assumed to be a field in the instance.data array rather than its own array in the instance axis. For example, this can be used to set the Marker or TargetValue values for instances (trials), much like the SetInstanceDetails node. If instance_data_field is set to False, then array is assumed to be an array of the instance axis. (This behavior is unique to the instance axis, and the instance_data_field default will be set to False in a future release.) Version 2.0.0

Ports/Properties

data

Data to process.

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

stream

Name of stream containing the axis to operate on. If empty, the operation will be performed on all streams which contain the specified axis. Note that this does not require an exact match. Any stream with a name beginning with the value specified here will be matched.

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

axis

The Axis to modify, by its type. You can more precisely specify the axis to modify, i.e., if the packet might contain multiple axes of the same type, by including the the axis' custom_label using the following format: axis.mylabel. Otherwise, the first axis of the given type will be modified.

verbose name
Axis
default value
feature
port type
ComboPort
value type
str (can be None)

array

The array (field) on the axis that will be set or updated. If unspecified, the default array for the specified axis will be used. This is times for a time axis, frequencies for a frequency axis, names for a space axis or feature axis.

verbose name
Array
default value
None
port type
StringPort
value type
str (can be None)

array_name

verbose name
Array Name
default value
None
port type
AliasPort
value type
str (can be None)

values

New values for the axis array. If a constant, this will be repeated for every element presently in the axis. If a list (can be a list of lists) then it must be the same length as the axis. Note that the axis must continue to match the existing shape of the data tensor (the data tensor is not automatically expanded or contracted to match a new number of elements along an axis).

verbose name
Values
default value
None
port type
Port
value type
object (can be None)

axis_occurrence

Index of the occurrence of the axis of desired type. (0 is the first axis of the desired type, 1 is the second, -1 is the last, -2 is the second-to-last, and so on). This is no longer recommended; instead specify the axis label (which can be set with SetAxisLabel if not already existing, in the axis property (i.e., time.my_label).

verbose name
Axis Occurrence
default value
0
port type
IntPort
value type
int (can be None)

handle_existing

How to handle existing values in the axis array. You may either replace all existing values with the new values, or set a value only for those elements which are missing a value (have an empty string or a NaN), skip the axis altogether if the array contains any non-empty values (values other than an empty string or NaN), or raise an error if the array contains any values (other than an empty string or NaN).

verbose name
Handle Existing Values
default value
replace-all
port type
EnumPort
value type
str (can be None)

infer_dummy_values

If set to true, and values is None or empty, the node will attempt to replace the selected target axis array with a set of empty dummy values.

verbose name
Infer Dummy Values
default value
False
port type
BoolPort
value type
bool (can be None)

only_signals

If set to true, non-signal streams (i.e ., marker streams) will be ignored.

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

instance_data_field

If True and updating an instance axis, the array_name will be assumed to be a field in the instance.d ata array rather than its own array in the instance axis. This is unique to the instance axis and included for backward compatibility purposes. This default will be changed to False in the future.

verbose name
Instance Data Field
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)