CreateSelectionInterval¶
Define a selection interval (slice) that can be used to select items from a collection, e.g
., using SelectRange. Slices consist of a start index, a stop index, and a step size, and the end value is by convention not included in the range unless the inclusive option is set to True. The default slice (with none of the values overridden) selects all data. Note that, when the endpoints are data values along a real-valued domain (i.e., when they represent "coordinate" values along a continuous axis such as time or frequency), it is necessary to specify the domain explicitly as 'float' for the inclusive option to work as expected correctly. Both the start and end value are optional, and if not given, range from/to the respective end of the data. When specifying integer-valued slices, note that slices use 0-based indexing, and negative integers count from the end of the collection that they are used with, where -1 is the last element, -2 the second-to-last etc. Also, negative steps run in reverse. Alterantively, one may also provide a start index and a length (leaving the other parameters at their default); then, stop is derived as start+length and the inclusive option does not apply. Note that, for real-valued endpoints, negative values do NOT count from the "end" of the range; these are merely treated as negative values along the domain. Version 1.0.1
Ports/Properties¶
selection¶
Selection range.
- verbose name: Selection
- default value: None
- port type: DataPort
- value type: slice (can be None)
- data direction: OUT
start¶
Start value of the range. If this is not specified, the selection will start from the beginning of the data (first item of a collection or array).
- verbose name: Start
- default value: None
- port type: Port
- value type: object (can be None)
stop¶
End value of the range. Not included in the range unless the inclusive option is set to True. If this is not specified, the selection will run up to and include the last item in the data. This should also be omitted if start and length are given, in which case the range is already fully determined.
- verbose name: Stop
- default value: None
- port type: Port
- value type: object (can be None)
step¶
Step size of the range, in terms of generated indices. If not given, the interval will cover all elements from start to stop (setting this to 1 will achieve the same in most cases, although passing an integer is not guaranteed to trigger exactly the same code behind the scenes, depending on the data structure that is being indexed, and not all data structure may support an integer here). If set to a negative value, the range runs in reverse, and if set to, e.g., 2, will yield every other element. Note that the range will NOT automatically count in reverse if start is greater than stop, but instead the range will then be empty.
- verbose name: Step
- default value: None
- port type: IntPort
- value type: int (can be None)
length¶
Alternative way to specify the range in terms of the number of elements to retain and the start index. Note that the current implementation does not support stop and length being specified at the same time.
- verbose name: Length
- default value: None
- port type: IntPort
- value type: int (can be None)
inclusive¶
Whether the stop value is inclusive or exclusive. The start value is always inclusive. Remember to set the domain to a value other than unspecified to avoid warnings.
- verbose name: Stop Included In Range
- default value: False
- port type: BoolPort
- value type: bool (can be None)
domain¶
The domain of the interval endpoints. This is necessary for the inclusive option to work correctly.
- verbose name: Endpoint Domain
- default value: unspecified
- port type: EnumPort
- value type: str (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)