Skip to content

← tensor_math package

AddAxisArray

Create (add) a new array (field) to an existing axis.

This allows you to add custom arrays, which which can act as properties for axis elements (for example, the .names array of the space axis holds the name for each channel of signal data; you might need to create another space axis array to hold a property that can be specified for each channel.) The new array will be the same length as the other existing axis arrays (all of which must be the same length), and be initialized with dummy values (empty strings or zeros, or monotonically increasing numbers if monotonic is True). Use SetAxisValues after this node to populate the array. The instance axis is a special case as it contains a .data array which itself can hold fields for each instance. When adding an array to an instance axis, this node will add a field to the .data array of the instance axis, rather than create a separate array, unless instance_data_field is set to False. (Instances can be selected by .data fields using the SelectInstances node.) Version 0.9.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

array

The name of the array (field) on the axis that will be created.

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

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. Wildcards are not supported.

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)

type

The type of items that the array can hold (strings, numbers, etc.) . Data will be restricted to this type. Use object for an array that may hold values of different types.

verbose name
Type
default value
str
port type
EnumPort
value type
str (can be None)

monotonic

If True, the array can only contain monotonically increasing values. This does not apply if the dtype is of str or object type.

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

categorical

If True, the array is assumed to be categorical. This only applies to instance axis arrays.

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

indexable

If True, the array can be indexed, allowing it to be used in the SelectRange node by specifying the array name as the "unit".

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

error_handling

How to handle errors when adding the array. If 'warn', a warning will be issued and the operation will continue. If 'ignore', the operation will continue without issuing a warning. If 'raise', an error will be raised and the operation will be aborted.

verbose name
Error Handling
default value
warn
port type
EnumPort
value type
str (can be None)

instance_data_field

If True, the array will be added to the .d ata array of the instance axis, instead of creating a separate array for 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)