Skip to content

← utilities package

ReplaceAxisValues

Replace the values in an array of an axis (i.e

., channel names in a space axis) using search and replace with either a literal pattern (string or number) or a regular expression pattern. For example, to rename channels in the space axis with the format EEG Xx-LE to Xx, use (EEG )(.*[^-LE])(.*) as the pattern and (\2) as the substitution, with "regex" as the pattern_type. (For a regular expression cheatsheet and to easily test regular expressions, see https://pythex.org.). Version 1.2.1

Ports/Properties

data

Data to process

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

axis

Axis to modify.

  • verbose name: Axis
  • default value: space
  • port type: ComboPort
  • value type: str (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).

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

array

The name of the axis array containing the elements to search and replace. For example, on the Space or Feature axis this is typically the names array, which holds the channel names on the Space axis and feature names in a Feature axis.

  • verbose name: Axis Array To Modify
  • default value: names
  • port type: StringPort
  • value type: str (can be None)

array_key

array_key has been renamed to array

  • verbose name: Array Key
  • default value: None
  • port type: AliasPort
  • value type: str (can be None)

pattern

A literal pattern or regular expression to search for in the axis array elements. Example (regex): (EEG )(.*[^-LE])(.*). If the pattern_type is set to numbers, the pattern should be a number. If wishing to replace numbers in string values, choose literal or regex as the pattern_type.

  • verbose name: Search Expression
  • default value:
  • port type: Port
  • value type: object (can be None)

search_expr

search_expr has been renamed to pattern

  • verbose name: Search Expr
  • default value: None
  • port type: AliasPort
  • value type: object (can be None)

substitution

A literal pattern or regular expression of the element to replace with. When using regex, to specify groups, use \n where n is the group number. Example: \2 with the above search expression would replace each element with the second matched group.

  • verbose name: Replacement Expression
  • default value:
  • port type: Port
  • value type: object (can be None)

replace_expr

replace_expr has been renamed to substitution

  • verbose name: Replace Expr
  • default value: None
  • port type: AliasPort
  • value type: object (can be None)

pattern_type

Type of pattern search for. Literal means that each literal occurrence of the pattern will be substituted by the substitution string. Regex means that the pattern is interpreted as a regular expression. If the array contains numbers instead of strings, use numbers as the pattern type.

  • verbose name: Pattern Type
  • default value: regex
  • port type: EnumPort
  • value type: str (can be None)

streams

A list of stream names, for the streams containing axis array elements to replace. Leave empty to replace values in all streams. Note: This parameter is deprecated. To operate on only a subset of streams, please use the ExtractStreams node first.

  • verbose name: Streams To Act On
  • default value: []
  • port type: ListPort
  • value type: list (can be None)

verbose

Output a log entry with the results of the change.

  • verbose name: Verbose
  • default value: False
  • 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)