Package: programming¶
Traditional programming constructs.
These nodes implement operations for handling the essential data structure types in programming languages, and are useful to provide the functional "glue" in a more complex processing workflow. The essential data types implemented here are strings, lists, and dictionaries (key-value mappings), but a library of other standard operations is provided as well. The data types correspond to the standard Python types. Node classes are: - nodes starting with Cast: type conversions; the most generic one is CastToType, and the others may implement specific additional rules - nodes starting with Constant: defines constants of the respective type - nodes starting with Create: constructs the respective data structure - nodes starting with Get: retrieves a specific value from the data structure (of these, GetNested is the most flexible) - nodes starting with Dict: manipulates dictionaries (key-value mappings) - nodes starting with List: manipulates lists - nodes starting with String: manipulates strings (text) - nodes starting with Set: set operations - nodes ending in Iterator: commonly used nodes to construct data iteration schemes (iterators) Note also this category has the equivalents to logical operators such as And, Or, Not, and Xor that act at the level of whole objects, as opposed the elementwise operations and the canonical Print function, Parameter ports for declaring pipeline parameters, as well as the Contains, Hash, IsOfType, and Equal operations.
Nodes in this package:
-
And (All)
Logical AND operation. -
Bind Arguments
Bind arguments to positional or named parameters in the given function or graph. -
Break Structure / Dict
Break up a structure/dictionary into its items based on their name. -
By Reference
Pass a given value by reference into the next node. -
Cast Packet To Float
Cast the given input packet to a float (floating-point number). -
Cast Packet To Int
Cast the given input packet to an int (integer number). -
Cast Packet To List
Cast the given input packet to a list of floats. -
Cast Packet To String
Cast the given input marker stream packet to a string. -
Cast To Graph
Cast an object of unknown type to type graph, or otherwise pass out None if the object was not a graph. -
Cast To Type
Cast the input value to a certain type. -
Chain Iterator
An iterator that emits first all elements of the first iterable, then all elements from the second iterable, and so forth, until the last iterable is exhausted. -
Collect Parameters
Iterates over the ParameterPorts in the graph and collects the values. -
Condition Switch (Forward Dispatch)
Control the flow of execution (acting as a dispatcher) based on matching conditions. -
Condition Test
Basic condition test node. -
Constant Array
Create an array that can be wired into another node. -
Constant Boolean
Declare a boolean constant. -
Constant Complex Number
Declare a complex-valied constant. -
Constant Float
Declare a floating-point constant. -
Constant Graph
Declare a constant graph. -
Constant Integer
Declare an integer constant. -
Constant List
Create a list that can be wired into another node. -
Constant String
Declare a string constant. -
Constant Value
Declare a constant of any type. -
Contains Item
Check if the given object contains a specified item or, depending on context, field. -
Copy Object
Make a shallow or deep copy of an object. -
Create Dictionary
Create a dictionary (a lookup table from names to items) from a list of names and values. -
Create List
Create a list from the given input values. -
Create Selection Interval (Slice)
Define a selection interval (slice) that can be used to select items from a collection, e.g -
New Structure
Create a data structure (dictionary) from a list of names and values and filter out missing values (indicated by None). -
Dictionary Iterator
Iterate over a key/value pairs in a dictionary. -
Get Keys (Dict)
Get the keys of a dictionary as a list. -
Merge (Dict)
Merge one or more dictionaries, optionally allowing keys to be overridden by later dictionaries. -
Remove Item (Dict)
Get a dictionary with a specific item removed. -
Split (Dict / Structure)
Break up a structure/dictionary into its items (key-value pairs) based on key names. -
Update (Dict)
Get a new dictionary in which specific name/value pairs have been overridden. -
Get Values (Dict)
Get the values of a dictionary as a list. -
Enumerate Iterator
An iterator that yields 2-element lists made up of an index and the next item from a source iterable. -
Equal
Test whether two input objects are equal. -
Get Field
Access a field with a specific name on an object. -
Get Item
Get the item with the specific key or index. -
Get Nested
Access a nested field or item of a specified object, which is identified by a path, analogous to a file path (or a chain of ".f -
Groupwise Iterator
An iterator that emits lists of items grouped according to an optional grouping key. -
Hash
Compute a hash of a given piece of data. -
Is Of Type
Test whether the given object is of a specific type. -
Append Item (List)
Append an item to a list. -
Count Occurrences (List)
Count the number of occurrences of an item in a list. -
Find (List)
Find the first (or last) index at which a specific item is found. -
First (List)
Get the first item in a list. -
Flatten (List)
Flatten an arbitrarily nested list into a simple list. -
Insert Item (List)
Insert an item before a specific indexed item in a list. -
List Iterator
Iterate over a list of objects. -
Last (List)
Get the last item in a list. -
Prepend Item (List)
Prepend an item to a list. -
Remove Item (List)
Get a list with a specific item removed. -
Rest (List)
Get the remainder of a list excluding the first item. -
Sort (List)
Sort the given list, optionally with a function that extracts a comparison key from a given list element (e.g -
Split (List)
Destructure a list into multiple items. -
Unique Items (List)
Reduce list to its unique items. -
N-Way Passthrough
Pass the input data through to the output. -
Not
Logical Not operation. -
Number of Elements
Get the number of elements in the given object. -
Or (Any)
Logical OR operation. -
Packet Iterator
Iterate over the chunks and their names in a Packet. -
Parameter Port
Define an parameter for a pipeline that is exposed and can be easily set over the NeuroPype API. -
Passthrough
Pass the input data through to the output if the enabled property is set. -
Print
Print the given data. -
Range Iterator
Iterate over a range of integers between start, and optionally stop, with a specified step size. -
Read Environment Variable
Reads in an environment variable from the system. -
Set Difference
Calculate the difference of two sets A and B. -
Set Intersection
Calculate the intersection of two or more sets. -
Set Membership (Elementwise)
Evaluate for each element of an array A whether it is in the given set S. -
Set Nested
Set a nested field or item of a specified object, which is identified by a path, analogous to a file path (or a chain of ".f -
Set Union
Calculate the union of two or more sets. -
Set Symmetric Difference / Xor
Calculate the symmetric difference (xor) of two or more sets. -
Check (String)
Check if the given string is of a specified type. -
Lexicographic Comparison (String)
Determine the ordering of the first string relative to the second string. -
Concatenate (String)
Concatenate the given values into one output string, optionally with a separator string. -
Ends With Suffix (String)
Check if the given string ends with the provided suffix. -
Find (String)
Find the (zero-based) start index of a substring in a string. -
Format (String)
Format a string with placeholders. -
String Iterator
Iterate over a characters of a string. -
Lowercase (String)
Convert string to lower case. -
Parse (String)
Parse a string using a pattern with placeholders in it. -
Repeat (String)
Repeat the given string n times. -
Replace (String)
Replace a pattern in a string by a subtitution string. -
Split (String)
Split a string into a list of strings based on a separator character or string. -
Split Lines (String)
Split a string into a list of strings at line boundaries. -
Starts With Prefix (String)
Check if the given string starts with the provided prefix. -
Substitute (String)
Replace multiple placeholders in a string using a dictionary mapping. -
Trim Characters (String)
Trim whitespace or other characters from one or both ends of a string. -
Uppercase (String)
Convert string to upper case. -
Subrange Iterator
An iterator that emits only a subrange of another iterable. -
System Information
Queries a property of the ambient runtime system. -
Take Nested
Take a nested field and/or item from specified object and apply it to another object. -
Windowed Iterator
An iterator that emits windows of items from the original iterable. -
Xor (One Only)
Logical XOR (exclusive OR) operation. -
Zip Iterator
An iterator that iterates over two or more source iterators and emits a list of items (one from each source iterator) with each update.