Skip to content

← elementwise_math package

OperateElementwise

Apply an operation to the data, where the data block of the first and second inputs are operands.

The selected operator will be between the first and second input operands, i.e., data1 * data2. The operation is performed elementwise (each element of the first input is multiplied/divided/added/subtracted by the matching element of the second input). Note that the shape of the data arrays must be the same for both data inputs. If the packets contain multiple streams and restrict_to_same_stream_name is true, the operation will be performed on each pair of streams having the same name. Event streams and empty streams are ignored. This node absorbs the functionality of the Add, Subtract, Multiply, Divide nodes. Version 0.9.0

Ports/Properties

data1

Input data 1.

  • verbose name: Data1
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: IN

data2

Input data 2.

  • verbose name: Data2
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: IN

outdata

Data to process.

  • verbose name: Outdata
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

operator

The operator to be performed on data1 and data2 operands, in the following order: data1 data2.

  • verbose name: Operator
  • default value: add
  • port type: EnumPort
  • value type: str (can be None)

restrict_to_same_stream_name

If True, this node will only operate on a stream in data1 if it finds a stream with the same name in data2. If set to False, the first signal stream in data1 will be operated on together with the first signal stream in data2. If False and the first input has multiple signal streams, a warning will be displayed and the operation will be ignored.

  • verbose name: Restrict To Same Stream Name
  • 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)