From 2059a300ecf3c401cfb35d0beb045e9a3b3ef947 Mon Sep 17 00:00:00 2001 From: Jin1L Date: Sun, 15 Oct 2023 02:24:26 +0000 Subject: [PATCH 1/2] update: Everything done except COMPOUND_ARITHMETIC --- .../BOOLEAN/a1-[autogen]/docstring.txt | 13 ++++++++ .../CAN_MESSAGE/a1-[autogen]/docstring.txt | 17 ++++++++++ .../PROLOGIX_ADDR/a1-[autogen]/docstring.txt | 16 ++++++++++ .../PROLOGIX_AUTO/a1-[autogen]/docstring.txt | 18 +++++++++++ .../PROLOGIX_HELP/a1-[autogen]/docstring.txt | 16 ++++++++++ .../PROLOGIX_MODE/a1-[autogen]/docstring.txt | 32 +++++++++++++++++++ .../PROLOGIX_VER/a1-[autogen]/docstring.txt | 16 ++++++++++ .../SCPI_WRITE/a1-[autogen]/docstring.txt | 16 ++++++++++ .../OPEN_SERIAL/a1-[autogen]/docstring.json | 17 ++++++++++ .../OPEN_SERIAL/a1-[autogen]/python_code.txt | 12 ++----- .../a1-[autogen]/docstring.json | 16 ++++++++++ .../a1-[autogen]/docstring.json | 31 ++++++++++++++++++ .../AND/a1-[autogen]/docstring.txt | 14 ++++++++ .../a1-[autogen]/docstring.txt | 0 .../EXCLUSIVE_OR/a1-[autogen]/docstring.txt | 14 ++++++++ .../IMPLIES/a1-[autogen]/docstring.txt | 15 +++++++++ .../NOT/a1-[autogen]/docstring.txt | 11 +++++++ .../NOT_AND/a1-[autogen]/docstring.txt | 14 ++++++++ .../NOT_OR/a1-[autogen]/docstring.txt | 14 ++++++++ .../OR/a1-[autogen]/docstring.txt | 14 ++++++++ .../ADD/a1-[autogen]/python_code.txt | 3 +- .../MULTIPLY/a1-[autogen]/python_code.txt | 3 +- .../a1-[autogen]/docstring.txt | 12 +++++++ .../a1-[autogen]/docstring.txt | 11 +++++++ .../TEXT_VIEW/a1-[autogen]/docstring.txt | 9 ++++-- .../TEXT_VIEW/a1-[autogen]/python_code.txt | 19 +++++++++-- nodeSidebar.json | 1 - 27 files changed, 356 insertions(+), 18 deletions(-) create mode 100644 docs/nodes/GENERATORS/SIMULATIONS/BOOLEAN/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json create mode 100644 docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json create mode 100644 docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/AND/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/COMPOUND_ARITHMETIC/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/EXCLUSIVE_OR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/IMPLIES/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_AND/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_OR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/OR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/TYPE_CASTING/BOOLEAN_2_SCALAR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt diff --git a/docs/nodes/GENERATORS/SIMULATIONS/BOOLEAN/a1-[autogen]/docstring.txt b/docs/nodes/GENERATORS/SIMULATIONS/BOOLEAN/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..8363313888 --- /dev/null +++ b/docs/nodes/GENERATORS/SIMULATIONS/BOOLEAN/a1-[autogen]/docstring.txt @@ -0,0 +1,13 @@ +The MATRIX node takes two arguments, 'row' and 'col', as input. + + Based on these inputs, it generates a random matrix where the integers inside the matrix are between 0 and 19. + + Parameters + ---------- + status : True + either True or False value that you want to assign + + Returns + ------- + Boolean + Boolean node diff --git a/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..8ed18518fd --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/CAN/CANABLE/CAN_MESSAGE/a1-[autogen]/docstring.txt @@ -0,0 +1,17 @@ +The CAN_MESSAGE node sends a message onto CAN network through a slcan-compatible USB-to-CAN adapter. + + Inputs + ------ + default: Vector + The array of data to send to the CAN bus. + + Parameters + ---------- + arbitration_id: + Unique ID for message being sent. + is_extended_id: bool + Flag that controls the size of the arbitration_id field. + + Returns + ------- + None diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..0a108c9064 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_ADDR/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The PROLOGIX_ADDR node sets the GPIB address of an instrument using the Prologix USB-to-GPIB or USB-to-Ethernet adapter. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + TextBlob + Response from the Prologix USB-to-GPIB controller. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..bc574fa77e --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_AUTO/a1-[autogen]/docstring.txt @@ -0,0 +1,18 @@ +The PROLOGIX_AUTO node toggles "Read-After-Write" mode on or off. + + When Read-After-Write is on, the Prologix USB-to-GPIB controller automatically reads a bench-top instrument's response after writing a command to it. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + TextBlob + Response from the Prologix USB-to-GPIB controller. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..0e48a32202 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_HELP/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The PROLOGIX_HELP command returns a list of available Prologix USB-to-GPIB firmware commands. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + TextBlob + A list of available Prologix USB-to-GPIB firmware commands diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..6bc0265178 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_MODE/a1-[autogen]/docstring.txt @@ -0,0 +1,32 @@ +The PROLOGIX_MODE node sets the mode of the Prologix USB-to-GPIB controller - 1 for CONTROLLER mode and 0 for DEVICE mode. + + From the Prologix manual: + + In Controller mode, the GPIB-USB Controller acts as the Controller-In-Charge (CIC) + on the GPIB bus. When the controller receives a command over the USB port + terminated by the USB terminator – CR (ASCII 13) or LF (ASCII 10) – it addresses the + GPIB instrument at the currently specified address (See ++addr command) to listen, and + passes along the received data. + + In Device mode, Prologix GPIB-USB Controller acts as another peripheral on the GPIB + bus. In this mode, the controller can act as a GPIB TALKER or GPIB LISTENER + only. Since Prologix GPIB-USB Controller is not the Controller-In-Charge while in this + mode, it expects to receive commands from a GPIB controller. When Device mode is + enabled Prologix GPIB-USB controller configures itself as a GPIB Listener. All data + received by the controller over the GPIB port is passed along to the USB port without + buffering. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + TextBlob + Response from the Prologix USB-to-GPIB controller. diff --git a/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..b776214225 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/GPIB/PROLOGIX/PROLOGIX_VER/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The PROLOGIX_VER command queries the Prologix USB-to-GPIB firmware version. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + TextBlob + The Prologix controller available commands. diff --git a/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..999209a695 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SCPI/SCPI_WRITE/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The SCPI_WRITE node writes a SCPI command to a connected bench-top instrument and returns the result. + + Inputs + ------ + default: DataContainer + Any DataContainer - likely connected to the output of the OPEN_SERIAL node. + + Parameters + ---------- + connection: Serial + The open serial connection with the instrument. + + Returns + ------- + Scalar|TextBlob + The return value from the bench-top instrument as a Scalar or TextBlob. diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..cb4bff4fb7 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/docstring.json @@ -0,0 +1,17 @@ +{ + "description": null, + "parameters": [ + { + "name": "device", + "type": "Serial", + "description": "The connected serial device." + } + ], + "returns": [ + { + "name": null, + "type": "TextBlob", + "description": null + } + ] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt index 267175c76c..87b0c5ddb5 100644 --- a/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/OPEN_SERIAL/a1-[autogen]/python_code.txt @@ -6,15 +6,7 @@ from flojoy.connection_manager import DeviceConnectionManager @flojoy(deps={"pyserial": "3.5"}) def OPEN_SERIAL(device: SerialDevice, baudrate: int = 9600) -> TextBlob: - """The OPEN_SERIAL node opens a serial connection through your computer's USB or RS-232 port. - Parameters - ---------- - device: Serial - The connected serial device. - Returns - ------- - TextBlob - """ + ser = serial.Serial( port=device.get_port(), @@ -27,4 +19,4 @@ def OPEN_SERIAL(device: SerialDevice, baudrate: int = 9600) -> TextBlob: DeviceConnectionManager.register_connection(device, ser) - return TextBlob(text_blob=json.dumps(ser.get_settings())) \ No newline at end of file + return TextBlob(text_blob=json.dumps(ser.get_settings())) diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..b1d987e054 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.json @@ -0,0 +1,16 @@ +{ + "description": null, + "parameters": [ + { + "name": "baudrate", + "type": "int", + "description": "Baud rate for the serial communication." + }, + { + "name": "comport", + "type": "string", + "description": "Defines the comunication port on which the serial device is connected." + } + ], + "returns": [] +} \ No newline at end of file diff --git a/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json new file mode 100644 index 0000000000..bbf5c0d639 --- /dev/null +++ b/docs/nodes/IO/PROTOCOLS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.json @@ -0,0 +1,31 @@ +{ + "description": null, + "parameters": [ + { + "name": "num_readings", + "type": "int", + "description": "Number of points to record." + }, + { + "name": "record_period", + "type": "float", + "description": "Length between two recordings in seconds." + }, + { + "name": "baudrate", + "type": "int", + "description": "Baud rate for the serial device." + }, + { + "name": "comport", + "type": "string", + "description": "COM port of the serial device." + }, + { + "name": "num_readings * record_period", + "type": "", + "description": "Is roughly the run length in seconds." + } + ], + "returns": [] +} \ No newline at end of file diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/AND/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/AND/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..5d1ab01e23 --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/AND/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The AND node takes two boolean data type and computs logical AND operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the AND operation. + + a : Boolean + The input boolean to which we apply the AND operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/COMPOUND_ARITHMETIC/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/COMPOUND_ARITHMETIC/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/EXCLUSIVE_OR/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/EXCLUSIVE_OR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..131ae9c02f --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/EXCLUSIVE_OR/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The EXCLUSIVE_OR node takes two boolean data type and computs logical EXCLUSIVE OR operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the EXCLUSIVE OR operation. + + a : Boolean + The input boolean to which we apply the EXCLUSIVE OR operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/IMPLIES/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/IMPLIES/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..f30722482a --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/IMPLIES/a1-[autogen]/docstring.txt @@ -0,0 +1,15 @@ +The IMPLIES node takes two boolean data type and computs logical IMPLIES operation on them. + x implies y + + Inputs + ------ + default : Boolean + The input boolean to which we apply the IMPLIES operation. + + a : Boolean + The input boolean to which we apply the IMPLIES operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..6af95ce0b1 --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +The NOT node takes a boolean data type and computs logical NOT operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the NOT operation. + + Returns + ------- + Boolean + The boolean result from the operation of the input. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_AND/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_AND/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..d3cf9fb6ef --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_AND/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The NOT_AND node takes two boolean data type and computs logical NOT AND operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the NOT AND operation. + + a : Boolean + The input boolean to which we apply the NOT AND operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_OR/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_OR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..202075edf1 --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/NOT_OR/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The NOT_OR node takes two boolean data type and computs logical NOT OR operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the NOT OR operation. + + a : Boolean + The input boolean to which we apply the NOT OR operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/OR/a1-[autogen]/docstring.txt b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/OR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..f31deebd48 --- /dev/null +++ b/docs/nodes/LOGIC_GATES/LOGIC_OPERATORS/OR/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The OR node takes two boolean data type and computs logical OR operation on them. + + Inputs + ------ + default : Boolean + The input boolean to which we apply the OR operation. + + a : Boolean + The input boolean to which we apply the OR operation. + + Returns + ------- + Boolean + The boolean result from the operation of the inputs. diff --git a/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt index ef742f277c..02f6a8be8a 100644 --- a/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt @@ -1,6 +1,6 @@ import numpy as np from flojoy import flojoy, OrderedPair, Scalar, Vector -from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val +from PYTHON.nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val from functools import reduce @@ -9,6 +9,7 @@ def ADD( a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector] ) -> OrderedPair | Scalar | Vector: + initial = get_val(a) seq = map(lambda dc: get_val(dc), b) y = reduce(lambda u, v: np.add(u, v), seq, initial) diff --git a/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt index 9e9eca5879..9fec552dd3 100644 --- a/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt @@ -1,6 +1,6 @@ import numpy as np from flojoy import OrderedPair, flojoy, Scalar, Vector -from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val +from PYTHON.nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val from functools import reduce @@ -9,6 +9,7 @@ def MULTIPLY( a: OrderedPair | Scalar | Vector, b: list[OrderedPair | Scalar | Vector] ) -> OrderedPair | Scalar | Vector: + initial = get_val(a) seq = map(lambda dc: get_val(dc), b) y = reduce(lambda u, v: np.multiply(u, v), seq, initial) diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/BOOLEAN_2_SCALAR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/TYPE_CASTING/BOOLEAN_2_SCALAR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..f8b48d79f5 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/BOOLEAN_2_SCALAR/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ +The BOOLEAN_2_SCALAR node takes boolean type data and converts it into scalar data type. + 1 means true and 0 means false + + Inputs + ------ + default : Boolean + The input boolean to which we apply the conversion to. + + Returns + ------- + Scalar + The scalar result from the conversion of the input. diff --git a/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..e51e43393c --- /dev/null +++ b/docs/nodes/TRANSFORMERS/TYPE_CASTING/ORDERED_PAIR_2_VECTOR/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +The ORDERED_PAIR_2_VECTOR return the y component of an ordered pair as a Vector. + + Inputs + ------ + default : OrderedPair + The input OrderedPair. + + Returns + ------- + Vector + The y component of the input OrderedPair. diff --git a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt index 8db9cc3153..d091fba5f9 100644 --- a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt +++ b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/docstring.txt @@ -3,9 +3,14 @@ The TEXT_VIEW node creates a text visualization for a given TextBlob DataContain Inputs ------ default : TextBlob - the DataContainer to be visualized in text format + The DataContainer to be visualized in text format + + Parameters + ---------- + prettify : Boolean + Whether to prettify the displayed text (defaults to True) Returns ------- TextBlob - the DataContainer containing text data + The DataContainer containing text data diff --git a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt index 16cd9891c1..7d1331e9f9 100644 --- a/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt +++ b/docs/nodes/VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/a1-[autogen]/python_code.txt @@ -1,8 +1,21 @@ -from flojoy import flojoy, TextBlob +import pprint +from flojoy import flojoy, TextBlob, Boolean @flojoy -def TEXT_VIEW(default: TextBlob): +def TEXT_VIEW(default: TextBlob | Boolean, prettify: bool = False) -> TextBlob: - return default + match default: + case TextBlob(): + s = default.text_blob + + if prettify: + s = pprint.pformat(default.text_blob) + + return TextBlob(s) + case Boolean(): + if default.b: + return TextBlob("True") + + return TextBlob("False") \ No newline at end of file diff --git a/nodeSidebar.json b/nodeSidebar.json index 31033e3fb9..754a27cffa 100644 --- a/nodeSidebar.json +++ b/nodeSidebar.json @@ -191,7 +191,6 @@ "nodes/IO/INSTRUMENTS/OSCILLOSCOPES/TEKTRONIX/MDO3XXX/BASIC/TRIGGER_LEVEL_MDO3XXX/TRIGGER_LEVEL_MDO3XXX" ], "I/O > Protocols": [ - "nodes/IO/PROTOCOLS/CAN/CAN", "nodes/IO/PROTOCOLS/SCPI/IDN/IDN", "nodes/IO/PROTOCOLS/SCPI/MEASURE_VOLTAGE/MEASURE_VOLTAGE", "nodes/IO/PROTOCOLS/SERIAL/BASIC/OPEN_SERIAL/OPEN_SERIAL", From af36b397eb35e47d024a537f5ab51e0052cb768b Mon Sep 17 00:00:00 2001 From: Jin1L Date: Sun, 22 Oct 2023 03:22:12 +0000 Subject: [PATCH 2/2] update: remove compound_arithmetics --- .../TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt | 2 +- .../ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt index 02f6a8be8a..889ae51cc0 100644 --- a/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt @@ -1,6 +1,6 @@ import numpy as np from flojoy import flojoy, OrderedPair, Scalar, Vector -from PYTHON.nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val +from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val from functools import reduce diff --git a/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt index 9fec552dd3..b50a55262f 100644 --- a/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt @@ -1,6 +1,6 @@ import numpy as np from flojoy import OrderedPair, flojoy, Scalar, Vector -from PYTHON.nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val +from nodes.TRANSFORMERS.ARITHMETIC.utils.arithmetic_utils import get_val from functools import reduce