From e03fd15f0ac0309fe33118f73085df9459e00970 Mon Sep 17 00:00:00 2001 From: dstrande Date: Wed, 27 Sep 2023 16:54:19 +0000 Subject: [PATCH 1/4] update: add BASIC 4065 nodes --- .../AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.md | 57 ++ .../ONNX_MODEL/a1-[autogen]/docstring.txt | 41 ++ .../ONNX_MODEL/a1-[autogen]/python_code.txt | 62 ++ .../ONNX_MODEL/appendix/hardware.md | 1 + .../LOAD_MODEL/ONNX_MODEL/appendix/media.md | 1 + .../LOAD_MODEL/ONNX_MODEL/appendix/notes.md | 1 + .../AC_CURRENT_USB4065/AC_CURRENT_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 28 + .../a1-[autogen]/python_code.txt | 27 + .../AC_CURRENT_USB4065/appendix/hardware.md | 1 + .../AC_CURRENT_USB4065/appendix/media.md | 1 + .../AC_CURRENT_USB4065/appendix/notes.md | 1 + .../AC_CURRENT_USB4065/examples/EX1/app.json | 454 +++++++++++++ .../examples/EX1/example.md | 0 .../AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 28 + .../a1-[autogen]/python_code.txt | 27 + .../AC_VOLTAGE_USB4065/appendix/hardware.md | 1 + .../AC_VOLTAGE_USB4065/appendix/media.md | 1 + .../AC_VOLTAGE_USB4065/appendix/notes.md | 1 + .../AC_VOLTAGE_USB4065/examples/EX1/app.json | 454 +++++++++++++ .../examples/EX1/example.md | 0 .../CONNECTION_USB4065/CONNECTION_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 11 + .../a1-[autogen]/python_code.txt | 17 + .../CONNECTION_USB4065/appendix/hardware.md | 1 + .../CONNECTION_USB4065/appendix/media.md | 1 + .../CONNECTION_USB4065/appendix/notes.md | 1 + .../CONNECTION_USB4065/examples/EX1/app.json | 266 ++++++++ .../examples/EX1/example.md | 0 .../DC_CURRENT_USB4065/DC_CURRENT_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 28 + .../a1-[autogen]/python_code.txt | 27 + .../DC_CURRENT_USB4065/appendix/hardware.md | 1 + .../DC_CURRENT_USB4065/appendix/media.md | 1 + .../DC_CURRENT_USB4065/appendix/notes.md | 1 + .../DC_CURRENT_USB4065/examples/EX1/app.json | 456 ++++++++++++++ .../examples/EX1/example.md | 0 .../DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 28 + .../a1-[autogen]/python_code.txt | 27 + .../DC_VOLTAGE_USB4065/appendix/hardware.md | 1 + .../DC_VOLTAGE_USB4065/appendix/media.md | 1 + .../DC_VOLTAGE_USB4065/appendix/notes.md | 1 + .../DC_VOLTAGE_USB4065/examples/EX1/app.json | 456 ++++++++++++++ .../examples/EX1/example.md | 0 .../BASIC/DIODE_USB4065/DIODE_USB4065.md | 57 ++ .../DIODE_USB4065/a1-[autogen]/docstring.txt | 28 + .../a1-[autogen]/python_code.txt | 27 + .../BASIC/DIODE_USB4065/appendix/hardware.md | 1 + .../BASIC/DIODE_USB4065/appendix/media.md | 1 + .../BASIC/DIODE_USB4065/appendix/notes.md | 1 + .../BASIC/DIODE_USB4065/examples/EX1/app.json | 594 ++++++++++++++++++ .../DIODE_USB4065/examples/EX1/example.md | 0 .../RESISTANCE_USB4065/RESISTANCE_USB4065.md | 57 ++ .../a1-[autogen]/docstring.txt | 31 + .../a1-[autogen]/python_code.txt | 27 + .../RESISTANCE_USB4065/appendix/hardware.md | 1 + .../RESISTANCE_USB4065/appendix/media.md | 1 + .../RESISTANCE_USB4065/appendix/notes.md | 1 + .../RESISTANCE_USB4065/examples/EX1/app.json | 266 ++++++++ .../examples/EX1/example.md | 0 62 files changed, 3890 insertions(+) create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.md create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/hardware.md create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/media.md create mode 100644 docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/example.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/example.md diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.md b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.md new file mode 100644 index 0000000000..4ded5d315d --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/ONNX_MODEL.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/docstring.txt b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..902772f8a6 --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/docstring.txt @@ -0,0 +1,41 @@ +ONNX_MODEL loads a serialized ONNX model and uses it to make predictions using ONNX Runtime. + + This allows supporting a wide range of deep learning frameworks and hardware platforms. + + Notes + ----- + + On the one hand, ONNX is an open format to represent deep learning models. + ONNX defines a common set of operators - the building blocks of machine learning + and deep learning models - and a common file format to enable AI developers + to use models with a variety of frameworks, tools, runtimes, and compilers. + + See: https://onnx.ai/ + + On the other hand, ONNX Runtime is a high-performance inference engine for machine + learning models in the ONNX format. ONNX Runtime has proved to considerably increase + performance in inferencing for a broad range of ML models and hardware platforms. + + See: https://onnxruntime.ai/docs/ + + Moreover, the ONNX Model Zoo is a collection of pre-trained models for common + machine learning tasks. The models are stored in ONNX format and are ready to use + in different inference scenarios. + + See: https://github.com/onnx/models + + Parameters + ---------- + file_path : str + Path to a ONNX model to load and use for prediction. + + default : Vector + The input tensor to use for prediction. + For now, only a single input tensor is supported. + Note that the input tensor shape is not checked against the model's input shape. + + Returns + ------- + Vector: + The predictions made by the ONNX model. + For now, only a single output tensor is supported. diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/python_code.txt b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..012554b48f --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/a1-[autogen]/python_code.txt @@ -0,0 +1,62 @@ +from flojoy import flojoy, run_in_venv, Vector +from flojoy.utils import FLOJOY_CACHE_DIR + + +@flojoy +@run_in_venv( + pip_dependencies=[ + "onnxruntime", + "numpy", + "onnx", + ] +) +def ONNX_MODEL( + file_path: str, + default: Vector, +) -> Vector: + + + import os + import onnx + import urllib.request + import numpy as np + import onnxruntime as rt + + model_name = os.path.basename(file_path) + + if file_path.startswith("http://") or file_path.startswith("https://"): + # Downloading the ONNX model from a URL to FLOJOY_CACHE_DIR. + onnx_model_zoo_cache = os.path.join( + FLOJOY_CACHE_DIR, "cache", "onnx", "model_zoo" + ) + + os.makedirs(onnx_model_zoo_cache, exist_ok=True) + + filename = os.path.join(onnx_model_zoo_cache, model_name) + + urllib.request.urlretrieve( + url=file_path, + filename=filename, + ) + + # Using the downloaded file. + file_path = filename + + # Pre-loading the serialized model to validate whether is well-formed or not. + model = onnx.load(file_path) + onnx.checker.check_model(model) + + # Using ONNX runtime for the ONNX model to make predictions. + sess = rt.InferenceSession(file_path, providers=["CPUExecutionProvider"]) + + # TODO(jjerphan): Assuming a single input and a single output for now. + input_name = sess.get_inputs()[0].name + label_name = sess.get_outputs()[0].name + + # TODO(jjerphan): For now NumPy is assumed to be the main backend for Flojoy. + # We might adapt it in the future so that we can use other backends + # for tensor libraries for application using Deep Learning libraries. + input_tensor = np.asarray(default.v, dtype=np.float32) + predictions = sess.run([label_name], {input_name: input_tensor})[0] + + return Vector(v=predictions) diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/hardware.md b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/media.md b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/notes.md b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/AI_ML/LOAD_MODEL/ONNX_MODEL/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.md new file mode 100644 index 0000000000..d5691a0693 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..6e4a8b0dfd --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,28 @@ +The AC_CURRENT_USB4065 node reads the AC current from a USB-4065. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + current_limit: str + The maximum current to allow, in Amps. + + Returns + ------- + DataContainer + Scalar: The AC current reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..a1a49734fd --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def AC_CURRENT_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + current_limit: Literal["0.01", "0.1", "0.5", "3"] = "3", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.AC_CURRENT, + range=float(current_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..ede8f608e3 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/app.json @@ -0,0 +1,454 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "selected": false, + "positionAbsolute": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "selected": false, + "positionAbsolute": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "type": "IO", + "data": { + "id": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "label": "AC CURRENT USB4065", + "func": "AC_CURRENT_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "digits", + "value": "5.5" + }, + "current_limit": { + "type": "select", + "options": [ + "0.01", + "0.1", + "0.5", + "3" + ], + "default": "3", + "desc": "The maximum current to allow, in Amps.", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "current_limit", + "value": "3" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The AC current reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.py", + "selected": false + }, + "position": { + "x": 409.98201629627056, + "y": 4.911279697871066 + }, + "selected": false, + "positionAbsolute": { + "x": 409.98201629627056, + "y": 4.911279697871066 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "type": "IO", + "data": { + "id": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "label": "AC VOLTAGE USB4065", + "func": "AC_VOLTAGE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "digits", + "value": "5.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "0.2", + "2", + "20", + "300" + ], + "default": "20", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "voltage_limit", + "value": "20" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The AC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.py", + "selected": false + }, + "position": { + "x": 411.59905358626946, + "y": -327.4361310374542 + }, + "selected": false, + "positionAbsolute": { + "x": 411.59905358626946, + "y": -327.4361310374542 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7ebdefault" + }, + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895default" + }, + { + "source": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895default-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + }, + { + "source": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "sourceHandle": "default", + "target": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "targetHandle": "default", + "id": "reactflow__edge-AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7ebdefault-BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06bdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.md new file mode 100644 index 0000000000..83b8367608 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..2ff2bb5615 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,28 @@ +The AC_VOLTAGE_USB4065 node reads the AC voltage from a USB-4065. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + voltage_limit: str + The maximum voltage to allow, in Volts. + + Returns + ------- + DataContainer + Scalar: The AC voltage reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..8768ea1972 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def AC_VOLTAGE_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + voltage_limit: Literal["0.2", "2", "20", "300"] = "20", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.AC_VOLTS, + range=float(voltage_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..ede8f608e3 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/app.json @@ -0,0 +1,454 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "selected": false, + "positionAbsolute": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "selected": false, + "positionAbsolute": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "type": "IO", + "data": { + "id": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "label": "AC CURRENT USB4065", + "func": "AC_CURRENT_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "digits", + "value": "5.5" + }, + "current_limit": { + "type": "select", + "options": [ + "0.01", + "0.1", + "0.5", + "3" + ], + "default": "3", + "desc": "The maximum current to allow, in Amps.", + "overload": null, + "functionName": "AC_CURRENT_USB4065", + "param": "current_limit", + "value": "3" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The AC current reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_CURRENT_USB4065/AC_CURRENT_USB4065.py", + "selected": false + }, + "position": { + "x": 409.98201629627056, + "y": 4.911279697871066 + }, + "selected": false, + "positionAbsolute": { + "x": 409.98201629627056, + "y": 4.911279697871066 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "type": "IO", + "data": { + "id": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "label": "AC VOLTAGE USB4065", + "func": "AC_VOLTAGE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "digits", + "value": "5.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "0.2", + "2", + "20", + "300" + ], + "default": "20", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "AC_VOLTAGE_USB4065", + "param": "voltage_limit", + "value": "20" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The AC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/AC_VOLTAGE_USB4065.py", + "selected": false + }, + "position": { + "x": 411.59905358626946, + "y": -327.4361310374542 + }, + "selected": false, + "positionAbsolute": { + "x": 411.59905358626946, + "y": -327.4361310374542 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7ebdefault" + }, + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895default" + }, + { + "source": "AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-AC_CURRENT_USB4065-01f8cd65-f159-48d8-941a-f78f4cf89895default-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + }, + { + "source": "AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7eb", + "sourceHandle": "default", + "target": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "targetHandle": "default", + "id": "reactflow__edge-AC_VOLTAGE_USB4065-75a4399f-a1b3-4cfe-b110-3cea79bce7ebdefault-BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06bdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/AC_VOLTAGE_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.md new file mode 100644 index 0000000000..3ebadba6e8 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..f03c50bd32 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +The CONNECTION_MDO3XXX node connects Flojoy to a + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + + Returns + ------- + DataContainer + Optional: None diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..1d210debfd --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,17 @@ +from flojoy import flojoy, DataContainer, NIDevice +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def CONNECTION_USB4065( + NI_address: str = "Dev1", + default: Optional[DataContainer] = None, +) -> Optional[DataContainer]: + + + session = nidmm.Session(NI_address) + DeviceConnectionManager.register_connection(NIDevice(NI_address), session) + + return None diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..7ee5bc2698 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/app.json @@ -0,0 +1,266 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 779.8328146881206, + "y": -134.05091491913146 + }, + "selected": false, + "positionAbsolute": { + "x": 779.8328146881206, + "y": -134.05091491913146 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "type": "IO", + "data": { + "id": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "label": "RESISTANCE USB4065", + "func": "RESISTANCE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "digits", + "value": "4.5" + }, + "resist_limit": { + "type": "select", + "options": [ + "100", + "1000", + "1e4", + "1e5", + "1e6", + "1e7", + "1e8" + ], + "default": "1e8", + "desc": "The maximum resistance to allow, in Volts.", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "resist_limit", + "value": "100" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.py", + "selected": false + }, + "position": { + "x": 383.1035717255011, + "y": -122.14124419049455 + }, + "selected": false, + "positionAbsolute": { + "x": 383.1035717255011, + "y": -122.14124419049455 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3default" + }, + { + "source": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3default-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.md new file mode 100644 index 0000000000..8dbe2a1ac8 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..22e1235007 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,28 @@ +The DC_CURRENT_USB4065 node reads the DC current from a USB-4065. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + current_limit: str + The maximum current to allow, in Amps. + + Returns + ------- + DataContainer + Scalar: The DC current reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..aa895ded68 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def DC_CURRENT_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + current_limit: Literal["0.01", "0.1", "1", "3"] = "3", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.DC_CURRENT, + range=float(current_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..269fc5f34e --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/app.json @@ -0,0 +1,456 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "selected": false, + "positionAbsolute": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "type": "IO", + "data": { + "id": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "label": "DC VOLTAGE USB4065", + "func": "DC_VOLTAGE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "digits", + "value": "5.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "0.1", + "1", + "10", + "100", + "300" + ], + "default": "10", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "voltage_limit", + "value": "10" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.py", + "selected": false + }, + "position": { + "x": 387.584587312525, + "y": -281.5498028061119 + }, + "selected": false, + "positionAbsolute": { + "x": 387.584587312525, + "y": -281.5498028061119 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": true + }, + "position": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "selected": true, + "positionAbsolute": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "type": "IO", + "data": { + "id": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "label": "DC CURRENT USB4065", + "func": "DC_CURRENT_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "digits", + "value": "4.5" + }, + "current_limit": { + "type": "select", + "options": [ + "0.01", + "0.1", + "1", + "3" + ], + "default": "3", + "desc": "The maximum current to allow, in Amps.", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "current_limit", + "value": "3" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC current reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.py", + "selected": false + }, + "position": { + "x": 383.63040645462985, + "y": 31.065737308753683 + }, + "selected": false, + "positionAbsolute": { + "x": 383.63040645462985, + "y": 31.065737308753683 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbbdefault", + "selected": false + }, + { + "source": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "sourceHandle": "default", + "target": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "targetHandle": "default", + "id": "reactflow__edge-DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbbdefault-BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06bdefault" + }, + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09edefault" + }, + { + "source": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09edefault-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.md new file mode 100644 index 0000000000..6cada942e4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..d448a9fc7c --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,28 @@ +The DC_VOLTAGE_USB4065 node reads the DC voltage from a USB-4065. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + voltage_limit: str + The maximum voltage to allow, in Volts. + + Returns + ------- + DataContainer + Scalar: The DC voltage reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..c4e8508e73 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def DC_VOLTAGE_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + voltage_limit: Literal["0.1", "1", "10", "100", "300"] = "10", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.DC_VOLTS, + range=float(voltage_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..269fc5f34e --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/app.json @@ -0,0 +1,456 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "selected": false, + "positionAbsolute": { + "x": 789.5089067672151, + "y": -337.92011150709266 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "type": "IO", + "data": { + "id": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "label": "DC VOLTAGE USB4065", + "func": "DC_VOLTAGE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "digits", + "value": "5.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "0.1", + "1", + "10", + "100", + "300" + ], + "default": "10", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "DC_VOLTAGE_USB4065", + "param": "voltage_limit", + "value": "10" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/DC_VOLTAGE_USB4065.py", + "selected": false + }, + "position": { + "x": 387.584587312525, + "y": -281.5498028061119 + }, + "selected": false, + "positionAbsolute": { + "x": 387.584587312525, + "y": -281.5498028061119 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": true + }, + "position": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "selected": true, + "positionAbsolute": { + "x": 788.5306367510525, + "y": -17.717544827417925 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "type": "IO", + "data": { + "id": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "label": "DC CURRENT USB4065", + "func": "DC_CURRENT_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "digits", + "value": "4.5" + }, + "current_limit": { + "type": "select", + "options": [ + "0.01", + "0.1", + "1", + "3" + ], + "default": "3", + "desc": "The maximum current to allow, in Amps.", + "overload": null, + "functionName": "DC_CURRENT_USB4065", + "param": "current_limit", + "value": "3" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC current reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_CURRENT_USB4065/DC_CURRENT_USB4065.py", + "selected": false + }, + "position": { + "x": 383.63040645462985, + "y": 31.065737308753683 + }, + "selected": false, + "positionAbsolute": { + "x": 383.63040645462985, + "y": 31.065737308753683 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbbdefault", + "selected": false + }, + { + "source": "DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbb", + "sourceHandle": "default", + "target": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "targetHandle": "default", + "id": "reactflow__edge-DC_VOLTAGE_USB4065-faabd48b-f783-4ebe-90ec-6a060dad2fbbdefault-BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06bdefault" + }, + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09edefault" + }, + { + "source": "DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09e", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-DC_CURRENT_USB4065-ec7b293a-827e-4d89-86bf-5db062fda09edefault-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DC_VOLTAGE_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.md new file mode 100644 index 0000000000..95453f3866 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..940460f3e6 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,28 @@ +The DIODE_USB4065 node reads the voltage drop across a diode. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + voltage_limit: str + The maximum voltage to allow, in Volts. + + Returns + ------- + DataContainer + Scalar: The DC voltage reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..e1295085aa --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def DIODE_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + voltage_limit: Literal["3.5", "10"] = "10", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.DIODE, + range=float(voltage_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..39063c25f1 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/app.json @@ -0,0 +1,594 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": -407.4314234630916, + "y": -63.38316705720263 + }, + "selected": false, + "positionAbsolute": { + "x": -407.4314234630916, + "y": -63.38316705720263 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "LOOP-fdac3e37-4b37-49f0-976b-38ac4759268f", + "type": "LOGIC_GATES", + "data": { + "id": "LOOP-fdac3e37-4b37-49f0-976b-38ac4759268f", + "label": "LOOP", + "func": "LOOP", + "type": "LOGIC_GATES", + "ctrls": { + "num_loops": { + "type": "int", + "default": -1, + "desc": "number of times to iterate through body nodes, default is \"-1\" meaning infinity.", + "overload": null, + "functionName": "LOOP", + "param": "num_loops", + "value": 25 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "body", + "id": "body", + "type": "Any", + "desc": null + }, + { + "name": "end", + "id": "end", + "type": "Any", + "desc": null + } + ], + "path": "LOGIC_GATES/LOOPS/LOOP/LOOP.py", + "selected": true + }, + "position": { + "x": 227.6964774956631, + "y": -20.121881497152287 + }, + "selected": true, + "positionAbsolute": { + "x": 227.6964774956631, + "y": -20.121881497152287 + }, + "dragging": true + }, + { + "width": 96, + "height": 96, + "id": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22", + "type": "LOGIC_GATES", + "data": { + "id": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22", + "label": "APPEND", + "func": "APPEND", + "type": "LOGIC_GATES", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "primary_dp", + "id": "primary_dp", + "type": "OrderedPair|Matrix|DataFrame|Scalar|Vector", + "multiple": false, + "desc": "Input that ends up \"on top\" of the resulting DataContainer." + }, + { + "name": "secondary_dp", + "id": "secondary_dp", + "type": "OrderedPair|Matrix|DataFrame|Scalar|Vector", + "multiple": false, + "desc": "Input that ends up \"on the bottom\" of the resulting DataContainer." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Matrix|DataFrame|Vector", + "desc": null + } + ], + "path": "LOGIC_GATES/LOOPS/APPEND/APPEND.py", + "selected": false + }, + "position": { + "x": 735.3226087858226, + "y": -250.41039060991284 + }, + "selected": false, + "positionAbsolute": { + "x": 735.3226087858226, + "y": -250.41039060991284 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2", + "type": "GENERATORS", + "data": { + "id": "FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2", + "label": "FEEDBACK", + "func": "FEEDBACK", + "type": "GENERATORS", + "ctrls": { + "referred_node": { + "type": "NodeReference", + "default": null, + "desc": "The node ID to capture the result from.", + "overload": null, + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": null + } + ], + "path": "GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py", + "selected": false + }, + "position": { + "x": 438.29263845094783, + "y": -163.366406533838 + }, + "selected": false, + "positionAbsolute": { + "x": 438.29263845094783, + "y": -163.366406533838 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-6977d433-f342-4c5a-9035-43961641c18c", + "type": "VISUALIZERS", + "data": { + "id": "LINE-6977d433-f342-4c5a-9035-43961641c18c", + "label": "LINE", + "func": "LINE", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Line visualization of the input data" + } + ], + "path": "VISUALIZERS/PLOTLY/LINE/LINE.py", + "selected": false + }, + "position": { + "x": 973.9903536635177, + "y": -319.7488298823558 + }, + "selected": false, + "positionAbsolute": { + "x": 973.9903536635177, + "y": -319.7488298823558 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9", + "type": "IO", + "data": { + "id": "DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9", + "label": "DIODE USB4065", + "func": "DIODE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "digits", + "value": "4.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "3.5", + "10" + ], + "default": "10", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "voltage_limit", + "value": "3.5" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.py", + "selected": false + }, + "position": { + "x": -116.51249844926463, + "y": -66.10396672338652 + }, + "selected": false, + "positionAbsolute": { + "x": -116.51249844926463, + "y": -66.10396672338652 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3", + "type": "IO", + "data": { + "id": "DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3", + "label": "DIODE USB4065 1", + "func": "DIODE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "digits", + "value": "4.5" + }, + "voltage_limit": { + "type": "select", + "options": [ + "3.5", + "10" + ], + "default": "10", + "desc": "The maximum voltage to allow, in Volts.", + "overload": null, + "functionName": "DIODE_USB4065", + "param": "voltage_limit", + "value": "3.5" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/DIODE_USB4065.py", + "selected": false + }, + "position": { + "x": 451.32763370126673, + "y": -431.75316643155406 + }, + "selected": false, + "positionAbsolute": { + "x": 451.32763370126673, + "y": -431.75316643155406 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 942.0359776564547, + "y": -618.7319046543057 + }, + "selected": false, + "positionAbsolute": { + "x": 942.0359776564547, + "y": -618.7319046543057 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-fdac3e37-4b37-49f0-976b-38ac4759268f", + "sourceHandle": "body", + "target": "FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2", + "targetHandle": "default", + "id": "reactflow__edge-LOOP-fdac3e37-4b37-49f0-976b-38ac4759268fbody-FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2default" + }, + { + "source": "FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2", + "sourceHandle": "default", + "target": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22", + "targetHandle": "primary_dp", + "id": "reactflow__edge-FEEDBACK-dd1c23ff-8f91-4892-9f1c-8d4b91c50aa2default-APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22primary_dp" + }, + { + "source": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22", + "sourceHandle": "default", + "target": "LINE-6977d433-f342-4c5a-9035-43961641c18c", + "targetHandle": "default", + "id": "reactflow__edge-APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22default-LINE-6977d433-f342-4c5a-9035-43961641c18cdefault" + }, + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9default" + }, + { + "source": "DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9", + "sourceHandle": "default", + "target": "LOOP-fdac3e37-4b37-49f0-976b-38ac4759268f", + "targetHandle": "default", + "id": "reactflow__edge-DIODE_USB4065-83689859-e7b8-42d1-ab55-b5c7130633c9default-LOOP-fdac3e37-4b37-49f0-976b-38ac4759268fdefault" + }, + { + "source": "LOOP-fdac3e37-4b37-49f0-976b-38ac4759268f", + "sourceHandle": "body", + "target": "DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3", + "targetHandle": "default", + "id": "reactflow__edge-LOOP-fdac3e37-4b37-49f0-976b-38ac4759268fbody-DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3default" + }, + { + "source": "DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3", + "sourceHandle": "default", + "target": "APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22", + "targetHandle": "secondary_dp", + "id": "reactflow__edge-DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3default-APPEND-adc5b868-3b2c-41f1-9ec8-ae0a411b1a22secondary_dp" + }, + { + "source": "DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3", + "sourceHandle": "default", + "target": "BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06b", + "targetHandle": "default", + "id": "reactflow__edge-DIODE_USB4065-f3d001ec-a80f-4216-886b-a260672a36e3default-BIG_NUMBER-4f55667b-079e-4735-aa52-3bb18be8e06bdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/DIODE_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.md new file mode 100644 index 0000000000..ecb35fce7d --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..703559d466 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/docstring.txt @@ -0,0 +1,31 @@ +The RESISTANCE_USB4065 node reads the two-wire resistance from a USB-4065. + + The four-wire resistance is more accurate than two-wire and can be measured + with the FOUR_WIRE_RESIST_USB4065 node. + + The USB-4065 is a NI (National Instruments) multimeter. It is possible that + the node will work with other NI DMMs (digital multimeters) such as the + 4070 and 4080 series. + + This instrument will likely only be compatible with Windows systems due to + NI driver availablity. To use the instrument you must install the runtime: + + https://www.ni.com/en/support/downloads/drivers/download.ni-dmm.html + + You must also find the address/resource name for the instrument. You can + find this using the NI MAX programming which can be downloaded when + installing the drivers. + + Parameters + ---------- + NI_address: str + The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1'). + digits: str + The accuracy of the reading in digits. Lower values are faster. + resist_limit: str + The maximum resistance to allow, in Volts. + + Returns + ------- + DataContainer + Scalar: The DC voltage reading. diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..6d6bbb1e3a --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from flojoy import flojoy, DataContainer, Scalar +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional, Literal +import nidmm + + +@flojoy(deps={"nidmm": "1.4.6"}) +def RESISTANCE_USB4065( + NI_address: str = "Dev1", + digits: Literal["4.5", "5.5", "6.5"] = "5.5", + resist_limit: Literal["100", "1000", "1e4", "1e5", "1e6", "1e7", "1e8"] = "1e8", + default: Optional[DataContainer] = None, +) -> Scalar: + + + connection = DeviceConnectionManager.get_connection(NI_address) + session = connection.get_handle() + + session.configure_measurement_digits( + nidmm.Function.TWO_WIRE_RES, + range=float(resist_limit), + resolution_digits=float(digits), + ) + + reading = session.read() + + return Scalar(c=reading) diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/app.json new file mode 100644 index 0000000000..7ee5bc2698 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/app.json @@ -0,0 +1,266 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "type": "IO", + "data": { + "id": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "label": "CONNECTION USB4065", + "func": "CONNECTION_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "CONNECTION_USB4065", + "param": "NI_address", + "value": "Dev1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/CONNECTION_USB4065/CONNECTION_USB4065.py", + "selected": false + }, + "position": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "selected": false, + "positionAbsolute": { + "x": 4.704499736461486, + "y": -114.58793327290465 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default = \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether or not to show the relative delta from the last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": true + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 779.8328146881206, + "y": -134.05091491913146 + }, + "selected": false, + "positionAbsolute": { + "x": 779.8328146881206, + "y": -134.05091491913146 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "type": "IO", + "data": { + "id": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "label": "RESISTANCE USB4065", + "func": "RESISTANCE_USB4065", + "type": "IO", + "ctrls": { + "NI_address": { + "type": "str", + "default": "Dev1", + "desc": "The NI instrument address for the instrument (e.g. 'Dev0', 'Dev1').", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "NI_address", + "value": "Dev1" + }, + "digits": { + "type": "select", + "options": [ + "4.5", + "5.5", + "6.5" + ], + "default": "5.5", + "desc": "The accuracy of the reading in digits. Lower values are faster.", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "digits", + "value": "4.5" + }, + "resist_limit": { + "type": "select", + "options": [ + "100", + "1000", + "1e4", + "1e5", + "1e6", + "1e7", + "1e8" + ], + "default": "1e8", + "desc": "The maximum resistance to allow, in Volts.", + "overload": null, + "functionName": "RESISTANCE_USB4065", + "param": "resist_limit", + "value": "100" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "Scalar: The DC voltage reading." + } + ], + "pip_dependencies": [ + { + "name": "nidmm", + "v": "1.4.6" + } + ], + "path": "IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/RESISTANCE_USB4065.py", + "selected": false + }, + "position": { + "x": 383.1035717255011, + "y": -122.14124419049455 + }, + "selected": false, + "positionAbsolute": { + "x": 383.1035717255011, + "y": -122.14124419049455 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1", + "sourceHandle": "default", + "target": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_USB4065-33140410-b4f4-4e67-8613-7559b997c8e1default-RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3default" + }, + { + "source": "RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3", + "sourceHandle": "default", + "target": "BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085dec", + "targetHandle": "default", + "id": "reactflow__edge-RESISTANCE_USB4065-be7ec375-8dda-4e2a-b1e9-4b25945441d3default-BIG_NUMBER-58ecefea-6da3-4e07-b581-b9796f085decdefault" + } + ], + "viewport": { + "x": 1139.470292881633, + "y": 572.2854272048312, + "zoom": 1.2136444284334926 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/MULTIMETERS/NI/USB_4065/BASIC/RESISTANCE_USB4065/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 From 2f4acd100e3bba6c739b672e7a2b63bd9eb4b7cc Mon Sep 17 00:00:00 2001 From: dstrande Date: Wed, 27 Sep 2023 19:35:43 +0000 Subject: [PATCH 2/4] update: Merge branch 'develop' into dallas/nod-74-usb-4065-dmm-nodes --- .../a1-[autogen]/docstring.txt | 11 +- .../a1-[autogen]/python_code.txt | 37 +- .../BURST_MODE_33510B/examples/EX1/app.json | 213 +++++++----- .../a1-[autogen]/docstring.txt | 11 +- .../a1-[autogen]/python_code.txt | 39 +-- .../examples/EX1/app.json | 148 ++++---- .../CONNECTION_33510B/CONNECTION_33510B.md | 57 ++++ .../a1-[autogen]/docstring.txt | 16 + .../a1-[autogen]/python_code.txt | 29 ++ .../CONNECTION_33510B/appendix/hardware.md | 1 + .../BASIC/CONNECTION_33510B/appendix/media.md | 1 + .../BASIC/CONNECTION_33510B/appendix/notes.md | 1 + .../CONNECTION_33510B/examples/EX1/app.json | 322 ++++++++++++++++++ .../CONNECTION_33510B/examples/EX1/example.md | 0 .../ON_OFF_33510B/a1-[autogen]/docstring.txt | 11 +- .../a1-[autogen]/python_code.txt | 39 +-- .../BASIC/ON_OFF_33510B/examples/EX1/app.json | 250 ++++++-------- .../a1-[autogen]/docstring.txt | 13 +- .../a1-[autogen]/python_code.txt | 39 +-- .../OUTPUT_SYNC_33510B/examples/EX1/app.json | 161 ++++----- .../a1-[autogen]/docstring.txt | 13 +- .../a1-[autogen]/python_code.txt | 39 +-- .../SET_WAVEFORM_33510B/examples/EX1/app.json | 254 ++++++-------- nodeSidebar.json | 1 + 24 files changed, 947 insertions(+), 759 deletions(-) create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.md create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/hardware.md create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/media.md create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/notes.md create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/app.json create mode 100644 docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/example.md diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/docstring.txt index bd3d501756..3962de8b6f 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/docstring.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/docstring.txt @@ -4,19 +4,16 @@ The BURST_MODE_33510B node is used to turn the Burst mode on or off. The burst mode is way to have signals come in "bursts" that are triggered externally or with a timer for instance. - If the "VISA_address" parameter is not specified the VISA_index will be - used to find the address. The LIST_VISA node can be used to show the - indicies of all available VISA instruments. + Requires a CONNECTION_33510B node at the start of the app to connect with + the instrument. The VISA address will then be listed under 'connection'. This node should also work with compatible Keysight 33XXX wavefunction generators (although they are untested). Parameters ---------- - VISA_address: str - The VISA address to query. - VISA_index: int - The address will be found from LIST_VISA node list with this index. + connection: VisaConnection + The VISA address (requires the CONNECTION_MDO3XXX node). on_off: str Turn the burst mode on or off. channel: str diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/python_code.txt index ef67d3cf6d..7b41f8dbb6 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/a1-[autogen]/python_code.txt @@ -1,22 +1,10 @@ -from flojoy import flojoy, DataContainer, TextBlob -import pyvisa +from flojoy import flojoy, DataContainer, TextBlob, VisaConnection from typing import Optional, Literal -from qcodes.instrument_drivers.Keysight import Keysight33512B -from usb.core import USBError -@flojoy( - deps={ - "pyvisa": "1.13.0", - "pyusb": "1.2.1", - "zeroconf": "0.102.0", - "pyvisa_py": "0.7.0", - "qcodes": "0.39.1", - } -) +@flojoy(inject_connection=True) def BURST_MODE_33510B( - VISA_address: Optional[str], - VISA_index: Optional[int] = 0, + connection: VisaConnection, on_off: Literal["ON", "OFF"] = "OFF", channel: Literal["ch1", "ch2"] = "ch1", trigger_source: Literal["EXT", "IMM", "TIM"] = "TIM", @@ -28,25 +16,10 @@ def BURST_MODE_33510B( burst_phase: float = 0, burst_polarity: Literal["NORM", "INV"] = "NORM", default: Optional[DataContainer] = None, -) -> Optional[DataContainer]: +) -> TextBlob: - rm = pyvisa.ResourceManager("@py") - if VISA_address == "": - VISA_addresses = rm.list_resources() - VISA_address = VISA_addresses[int(VISA_index)] - - try: - ks = Keysight33512B( - "ks", - VISA_address, - visalib="@py", - device_clear=False, - ) - except USBError as err: - raise Exception( - "USB port error. Trying unplugging+replugging the port." - ) from err + ks = connection.get_handle() channel_str = channel channel = getattr(ks, channel) diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/examples/EX1/app.json index 376e5d1db2..d312697942 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/examples/EX1/app.json +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/examples/EX1/app.json @@ -4,32 +4,111 @@ { "width": 192, "height": 192, - "id": "BURST_MODE_33510B-7ddc91f3-e2fa-47c8-baa4-9483b0372146", + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", "type": "IO", "data": { - "id": "BURST_MODE_33510B-7ddc91f3-e2fa-47c8-baa4-9483b0372146", + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", + "type": "IO", + "ctrls": { + "device": { + "type": "VisaDevice", + "default": null, + "desc": "The VISA address to connect to.", + "overload": null, + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", + "selected": false + }, + "position": { + "x": -527.3533818261817, + "y": -104.51110954945591 + }, + "selected": false, + "positionAbsolute": { + "x": -527.3533818261817, + "y": -104.51110954945591 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 233.00086174633415, + "y": -124.48626608153023 + }, + "selected": false, + "positionAbsolute": { + "x": 233.00086174633415, + "y": -124.48626608153023 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431", + "type": "IO", + "data": { + "id": "BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431", "label": "BURST MODE 33510B", "func": "BURST_MODE_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "BURST_MODE_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "BURST_MODE_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -37,7 +116,7 @@ "OFF" ], "default": "OFF", - "desc": null, + "desc": "Turn the burst mode on or off.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "on_off", @@ -50,7 +129,7 @@ "ch2" ], "default": "ch1", - "desc": null, + "desc": "The channel to modify the burst mode for.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "channel", @@ -64,7 +143,7 @@ "TIM" ], "default": "TIM", - "desc": null, + "desc": "Set the trigger_source (e.g. externally or timed).", "overload": null, "functionName": "BURST_MODE_33510B", "param": "trigger_source", @@ -73,7 +152,7 @@ "trigger_delay": { "type": "float", "default": 0, - "desc": null, + "desc": "Delay the burst by this number of seconds after a trigger.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "trigger_delay", @@ -86,7 +165,7 @@ "NEG" ], "default": "POS", - "desc": null, + "desc": "If triggering is external, trigger on a positive or negative slope.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "trigger_slope", @@ -99,7 +178,7 @@ "overload": null, "functionName": "BURST_MODE_33510B", "param": "trigger_timer", - "value": 0.000001 + "value": 0.001 }, "burst_mode": { "type": "select", @@ -108,7 +187,7 @@ "Gated" ], "default": "N Cycle", - "desc": null, + "desc": "Set the burst mode for the WFG.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "burst_mode", @@ -117,16 +196,16 @@ "burst_ncycles": { "type": "int", "default": 1, - "desc": null, + "desc": "How many cycles to have in one burst.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "burst_ncycles", - "value": 10 + "value": 1 }, "burst_phase": { "type": "float", "default": 0, - "desc": null, + "desc": "What phase to start the burst with, in degrees.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "burst_phase", @@ -139,7 +218,7 @@ "INV" ], "default": "NORM", - "desc": null, + "desc": "The polarity of the burst in Gated mode, normal or inverted.", "overload": null, "functionName": "BURST_MODE_33510B", "param": "burst_polarity", @@ -157,92 +236,42 @@ } ], "outputs": [ - { - "name": "default", - "id": "default", - "type": "Any", - "desc": "TextBlob: ON or OFF depending on on_off value." - } - ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" - } - ], - "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/BURST_MODE_33510B.py", - "selected": false - }, - "position": { - "x": -240.28567405069748, - "y": -107.39744698085521 - }, - "selected": false, - "positionAbsolute": { - "x": -240.28567405069748, - "y": -107.39744698085521 - }, - "dragging": true - }, - { - "width": 384, - "height": 288, - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", - "type": "VISUALIZERS", - "data": { - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", - "label": "TEXT VIEW", - "func": "TEXT_VIEW", - "type": "VISUALIZERS", - "ctrls": {}, - "initCtrls": {}, - "inputs": [ { "name": "default", "id": "default", "type": "TextBlob", - "multiple": false, - "desc": "the DataContainer to be visualized in text format" + "desc": "TextBlob: summary of burst mode settings." } ], - "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/BURST_MODE_33510B.py", "selected": false }, "position": { - "x": 126.63251436934425, - "y": -126.35743104815421 + "x": -149.8564984407858, + "y": -110.30884513863724 }, "selected": false, "positionAbsolute": { - "x": 126.63251436934425, - "y": -126.35743104815421 + "x": -149.8564984407858, + "y": -110.30884513863724 }, "dragging": true } ], "edges": [ { - "source": "BURST_MODE_33510B-7ddc91f3-e2fa-47c8-baa4-9483b0372146", + "source": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "sourceHandle": "default", + "target": "BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027default-BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431default" + }, + { + "source": "BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431", "sourceHandle": "default", - "target": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "target": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "targetHandle": "default", - "id": "reactflow__edge-BURST_MODE_33510B-7ddc91f3-e2fa-47c8-baa4-9483b0372146default-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" + "id": "reactflow__edge-BURST_MODE_33510B-f8a40cc2-e5ec-408c-922f-6f58a235a431default-TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59bdefault" } ], "viewport": { diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/docstring.txt index 28b08580c6..6335dde3e4 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/docstring.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/docstring.txt @@ -3,19 +3,16 @@ The RETURN_ERRORS_33510B node returns error messages from the WFG. Error retrival is first-in-first-out (FIFO). Returning errors clears them from the instruments queue. - If the "VISA_address" parameter is not specified the VISA_index will be - used to find the address. The LIST_VISA node can be used to show the - indicies of all available VISA instruments. + Requires a CONNECTION_33510B node at the start of the app to connect with + the instrument. The VISA address will then be listed under 'connection'. This node should also work with compatible Keysight 33XXX wavefunction generators (although they are untested). Parameters ---------- - VISA_address: str - The VISA address to query. - VISA_index: int - The address will be found from LIST_VISA node list with this index. + connection: VisaConnection + The VISA address (requires the CONNECTION_MDO3XXX node). Returns ------- diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/python_code.txt index c1e5eb67fb..e5090be60d 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/a1-[autogen]/python_code.txt @@ -1,42 +1,15 @@ -from flojoy import flojoy, DataContainer, TextBlob -import pyvisa -from typing import Optional, Literal -from qcodes.instrument_drivers.Keysight import Keysight33512B -from usb.core import USBError +from flojoy import flojoy, DataContainer, TextBlob, VisaConnection +from typing import Optional -@flojoy( - deps={ - "pyvisa": "1.13.0", - "pyusb": "1.2.1", - "zeroconf": "0.102.0", - "pyvisa_py": "0.7.0", - "qcodes": "0.39.1", - } -) +@flojoy(inject_connection=True) def RETURN_ERRORS_33510B( - VISA_address: Optional[str], - VISA_index: Optional[int] = 0, + connection: VisaConnection, default: Optional[DataContainer] = None, -) -> Optional[DataContainer]: +) -> TextBlob: - rm = pyvisa.ResourceManager("@py") - if VISA_address == "": - VISA_addresses = rm.list_resources() - VISA_address = VISA_addresses[int(VISA_index)] - - try: - ks = Keysight33512B( - "ks", - VISA_address, - visalib="@py", - device_clear=False, - ) - except USBError as err: - raise Exception( - "USB port error. Trying unplugging+replugging the port." - ) from err + ks = connection.get_handle() err_code, err_message = ks.error() errors = f"{err_code} {err_message}" diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/examples/EX1/app.json index 3006d1ec91..5263851b66 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/examples/EX1/app.json +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/examples/EX1/app.json @@ -4,31 +4,22 @@ { "width": 192, "height": 192, - "id": "RETURN_ERRORS_33510B-3a066f98-2226-43cf-b6db-c231fd651f55", + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", "type": "IO", "data": { - "id": "RETURN_ERRORS_33510B-3a066f98-2226-43cf-b6db-c231fd651f55", - "label": "RETURN ERRORS 33510B", - "func": "RETURN_ERRORS_33510B", + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "device": { + "type": "VisaDevice", "default": null, - "desc": "The VISA address to query.", - "overload": null, - "functionName": "RETURN_ERRORS_33510B", - "param": "VISA_address", - "value": "" - }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", + "desc": "The VISA address to connect to.", "overload": null, - "functionName": "RETURN_ERRORS_33510B", - "param": "VISA_index", - "value": 2 + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" } }, "initCtrls": {}, @@ -46,51 +37,30 @@ "name": "default", "id": "default", "type": "Any", - "desc": "TextBlob: Returns all errors in the WFG memory." - } - ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" + "desc": "Optional: None" } ], - "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/RETURN_ERRORS_33510B.py", - "selected": false + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", + "selected": true }, "position": { - "x": 193.2467834815114, - "y": 112.8639037908917 + "x": -527.3533818261817, + "y": -104.51110954945591 }, - "selected": false, + "selected": true, "positionAbsolute": { - "x": 193.2467834815114, - "y": 112.8639037908917 - } + "x": -527.3533818261817, + "y": -104.51110954945591 + }, + "dragging": true }, { "width": 384, "height": 288, - "id": "TEXT_VIEW-9ef30eb9-6f9c-4b38-bdcf-a4093e1ec2a0", + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "type": "VISUALIZERS", "data": { - "id": "TEXT_VIEW-9ef30eb9-6f9c-4b38-bdcf-a4093e1ec2a0", + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "label": "TEXT VIEW", "func": "TEXT_VIEW", "type": "VISUALIZERS", @@ -109,24 +79,84 @@ "selected": false }, "position": { - "x": 591.3285686884251, - "y": 101.4852722421046 + "x": 233.00086174633415, + "y": -124.48626608153023 + }, + "selected": false, + "positionAbsolute": { + "x": 233.00086174633415, + "y": -124.48626608153023 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788", + "type": "IO", + "data": { + "id": "RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788", + "label": "RETURN ERRORS 33510B", + "func": "RETURN_ERRORS_33510B", + "type": "IO", + "ctrls": { + "connection": { + "type": "VisaConnection", + "default": null, + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", + "overload": null, + "functionName": "RETURN_ERRORS_33510B", + "param": "connection", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: Returns all errors in the WFG memory." + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/RETURN_ERRORS_33510B.py", + "selected": false + }, + "position": { + "x": -147.83112432013039, + "y": -101.03938942263295 }, "selected": false, "positionAbsolute": { - "x": 591.3285686884251, - "y": 101.4852722421046 + "x": -147.83112432013039, + "y": -101.03938942263295 }, "dragging": true } ], "edges": [ { - "source": "RETURN_ERRORS_33510B-3a066f98-2226-43cf-b6db-c231fd651f55", + "source": "RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788", + "sourceHandle": "default", + "target": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", + "targetHandle": "default", + "id": "reactflow__edge-RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788default-TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59bdefault" + }, + { + "source": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", "sourceHandle": "default", - "target": "TEXT_VIEW-9ef30eb9-6f9c-4b38-bdcf-a4093e1ec2a0", + "target": "RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788", "targetHandle": "default", - "id": "reactflow__edge-RETURN_ERRORS_33510B-3a066f98-2226-43cf-b6db-c231fd651f55default-TEXT_VIEW-9ef30eb9-6f9c-4b38-bdcf-a4093e1ec2a0default" + "id": "reactflow__edge-CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027default-RETURN_ERRORS_33510B-399b56cc-0062-49f0-933c-ab01e39b6788default" } ], "viewport": { diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.md b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.md new file mode 100644 index 0000000000..f1175d59f6 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..be68a2a083 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The CONNECTION_33510B node connects Flojoy to a 33510B function generator. + + The connection is made with the VISA address in the Flojoy UI. + + This node should also work with compatible Keysight 33XXX wavefunction + generators (although they are untested). + + Parameters + ---------- + device: VisaDevice + The VISA address to connect to. + + Returns + ------- + DataContainer + Optional: None diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..07f74a65cc --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/a1-[autogen]/python_code.txt @@ -0,0 +1,29 @@ +from flojoy import VisaDevice, flojoy, DataContainer +from flojoy.connection_manager import DeviceConnectionManager +from typing import Optional +from qcodes.instrument_drivers.Keysight import Keysight33512B +from usb.core import USBError + + +@flojoy() +def CONNECTION_33510B( + device: VisaDevice, + default: Optional[DataContainer] = None, +) -> Optional[DataContainer]: + + + try: + ks = Keysight33512B( + "ks", + device.get_id(), + visalib="@py", + device_clear=False, + ) + except USBError as err: + raise Exception( + "USB port error. Trying unplugging+replugging the port." + ) from err + + DeviceConnectionManager.register_connection(device, ks) + + return None diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/hardware.md b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/media.md b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/notes.md b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/app.json new file mode 100644 index 0000000000..4f64505735 --- /dev/null +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/app.json @@ -0,0 +1,322 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": -97.20356336156576, + "y": -314.9312497214042 + }, + "selected": false, + "positionAbsolute": { + "x": -97.20356336156576, + "y": -314.9312497214042 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": -81.05571289888496, + "y": 57.102935591729135 + }, + "selected": false, + "positionAbsolute": { + "x": -81.05571289888496, + "y": 57.102935591729135 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", + "type": "IO", + "data": { + "id": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", + "type": "IO", + "ctrls": { + "device": { + "type": "VisaDevice", + "default": null, + "desc": "The VISA address to connect to.", + "overload": null, + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", + "selected": false + }, + "position": { + "x": -887.4349451815563, + "y": -64.27026427943238 + }, + "selected": false, + "positionAbsolute": { + "x": -887.4349451815563, + "y": -64.27026427943238 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", + "type": "IO", + "data": { + "id": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", + "label": "ON OFF 33510B 2", + "func": "ON_OFF_33510B", + "type": "IO", + "ctrls": { + "connection": { + "type": "VisaConnection", + "default": null, + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "connection", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + }, + "on_off": { + "type": "select", + "options": [ + "ON", + "OFF" + ], + "default": "OFF", + "desc": "Whether to turn the waveform generation to on or off.", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "on_off", + "value": "ON" + }, + "channel": { + "type": "select", + "options": [ + "ch1", + "ch2" + ], + "default": "ch1", + "desc": "The channel to turn on or off.", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "channel", + "value": "ch2" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: ON or OFF depending on on_off value." + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/ON_OFF_33510B.py", + "selected": false + }, + "position": { + "x": -493.6858087739779, + "y": 102.59832750990404 + }, + "selected": false, + "positionAbsolute": { + "x": -493.6858087739779, + "y": 102.59832750990404 + }, + "dragging": true + }, + { + "width": 192, + "height": 192, + "id": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", + "type": "IO", + "data": { + "id": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", + "label": "ON OFF 33510B 1", + "func": "ON_OFF_33510B", + "type": "IO", + "ctrls": { + "connection": { + "type": "VisaConnection", + "default": null, + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "connection", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + }, + "on_off": { + "type": "select", + "options": [ + "ON", + "OFF" + ], + "default": "OFF", + "desc": "Whether to turn the waveform generation to on or off.", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "on_off", + "value": "OFF" + }, + "channel": { + "type": "select", + "options": [ + "ch1", + "ch2" + ], + "default": "ch1", + "desc": "The channel to turn on or off.", + "overload": null, + "functionName": "ON_OFF_33510B", + "param": "channel", + "value": "ch1" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "TextBlob: ON or OFF depending on on_off value." + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/ON_OFF_33510B.py", + "selected": false + }, + "position": { + "x": -487.4597221522696, + "y": -267.59982114760356 + }, + "selected": false, + "positionAbsolute": { + "x": -487.4597221522696, + "y": -267.59982114760356 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", + "sourceHandle": "default", + "target": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "targetHandle": "default", + "id": "reactflow__edge-ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08default-TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993default" + }, + { + "source": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", + "sourceHandle": "default", + "target": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "targetHandle": "default", + "id": "reactflow__edge-ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790default-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" + }, + { + "source": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", + "sourceHandle": "default", + "target": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155dadefault-ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790default" + }, + { + "source": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", + "sourceHandle": "default", + "target": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", + "targetHandle": "default", + "id": "reactflow__edge-CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155dadefault-ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08default" + } + ], + "viewport": { + "x": 1104.261946392206, + "y": 573.1338859553202, + "zoom": 1.2154437530123414 + } + } +} \ No newline at end of file diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/example.md b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/examples/EX1/example.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/docstring.txt index 2304a38ef4..21a1a542bd 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/docstring.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/docstring.txt @@ -1,18 +1,15 @@ The ON_OFF_33510B node is used to turn the output on or off. - If the "VISA_address" parameter is not specified the VISA_index will be - used to find the address. The LIST_VISA node can be used to show the - indicies of all available VISA instruments. + Requires a CONNECTION_33510B node at the start of the app to connect with + the instrument. The VISA address will then be listed under 'connection'. This node should also work with compatible Keysight 33XXX wavefunction generators (although they are untested). Parameters ---------- - VISA_address: str - The VISA address to query. - VISA_index: int - The address will be found from LIST_VISA node list with this index. + connection: VisaConnection + The VISA address (requires the CONNECTION_MDO3XXX node). on_off: str Whether to turn the waveform generation to on or off. channel: str diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/python_code.txt index 3f2a382963..d674558cfb 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/a1-[autogen]/python_code.txt @@ -1,50 +1,21 @@ -from flojoy import flojoy, DataContainer, TextBlob -import pyvisa +from flojoy import flojoy, DataContainer, TextBlob, VisaConnection from typing import Optional, Literal -from qcodes.instrument_drivers.Keysight import Keysight33512B -from usb.core import USBError -@flojoy( - deps={ - "pyvisa": "1.13.0", - "pyusb": "1.2.1", - "zeroconf": "0.102.0", - "pyvisa_py": "0.7.0", - "qcodes": "0.39.1", - } -) +@flojoy(inject_connection=True) def ON_OFF_33510B( - VISA_address: Optional[str], - VISA_index: Optional[int] = 0, + connection: VisaConnection, on_off: Literal["ON", "OFF"] = "OFF", channel: Literal["ch1", "ch2"] = "ch1", default: Optional[DataContainer] = None, -) -> Optional[DataContainer]: +) -> TextBlob: - rm = pyvisa.ResourceManager("@py") - if VISA_address == "": - VISA_addresses = rm.list_resources() - VISA_address = VISA_addresses[int(VISA_index)] - - try: - ks = Keysight33512B( - "ks", - VISA_address, - visalib="@py", - device_clear=False, - ) - except USBError as err: - raise Exception( - "USB port error. Trying unplugging+replugging the port." - ) from err + ks = connection.get_handle() channel_str = channel channel = getattr(ks, channel) channel.output(on_off) - ks.close() - return TextBlob(text_blob=f"{channel_str}: {on_off}") diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/examples/EX1/app.json index 7b891eda71..4f64505735 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/examples/EX1/app.json +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/examples/EX1/app.json @@ -26,27 +26,72 @@ "selected": false }, "position": { - "x": -104.31280346396179, - "y": -275.1195051479864 + "x": -97.20356336156576, + "y": -314.9312497214042 }, "selected": false, "positionAbsolute": { - "x": -104.31280346396179, - "y": -275.1195051479864 + "x": -97.20356336156576, + "y": -314.9312497214042 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "label": "TEXT VIEW 1", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": -81.05571289888496, + "y": 57.102935591729135 + }, + "selected": false, + "positionAbsolute": { + "x": -81.05571289888496, + "y": 57.102935591729135 }, "dragging": true }, { "width": 192, "height": 192, - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", + "id": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", "type": "IO", "data": { - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", - "label": "CLOSE ALL", - "func": "CLOSE_ALL", + "id": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", "type": "IO", - "ctrls": {}, + "ctrls": { + "device": { + "type": "VisaDevice", + "default": null, + "desc": "The VISA address to connect to.", + "overload": null, + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, "initCtrls": {}, "inputs": [ { @@ -62,58 +107,43 @@ "name": "default", "id": "default", "type": "Any", - "desc": "optional: The input DataContainer is returned." + "desc": "Optional: None" } ], - "pip_dependencies": [ - { - "name": "qcodes", - "v": "0.39.1" - } - ], - "path": "IO/INSTRUMENTS/QCODES/CLOSE_ALL/CLOSE_ALL.py", + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", "selected": false }, "position": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -887.4349451815563, + "y": -64.27026427943238 }, "selected": false, "positionAbsolute": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -887.4349451815563, + "y": -64.27026427943238 }, "dragging": true }, { "width": 192, "height": 192, - "id": "ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126", + "id": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", "type": "IO", "data": { - "id": "ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126", - "label": "ON OFF 33510B", + "id": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", + "label": "ON OFF 33510B 2", "func": "ON_OFF_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "ON_OFF_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "ON_OFF_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -138,7 +168,7 @@ "overload": null, "functionName": "ON_OFF_33510B", "param": "channel", - "value": "ch1" + "value": "ch2" } }, "initCtrls": {}, @@ -155,75 +185,44 @@ { "name": "default", "id": "default", - "type": "Any", + "type": "TextBlob", "desc": "TextBlob: ON or OFF depending on on_off value." } ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" - } - ], "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/ON_OFF_33510B.py", "selected": false }, "position": { - "x": -518.9542744208309, - "y": -225.7992199828376 + "x": -493.6858087739779, + "y": 102.59832750990404 }, "selected": false, "positionAbsolute": { - "x": -518.9542744208309, - "y": -225.7992199828376 + "x": -493.6858087739779, + "y": 102.59832750990404 }, "dragging": true }, { "width": 192, "height": 192, - "id": "ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290", + "id": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", "type": "IO", "data": { - "id": "ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290", + "id": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", "label": "ON OFF 33510B 1", "func": "ON_OFF_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "ON_OFF_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "ON_OFF_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -248,7 +247,7 @@ "overload": null, "functionName": "ON_OFF_33510B", "param": "channel", - "value": "ch2" + "value": "ch1" } }, "initCtrls": {}, @@ -265,110 +264,53 @@ { "name": "default", "id": "default", - "type": "Any", + "type": "TextBlob", "desc": "TextBlob: ON or OFF depending on on_off value." } ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" - } - ], "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/ON_OFF_33510B.py", "selected": false }, "position": { - "x": -527.5335653145921, - "y": 123.28418767124424 + "x": -487.4597221522696, + "y": -267.59982114760356 }, "selected": false, "positionAbsolute": { - "x": -527.5335653145921, - "y": 123.28418767124424 - }, - "dragging": true - }, - { - "width": 384, - "height": 288, - "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", - "type": "VISUALIZERS", - "data": { - "id": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", - "label": "TEXT VIEW 1", - "func": "TEXT_VIEW", - "type": "VISUALIZERS", - "ctrls": {}, - "initCtrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "TextBlob", - "multiple": false, - "desc": "the DataContainer to be visualized in text format" - } - ], - "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", - "selected": false - }, - "position": { - "x": -120.86745747230276, - "y": 75.58695985795885 - }, - "selected": false, - "positionAbsolute": { - "x": -120.86745747230276, - "y": 75.58695985795885 + "x": -487.4597221522696, + "y": -267.59982114760356 }, "dragging": true } ], "edges": [ { - "source": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", + "source": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", "sourceHandle": "default", - "target": "ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126", + "target": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", "targetHandle": "default", - "id": "reactflow__edge-CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7default-ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126default" + "id": "reactflow__edge-ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08default-TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993default" }, { - "source": "ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126", + "source": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", "sourceHandle": "default", "target": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", "targetHandle": "default", - "id": "reactflow__edge-ON_OFF_33510B-40f04122-9a47-4ecd-8181-7b42d087a126default-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" + "id": "reactflow__edge-ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790default-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" }, { - "source": "ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290", + "source": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", "sourceHandle": "default", - "target": "TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993", + "target": "ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790", "targetHandle": "default", - "id": "reactflow__edge-ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290default-TEXT_VIEW-9b57ca0b-54cb-46c2-a71a-69bdc48fa993default" + "id": "reactflow__edge-CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155dadefault-ON_OFF_33510B-d19eca7b-b688-4c6d-a0b6-f70c43644790default" }, { - "source": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", + "source": "CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155da", "sourceHandle": "default", - "target": "ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290", + "target": "ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08", "targetHandle": "default", - "id": "reactflow__edge-CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7default-ON_OFF_33510B-c5638b61-e10d-48a1-b59d-835c2dfd2290default" + "id": "reactflow__edge-CONNECTION_33510B-d0efefd1-f09c-4f2c-b5d8-ca8fb95155dadefault-ON_OFF_33510B-b7a6b301-b085-4365-9ae4-d83fb88dfd08default" } ], "viewport": { diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/docstring.txt index 33bc7e7230..62514066a1 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/docstring.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/docstring.txt @@ -2,19 +2,16 @@ The OUTPUT_SYNC_33510B node is used sync multiple outputs phases. Can only be turned on for one channel. - If the "VISA_address" parameter is not specified the VISA_index will be - used to find the address. The LIST_VISA node can be used to show the - indicies of all available VISA instruments. + Requires a CONNECTION_33510B node at the start of the app to connect with + the instrument. The VISA address will then be listed under 'connection'. This node should also work with compatible Keysight 33XXX wavefunction generators (although they are untested). Parameters ---------- - VISA_address: str - The VISA address to query. - VISA_index: int - The address will be found from LIST_VISA node list with this index. + connection: VisaConnection + The VISA address (requires the CONNECTION_MDO3XXX node). on_off: str Whether to turn the waveform phase syncing on or off. channel: str @@ -23,4 +20,4 @@ The OUTPUT_SYNC_33510B node is used sync multiple outputs phases. Returns ------- DataContainer - TextBlob: ON or OFF depending on on_off value. + TextBlob: The channel, and ON or OFF depending on on_off value. diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/python_code.txt index 24fc5fd124..262b12685b 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/a1-[autogen]/python_code.txt @@ -1,44 +1,17 @@ -from flojoy import flojoy, DataContainer, TextBlob -import pyvisa +from flojoy import flojoy, DataContainer, TextBlob, VisaConnection from typing import Optional, Literal -from qcodes.instrument_drivers.Keysight import Keysight33512B -from usb.core import USBError -@flojoy( - deps={ - "pyvisa": "1.13.0", - "pyusb": "1.2.1", - "zeroconf": "0.102.0", - "pyvisa_py": "0.7.0", - "qcodes": "0.39.1", - } -) +@flojoy(inject_connection=True) def OUTPUT_SYNC_33510B( - VISA_address: Optional[str], - VISA_index: Optional[int] = 0, + connection: VisaConnection, on_off: Literal["ON", "OFF"] = "OFF", channel: Literal["1", "2"] = "1", default: Optional[DataContainer] = None, -) -> Optional[DataContainer]: +) -> TextBlob: - rm = pyvisa.ResourceManager("@py") - if VISA_address == "": - VISA_addresses = rm.list_resources() - VISA_address = VISA_addresses[int(VISA_index)] - - try: - ks = Keysight33512B( - "ks", - VISA_address, - visalib="@py", - device_clear=False, - ) - except USBError as err: - raise Exception( - "USB port error. Trying unplugging+replugging the port." - ) from err + ks = connection.get_handle() ks.sync.source(int(channel)) match on_off: @@ -48,6 +21,4 @@ def OUTPUT_SYNC_33510B( ks.sync.output("ON") ks.write("PHAS:SYNC") - ks.close() - return TextBlob(text_blob=f"CH{channel} sync: {on_off}") diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/examples/EX1/app.json index 8bc9459b0a..5eb997992c 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/examples/EX1/app.json +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/examples/EX1/app.json @@ -2,118 +2,113 @@ "rfInstance": { "nodes": [ { - "width": 384, - "height": 288, - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", - "type": "VISUALIZERS", + "width": 192, + "height": 192, + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "type": "IO", "data": { - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", - "label": "TEXT VIEW", - "func": "TEXT_VIEW", - "type": "VISUALIZERS", - "ctrls": {}, + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", + "type": "IO", + "ctrls": { + "device": { + "type": "VisaDevice", + "default": null, + "desc": "The VISA address to connect to.", + "overload": null, + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, "initCtrls": {}, "inputs": [ { "name": "default", "id": "default", - "type": "TextBlob", + "type": "Any", "multiple": false, - "desc": "the DataContainer to be visualized in text format" + "desc": null } ], - "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", "selected": false }, "position": { - "x": -73.10397672973124, - "y": -120.11566570130807 + "x": -886.7395156170513, + "y": -112.96725387394693 }, "selected": false, "positionAbsolute": { - "x": -73.10397672973124, - "y": -120.11566570130807 + "x": -886.7395156170513, + "y": -112.96725387394693 }, "dragging": true }, { - "width": 192, - "height": 192, - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", - "type": "IO", + "width": 225, + "height": 226, + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", + "type": "VISUALIZERS", "data": { - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", - "label": "CLOSE ALL", - "func": "CLOSE_ALL", - "type": "IO", + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", "ctrls": {}, "initCtrls": {}, "inputs": [ { "name": "default", "id": "default", - "type": "Any", + "type": "TextBlob", "multiple": false, - "desc": null - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Any", - "desc": "optional: The input DataContainer is returned." - } - ], - "pip_dependencies": [ - { - "name": "qcodes", - "v": "0.39.1" + "desc": "the DataContainer to be visualized in text format" } ], - "path": "IO/INSTRUMENTS/QCODES/CLOSE_ALL/CLOSE_ALL.py", + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", "selected": false }, "position": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -228.91602197898922, + "y": -130.8283743248985 }, "selected": false, "positionAbsolute": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -228.91602197898922, + "y": -130.8283743248985 }, "dragging": true }, { "width": 192, "height": 192, - "id": "OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16", + "id": "OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0", "type": "IO", "data": { - "id": "OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16", + "id": "OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0", "label": "OUTPUT SYNC 33510B", "func": "OUTPUT_SYNC_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "OUTPUT_SYNC_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "OUTPUT_SYNC_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -155,61 +150,39 @@ { "name": "default", "id": "default", - "type": "Any", - "desc": "TextBlob: ON or OFF depending on on_off value." - } - ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" + "type": "TextBlob", + "desc": "TextBlob: The channel, and ON or OFF depending on on_off value." } ], "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/OUTPUT_SYNC_33510B.py", "selected": false }, "position": { - "x": -510.11784179817596, - "y": -76.20285758215164 + "x": -576.8436213938844, + "y": -112.88858916855764 }, "selected": false, "positionAbsolute": { - "x": -510.11784179817596, - "y": -76.20285758215164 + "x": -576.8436213938844, + "y": -112.88858916855764 }, "dragging": true } ], "edges": [ { - "source": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", + "source": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", "sourceHandle": "default", - "target": "OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16", + "target": "OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0", "targetHandle": "default", - "id": "reactflow__edge-CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7default-OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16default" + "id": "reactflow__edge-CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027default-OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0default" }, { - "source": "OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16", + "source": "OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0", "sourceHandle": "default", - "target": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "target": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "targetHandle": "default", - "id": "reactflow__edge-OUTPUT_SYNC_33510B-3ac2323e-d6a3-44e7-b7b2-f89168e0ad16default-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" + "id": "reactflow__edge-OUTPUT_SYNC_33510B-a889708d-f110-42a5-a7ce-67c30d4eb9c0default-TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59bdefault" } ], "viewport": { diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/docstring.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/docstring.txt index 2f5e0fc149..3838008c5d 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/docstring.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/docstring.txt @@ -2,19 +2,16 @@ The SET_WAVEFORM_33510B node is used to set waveform settings for a 33510B. The Keysight 33510B has a variety of waveform settings available. - If the "VISA_address" parameter is not specified the VISA_index will be - used to find the address. The LIST_VISA node can be used to show the - indicies of all available VISA instruments. + Requires a CONNECTION_33510B node at the start of the app to connect with + the instrument. The VISA address will then be listed under 'connection'. This node should also work with compatible Keysight 33XXX wavefunction generators (although they are untested). Parameters ---------- - VISA_address: str - The VISA address to query. - VISA_index: int - The address will be found from LIST_VISA node list with this index. + connection: VisaConnection + The VISA address (requires the CONNECTION_MDO3XXX node). on_off: str Whether to turn the waveform generation to on or off. query_set: str @@ -41,4 +38,4 @@ The SET_WAVEFORM_33510B node is used to set waveform settings for a 33510B. Returns ------- DataContainer - Scalar: The waveform measurement in the selected statistic mode. + TextBlob: Summary of waveform generator settings. diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/python_code.txt b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/python_code.txt index 1b02ff10e4..d446053ac5 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/python_code.txt +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/a1-[autogen]/python_code.txt @@ -1,22 +1,10 @@ -from flojoy import flojoy, DataContainer, TextBlob -import pyvisa +from flojoy import flojoy, DataContainer, TextBlob, VisaConnection from typing import Optional, Literal -from qcodes.instrument_drivers.Keysight import Keysight33512B -from usb.core import USBError -@flojoy( - deps={ - "pyvisa": "1.13.0", - "pyusb": "1.2.1", - "zeroconf": "0.102.0", - "pyvisa_py": "0.7.0", - "qcodes": "0.39.1", - } -) +@flojoy(inject_connection=True) def SET_WAVEFORM_33510B( - VISA_address: Optional[str], - VISA_index: Optional[int] = 0, + connection: VisaConnection, on_off: Literal["ON", "OFF"] = "OFF", query_set: Literal["query", "set"] = "query", channel: Literal["ch1", "ch2"] = "ch1", @@ -31,25 +19,10 @@ def SET_WAVEFORM_33510B( ramp_symmetry: float = 50, pulse_width: float = 20, default: Optional[DataContainer] = None, -) -> Optional[DataContainer]: +) -> TextBlob: - rm = pyvisa.ResourceManager("@py") - if VISA_address == "": - VISA_addresses = rm.list_resources() - VISA_address = VISA_addresses[int(VISA_index)] - - try: - ks = Keysight33512B( - "ks", - VISA_address, - visalib="@py", - device_clear=False, - ) - except USBError as err: - raise Exception( - "USB port error. Trying unplugging+replugging the port." - ) from err + ks = connection.get_handle() channel_str = channel channel = getattr(ks, channel) @@ -106,6 +79,4 @@ def SET_WAVEFORM_33510B( if on_off == "ON": channel.output("ON") - ks.close() - return TextBlob(text_blob=summary) diff --git a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/examples/EX1/app.json b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/examples/EX1/app.json index d287b26ea9..df59690bd7 100644 --- a/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/examples/EX1/app.json +++ b/docs/nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/examples/EX1/app.json @@ -1,13 +1,66 @@ { "rfInstance": { "nodes": [ + { + "width": 192, + "height": 192, + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "type": "IO", + "data": { + "id": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", + "label": "CONNECTION 33510B", + "func": "CONNECTION_33510B", + "type": "IO", + "ctrls": { + "device": { + "type": "VisaDevice", + "default": null, + "desc": "The VISA address to connect to.", + "overload": null, + "functionName": "CONNECTION_33510B", + "param": "device", + "value": "USB0::2391::9735::MY59003244::0::INSTR" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Any", + "desc": "Optional: None" + } + ], + "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B.py", + "selected": false + }, + "position": { + "x": -979.7571031864528, + "y": -121.42339819843798 + }, + "selected": false, + "positionAbsolute": { + "x": -979.7571031864528, + "y": -121.42339819843798 + }, + "dragging": true + }, { "width": 384, "height": 288, - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "type": "VISUALIZERS", "data": { - "id": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "id": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "label": "TEXT VIEW", "func": "TEXT_VIEW", "type": "VISUALIZERS", @@ -26,45 +79,36 @@ "selected": false }, "position": { - "x": 126.63251436934425, - "y": -126.35743104815421 + "x": 131.5271298524416, + "y": -142.45557277107372 }, "selected": false, "positionAbsolute": { - "x": 126.63251436934425, - "y": -126.35743104815421 + "x": 131.5271298524416, + "y": -142.45557277107372 }, "dragging": true }, { "width": 192, "height": 192, - "id": "SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275a", + "id": "SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2", "type": "IO", "data": { - "id": "SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275a", - "label": "QUERY WAVEFORM 33510B", + "id": "SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2", + "label": "SET WAVEFORM", "func": "SET_WAVEFORM_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "SET_WAVEFORM_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "SET_WAVEFORM_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -89,7 +133,7 @@ "overload": null, "functionName": "SET_WAVEFORM_33510B", "param": "query_set", - "value": "query" + "value": "set" }, "channel": { "type": "select", @@ -207,75 +251,44 @@ { "name": "default", "id": "default", - "type": "Any", - "desc": "Scalar: The waveform measurement in the selected statistic mode." - } - ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" + "type": "TextBlob", + "desc": "TextBlob: Summary of waveform generator settings." } ], "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/SET_WAVEFORM_33510B.py", "selected": false }, "position": { - "x": -235.3146615647039, - "y": -80.09846489697861 + "x": -621.6271042931016, + "y": -120.43534000032497 }, "selected": false, "positionAbsolute": { - "x": -235.3146615647039, - "y": -80.09846489697861 + "x": -621.6271042931016, + "y": -120.43534000032497 }, "dragging": true }, { "width": 192, "height": 192, - "id": "SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5", + "id": "SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083f", "type": "IO", "data": { - "id": "SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5", - "label": "SET WAVEFORM 33510B 1", + "id": "SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083f", + "label": "QUERY WAVEFORM", "func": "SET_WAVEFORM_33510B", "type": "IO", "ctrls": { - "VISA_address": { - "type": "str", + "connection": { + "type": "VisaConnection", "default": null, - "desc": "The VISA address to query.", + "desc": "The VISA address (requires the CONNECTION_MDO3XXX node).", "overload": null, "functionName": "SET_WAVEFORM_33510B", - "param": "VISA_address", + "param": "connection", "value": "USB0::2391::9735::MY59003244::0::INSTR" }, - "VISA_index": { - "type": "int", - "default": 0, - "desc": "The address will be found from LIST_VISA node list with this index.", - "overload": null, - "functionName": "SET_WAVEFORM_33510B", - "param": "VISA_index", - "value": 0 - }, "on_off": { "type": "select", "options": [ @@ -287,7 +300,7 @@ "overload": null, "functionName": "SET_WAVEFORM_33510B", "param": "on_off", - "value": "OFF" + "value": "ON" }, "query_set": { "type": "select", @@ -300,7 +313,7 @@ "overload": null, "functionName": "SET_WAVEFORM_33510B", "param": "query_set", - "value": "set" + "value": "query" }, "channel": { "type": "select", @@ -351,7 +364,7 @@ "overload": null, "functionName": "SET_WAVEFORM_33510B", "param": "amplitude", - "value": 0.2 + "value": 0.1 }, "amplitude_unit": { "type": "select", @@ -418,117 +431,46 @@ { "name": "default", "id": "default", - "type": "Any", - "desc": "Scalar: The waveform measurement in the selected statistic mode." - } - ], - "pip_dependencies": [ - { - "name": "pyvisa", - "v": "1.13.0" - }, - { - "name": "pyusb", - "v": "1.2.1" - }, - { - "name": "zeroconf", - "v": "0.102.0" - }, - { - "name": "pyvisa_py", - "v": "0.7.0" - }, - { - "name": "qcodes", - "v": "0.39.1" + "type": "TextBlob", + "desc": "TextBlob: Summary of waveform generator settings." } ], "path": "IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/SET_WAVEFORM_33510B.py", "selected": false }, "position": { - "x": -587.0980217998496, - "y": -74.46641189574345 - }, - "selected": false, - "positionAbsolute": { - "x": -587.0980217998496, - "y": -74.46641189574345 - }, - "dragging": true - }, - { - "width": 192, - "height": 192, - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", - "type": "IO", - "data": { - "id": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", - "label": "CLOSE ALL", - "func": "CLOSE_ALL", - "type": "IO", - "ctrls": {}, - "initCtrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "Any", - "multiple": false, - "desc": null - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Any", - "desc": "optional: The input DataContainer is returned." - } - ], - "pip_dependencies": [ - { - "name": "qcodes", - "v": "0.39.1" - } - ], - "path": "IO/INSTRUMENTS/QCODES/CLOSE_ALL/CLOSE_ALL.py", - "selected": false - }, - "position": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -249.25622073246237, + "y": -118.32870369988929 }, "selected": false, "positionAbsolute": { - "x": -919.3821328184661, - "y": -74.54262269929615 + "x": -249.25622073246237, + "y": -118.32870369988929 }, "dragging": true } ], "edges": [ { - "source": "SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275a", + "source": "CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027", "sourceHandle": "default", - "target": "TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0e", + "target": "SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2", "targetHandle": "default", - "id": "reactflow__edge-SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275adefault-TEXT_VIEW-819c7e1c-0ff5-4c09-8a13-b65b1e1bab0edefault" + "id": "reactflow__edge-CONNECTION_33510B-4c8ca1dd-a8ee-4ba9-ae8b-886c80a0a027default-SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2default" }, { - "source": "SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5", + "source": "SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2", "sourceHandle": "default", - "target": "SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275a", + "target": "SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083f", "targetHandle": "default", - "id": "reactflow__edge-SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5default-SET_WAVEFORM_33510B-5d984289-23fd-4a07-8581-9e67f458275adefault" + "id": "reactflow__edge-SET_WAVEFORM_33510B-0ab66699-2865-4958-ac92-6ff441f13cf2default-SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083fdefault" }, { - "source": "CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7", + "source": "SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083f", "sourceHandle": "default", - "target": "SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5", + "target": "TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59b", "targetHandle": "default", - "id": "reactflow__edge-CLOSE_ALL-5ce40df5-d7b2-4c4c-a350-028ed7d948d7default-SET_WAVEFORM_33510B-cff57b5b-40b6-48a6-bce1-b72039d971a5default" + "id": "reactflow__edge-SET_WAVEFORM_33510B-9dc26886-d55d-4825-bb40-7f86db98083fdefault-TEXT_VIEW-1e087237-ee3a-4db7-963d-46fbdbd7b59bdefault" } ], "viewport": { diff --git a/nodeSidebar.json b/nodeSidebar.json index 67bff8ce72..6b4da632bc 100644 --- a/nodeSidebar.json +++ b/nodeSidebar.json @@ -151,6 +151,7 @@ "I/O > Function Generators": [ "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/BURST_MODE_33510B/BURST_MODE_33510B", "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/ADVANCED/RETURN_ERRORS_33510B/RETURN_ERRORS_33510B", + "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/CONNECTION_33510B/CONNECTION_33510B", "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/ON_OFF_33510B/ON_OFF_33510B", "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/OUTPUT_SYNC_33510B/OUTPUT_SYNC_33510B", "nodes/IO/INSTRUMENTS/FUNCTION_GENERATORS/KEYSIGHT/33XXX/BASIC/SET_WAVEFORM_33510B/SET_WAVEFORM_33510B" From 7ca85379d933ab8076edbea33f30e1fc376ed463 Mon Sep 17 00:00:00 2001 From: dstrande Date: Thu, 28 Sep 2023 18:09:05 +0000 Subject: [PATCH 3/4] update: Merge branch 'develop' into dallas/nod-74-usb-4065-dmm-nodes --- .../SORT_VECTOR/a1-[autogen]/docstring.txt | 5 +++++ .../SORT_VECTOR/a1-[autogen]/python_code.txt | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/docstring.txt index e0b1d3fc15..bb1385bc85 100644 --- a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/docstring.txt +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/docstring.txt @@ -5,6 +5,11 @@ The SORT_VECTOR node returns the input Vector that is sorted default : Vector The input vector + Parameters + ---------- + reverse : bool + If False, sort in ascending order. If True, descending order. + Returns ------- Vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/python_code.txt index e908201a23..147351de6d 100644 --- a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SORT_VECTOR/a1-[autogen]/python_code.txt @@ -4,7 +4,7 @@ from flojoy import flojoy, Vector @flojoy def SORT_VECTOR( default: Vector, + reverse: bool = False, ) -> Vector: - - return Vector(v=sorted(default.v)) + return Vector(v=sorted(default.v, reverse=reverse)) From f1c71d924fa0a5e0a179aa1dc69d745f14175665 Mon Sep 17 00:00:00 2001 From: dstrande Date: Fri, 29 Sep 2023 15:47:37 +0000 Subject: [PATCH 4/4] update: Merge branch 'develop' into dallas/nod-74-usb-4065-dmm-nodes --- .../REPLACE_SUBSET/REPLACE_SUBSET.md | 57 ++ .../REPLACE_SUBSET/a1-[autogen]/docstring.txt | 22 + .../a1-[autogen]/python_code.txt | 37 ++ .../REPLACE_SUBSET/appendix/hardware.md | 1 + .../REPLACE_SUBSET/appendix/media.md | 1 + .../REPLACE_SUBSET/appendix/notes.md | 1 + .../REPLACE_SUBSET/examples/EX1/app.json | 314 +++++++++++ .../REPLACE_SUBSET/examples/EX1/example.md | 1 + .../SHIFT_VECTOR/SHIFT_VECTOR.md | 57 ++ .../SHIFT_VECTOR/a1-[autogen]/docstring.txt | 16 + .../SHIFT_VECTOR/a1-[autogen]/python_code.txt | 10 + .../SHIFT_VECTOR/appendix/hardware.md | 1 + .../SHIFT_VECTOR/appendix/media.md | 1 + .../SHIFT_VECTOR/appendix/notes.md | 1 + .../SHIFT_VECTOR/examples/EX1/app.json | 520 ++++++++++++++++++ .../SHIFT_VECTOR/examples/EX1/example.md | 1 + .../VECTOR_DELETE/VECTOR_DELETE.md | 57 ++ .../VECTOR_DELETE/a1-[autogen]/docstring.txt | 19 + .../a1-[autogen]/python_code.txt | 27 + .../VECTOR_DELETE/appendix/hardware.md | 1 + .../VECTOR_DELETE/appendix/media.md | 1 + .../VECTOR_DELETE/appendix/notes.md | 1 + .../VECTOR_DELETE/examples/EX1/app.json | 255 +++++++++ .../VECTOR_DELETE/examples/EX1/example.md | 1 + .../a1-[autogen]/python_code.txt | 4 +- .../VECTOR_INSERT/VECTOR_INSERT.md | 57 ++ .../VECTOR_INSERT/a1-[autogen]/docstring.txt | 20 + .../a1-[autogen]/python_code.txt | 19 + .../VECTOR_INSERT/appendix/hardware.md | 1 + .../VECTOR_INSERT/appendix/media.md | 1 + .../VECTOR_INSERT/appendix/notes.md | 1 + .../VECTOR_INSERT/examples/EX1/app.json | 324 +++++++++++ .../VECTOR_INSERT/examples/EX1/example.md | 1 + .../VECTOR_MAX/VECTOR_MAX.md | 57 ++ .../VECTOR_MAX/a1-[autogen]/docstring.txt | 11 + .../VECTOR_MAX/a1-[autogen]/python_code.txt | 9 + .../VECTOR_MAX/appendix/hardware.md | 1 + .../VECTOR_MAX/appendix/media.md | 1 + .../VECTOR_MAX/appendix/notes.md | 1 + .../VECTOR_MAX/examples/EX1/app.json | 376 +++++++++++++ .../VECTOR_MAX/examples/EX1/example.md | 1 + .../VECTOR_MIN/VECTOR_MIN.md | 57 ++ .../VECTOR_MIN/a1-[autogen]/docstring.txt | 11 + .../VECTOR_MIN/a1-[autogen]/python_code.txt | 9 + .../VECTOR_MIN/appendix/hardware.md | 1 + .../VECTOR_MIN/appendix/media.md | 1 + .../VECTOR_MIN/appendix/notes.md | 1 + .../VECTOR_MIN/examples/EX1/app.json | 376 +++++++++++++ .../VECTOR_MIN/examples/EX1/example.md | 1 + .../VECTOR_SUBSET/VECTOR_SUBSET.md | 57 ++ .../VECTOR_SUBSET/a1-[autogen]/docstring.txt | 18 + .../a1-[autogen]/python_code.txt | 27 + .../VECTOR_SUBSET/appendix/hardware.md | 1 + .../VECTOR_SUBSET/appendix/media.md | 1 + .../VECTOR_SUBSET/appendix/notes.md | 1 + .../VECTOR_SUBSET/examples/EX1/app.json | 305 ++++++++++ .../VECTOR_SUBSET/examples/EX1/example.md | 1 + 57 files changed, 3154 insertions(+), 2 deletions(-) create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/REPLACE_SUBSET.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/VECTOR_DELETE.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/VECTOR_INSERT.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/example.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/VECTOR_SUBSET.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/hardware.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/media.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/notes.md create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/app.json create mode 100644 docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/example.md diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/REPLACE_SUBSET.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/REPLACE_SUBSET.md new file mode 100644 index 0000000000..5fc65b0339 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/REPLACE_SUBSET.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..f0ba24495f --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/docstring.txt @@ -0,0 +1,22 @@ +The REPLACE_SUBSET node returns a new Vector with subset of elements replaced. + + Inputs + ------ + v : Vector + The input vector to replace subset from + + Parameters + ---------- + indices: Array + specified indices to replace values at from the input vector + + values: Array + subset of values to replace the specified indices + + length: int + number of elements to replace from the input vector, default is 1 (this only applies when one index is specified for indices parameter) + + Returns + ------- + Vector + The new vector with subset of elements replaced from the input vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..fcdf3a6c67 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/a1-[autogen]/python_code.txt @@ -0,0 +1,37 @@ +from numpy import any, array, arange, put +from flojoy import flojoy, Vector, Array + + +@flojoy +def REPLACE_SUBSET( + default: Vector, indices: Array, values: Array, length: int = 1 +) -> Vector: + + + # unwrap the indices first + indices = array(indices.unwrap(), dtype=int) + # unwrap the values next + values = array(values.unwrap(), dtype=int) + + assert len(default.v) > len( + indices + ), "The length of indices parameter must be less than the length of the Vector." + assert any(indices >= 0), "The indices must be greater than zero." + + if len(indices) == 1: + assert (indices[0] + (length - 1)) < len( + default.v + ), "The length of items to delete starting from index parameter must not exceed the length of the Vector." + + if len(indices) > 1: + assert len(indices) == len( + values + ), "The number of indices and the number of correpsonding elements must be equal." + put(default.v, indices, values) + else: + assert length == len( + values + ), "The number of indices and the number of correpsonding elements must be equal." + indices = arange(indices[0], length) + put(default.v, indices, values) + return Vector(v=default.v) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/app.json new file mode 100644 index 0000000000..2da285bbb2 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/app.json @@ -0,0 +1,314 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 160, + "height": 160, + "id": "REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643", + "type": "TRANSFORMERS", + "data": { + "id": "REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643", + "label": "REPLACE SUBSET", + "func": "REPLACE_SUBSET", + "type": "TRANSFORMERS", + "ctrls": { + "indices": { + "type": "Array", + "default": null, + "desc": "specified indices to replace values at from the input vector", + "overload": null, + "functionName": "REPLACE_SUBSET", + "param": "indices", + "value": "1,4,6" + }, + "values": { + "type": "Array", + "default": null, + "desc": "subset of values to replace the specified indices", + "overload": null, + "functionName": "REPLACE_SUBSET", + "param": "values", + "value": "-5,22,13" + }, + "length": { + "type": "int", + "default": 1, + "desc": "number of elements to replace from the input vector, default is 1 (this only applies when one index is specified for indices parameter)", + "overload": null, + "functionName": "REPLACE_SUBSET", + "param": "length", + "value": 3 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector with subset of elements replaced from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/REPLACE_SUBSET.py", + "selected": false + }, + "position": { + "x": 46.292395321543836, + "y": -191.62402629147334 + }, + "selected": false, + "positionAbsolute": { + "x": 46.292395321543836, + "y": -191.62402629147334 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-773b378b-53c4-41db-a6e0-62bd9a366bcb", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-773b378b-53c4-41db-a6e0-62bd9a366bcb", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -259.1040792489622, + "y": -159.2030807433828 + }, + "selected": false, + "positionAbsolute": { + "x": -259.1040792489622, + "y": -159.2030807433828 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 337.9370892627744, + "y": -261.0285656908869 + }, + "selected": false, + "positionAbsolute": { + "x": 337.9370892627744, + "y": -261.0285656908869 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "TEXT-f7ac9b15-5256-41be-8944-6622466175bc", + "type": "GENERATORS", + "data": { + "id": "TEXT-f7ac9b15-5256-41be-8944-6622466175bc", + "label": "TEXT", + "func": "TEXT", + "type": "GENERATORS", + "ctrls": { + "value": { + "type": "str", + "default": "Hello World!", + "desc": "The value set in Parameters", + "overload": null, + "functionName": "TEXT", + "param": "value", + "value": "This app replaces the subsets of the input vector according to the values and corresponding indices specified. In this example, elements -5, 22, and 13 have been specified to replace the elements in indices 1, 4, and 6. " + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "_", + "id": "_", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "text_blob: return the value being set in Parameters" + } + ], + "path": "GENERATORS/SIMULATIONS/TEXT/TEXT.py", + "selected": true + }, + "position": { + "x": 884.1369074495883, + "y": -162.24699099748312 + }, + "selected": true, + "positionAbsolute": { + "x": 884.1369074495883, + "y": -162.24699099748312 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-477492c2-b628-4289-9a51-528af5e09d70", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-477492c2-b628-4289-9a51-528af5e09d70", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 784.046104132004, + "y": -520.1653348334285 + }, + "selected": false, + "positionAbsolute": { + "x": 784.046104132004, + "y": -520.1653348334285 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-773b378b-53c4-41db-a6e0-62bd9a366bcb", + "sourceHandle": "default", + "target": "REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-773b378b-53c4-41db-a6e0-62bd9a366bcbdefault-REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643default" + }, + { + "source": "REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643", + "sourceHandle": "default", + "target": "SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5", + "targetHandle": "default", + "id": "reactflow__edge-REPLACE_SUBSET-1ceabec0-02a8-481d-bb7d-4b2ae7f0c643default-SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5default" + }, + { + "source": "SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5", + "sourceHandle": "default", + "target": "TEXT-f7ac9b15-5256-41be-8944-6622466175bc", + "targetHandle": "_", + "id": "reactflow__edge-SCATTER-ac863ad4-e233-40ac-a67e-239e7cf8acb5default-TEXT-f7ac9b15-5256-41be-8944-6622466175bc_" + }, + { + "source": "TEXT-f7ac9b15-5256-41be-8944-6622466175bc", + "sourceHandle": "default", + "target": "TEXT_VIEW-477492c2-b628-4289-9a51-528af5e09d70", + "targetHandle": "default", + "id": "reactflow__edge-TEXT-f7ac9b15-5256-41be-8944-6622466175bcdefault-TEXT_VIEW-477492c2-b628-4289-9a51-528af5e09d70default" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/example.md new file mode 100644 index 0000000000..7e7b7a33fd --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/REPLACE_SUBSET/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector by using a `LINSPACE` node. Then indices 1, 4, 6 are replaced with values -5, 22, 13 respectively using `REPLACE_SUBSET`. The resulting vector is visualized with `SCATTER` node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.md new file mode 100644 index 0000000000..955f448172 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..695dcb0121 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The SHIFT_VECTOR node shifts the elements in the vector by the amount specified + + Inputs + ------ + v : Vector + The input vector to shift elements from + + Parameters + ---------- + shift: int + the number of places in which elements are moved (negative values will shift them to the left) + + Returns + ------- + Vector + The new vector with elements shifted diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..da35195590 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/a1-[autogen]/python_code.txt @@ -0,0 +1,10 @@ +from numpy import roll +from flojoy import flojoy, Vector + + +@flojoy +def SHIFT_VECTOR(default: Vector, shift: int = 1) -> Vector: + + + v = roll(default.v, shift) + return Vector(v=v) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/app.json new file mode 100644 index 0000000000..1da935c49c --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/app.json @@ -0,0 +1,520 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 208, + "height": 96, + "id": "LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -223.86517863731433, + "y": 120.02433306680166 + }, + "selected": false, + "positionAbsolute": { + "x": -223.86517863731433, + "y": 120.02433306680166 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-fc390cc7-cd39-478c-b149-44510a1abc55", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-fc390cc7-cd39-478c-b149-44510a1abc55", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 467.0975797559655, + "y": -172.3190063382396 + }, + "selected": false, + "positionAbsolute": { + "x": 467.0975797559655, + "y": -172.3190063382396 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-c4aaa4eb-367d-49f9-944a-de4aa7b5eab7", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-c4aaa4eb-367d-49f9-944a-de4aa7b5eab7", + "label": "SCATTER 1", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 443.10500366948986, + "y": 179.3090438343204 + }, + "selected": false, + "positionAbsolute": { + "x": 443.10500366948986, + "y": 179.3090438343204 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-a3ecb471-ef0c-4af6-9b42-8b85d63aa15b", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-a3ecb471-ef0c-4af6-9b42-8b85d63aa15b", + "label": "LINSPACE 1", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -223.96114622718932, + "y": 707.270566627652 + }, + "selected": false, + "positionAbsolute": { + "x": -223.96114622718932, + "y": 707.270566627652 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-4cd82265-65b6-462c-9523-286c65163e01", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-4cd82265-65b6-462c-9523-286c65163e01", + "label": "SCATTER 2", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 461.85436957217325, + "y": 633.327989002352 + }, + "selected": false, + "positionAbsolute": { + "x": 461.85436957217325, + "y": 633.327989002352 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "TEXT-3c162e78-3b90-4392-9ef6-8988c48bac83", + "type": "GENERATORS", + "data": { + "id": "TEXT-3c162e78-3b90-4392-9ef6-8988c48bac83", + "label": "TEXT", + "func": "TEXT", + "type": "GENERATORS", + "ctrls": { + "value": { + "type": "str", + "default": "Hello World!", + "desc": "The value set in Parameters", + "overload": null, + "functionName": "TEXT", + "param": "value", + "value": "This app shows elements in the vector can be rotated (i.e shifted) in both directions. The one on the top shows elements that are shifted to the right by 3. The one on the bottom shows the elements that are shifted to the left by 3." + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "_", + "id": "_", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "text_blob: return the value being set in Parameters" + } + ], + "path": "GENERATORS/SIMULATIONS/TEXT/TEXT.py", + "selected": false + }, + "position": { + "x": 931.0391647029419, + "y": 248.74566673722245 + }, + "selected": false, + "positionAbsolute": { + "x": 931.0391647029419, + "y": 248.74566673722245 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-e7df43bd-4f8a-45d5-8b38-ee14fa4d26ef", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-e7df43bd-4f8a-45d5-8b38-ee14fa4d26ef", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": false + }, + "position": { + "x": 1353.5947356865488, + "y": 172.47563144496644 + }, + "selected": false, + "positionAbsolute": { + "x": 1353.5947356865488, + "y": 172.47563144496644 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8c", + "type": "TRANSFORMERS", + "data": { + "id": "SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8c", + "label": "SHIFT VECTOR", + "func": "SHIFT_VECTOR", + "type": "TRANSFORMERS", + "ctrls": { + "shift": { + "type": "int", + "default": 1, + "desc": "the number of places in which elements are moved (negative values will shift them to the left)", + "overload": null, + "functionName": "SHIFT_VECTOR", + "param": "shift", + "value": 3 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector with elements shifted" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.py", + "selected": false + }, + "position": { + "x": 132.48736880826465, + "y": -42.665656394050814 + }, + "selected": false, + "positionAbsolute": { + "x": 132.48736880826465, + "y": -42.665656394050814 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0", + "type": "TRANSFORMERS", + "data": { + "id": "SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0", + "label": "SHIFT VECTOR 1", + "func": "SHIFT_VECTOR", + "type": "TRANSFORMERS", + "ctrls": { + "shift": { + "type": "int", + "default": 1, + "desc": "the number of places in which elements are moved (negative values will shift them to the left)", + "overload": null, + "functionName": "SHIFT_VECTOR", + "param": "shift", + "value": -3 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector with elements shifted" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/SHIFT_VECTOR.py", + "selected": false + }, + "position": { + "x": 124.56549480602405, + "y": 654.762527395164 + }, + "selected": false, + "positionAbsolute": { + "x": 124.56549480602405, + "y": 654.762527395164 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0", + "sourceHandle": "default", + "target": "SCATTER-c4aaa4eb-367d-49f9-944a-de4aa7b5eab7", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0default-SCATTER-c4aaa4eb-367d-49f9-944a-de4aa7b5eab7default" + }, + { + "source": "TEXT-3c162e78-3b90-4392-9ef6-8988c48bac83", + "sourceHandle": "default", + "target": "TEXT_VIEW-e7df43bd-4f8a-45d5-8b38-ee14fa4d26ef", + "targetHandle": "default", + "id": "reactflow__edge-TEXT-3c162e78-3b90-4392-9ef6-8988c48bac83default-TEXT_VIEW-e7df43bd-4f8a-45d5-8b38-ee14fa4d26efdefault" + }, + { + "source": "SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8c", + "sourceHandle": "default", + "target": "SCATTER-fc390cc7-cd39-478c-b149-44510a1abc55", + "targetHandle": "default", + "id": "reactflow__edge-SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8cdefault-SCATTER-fc390cc7-cd39-478c-b149-44510a1abc55default" + }, + { + "source": "LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0", + "sourceHandle": "default", + "target": "SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8c", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-e379dbbd-8e84-49d0-a55a-73c7bb83a9d0default-SHIFT_VECTOR-19f0b259-c5c9-4691-bb1d-266f00b6bb8cdefault" + }, + { + "source": "LINSPACE-a3ecb471-ef0c-4af6-9b42-8b85d63aa15b", + "sourceHandle": "default", + "target": "SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-a3ecb471-ef0c-4af6-9b42-8b85d63aa15bdefault-SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0default" + }, + { + "source": "SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0", + "sourceHandle": "default", + "target": "SCATTER-4cd82265-65b6-462c-9523-286c65163e01", + "targetHandle": "default", + "id": "reactflow__edge-SHIFT_VECTOR-344524df-0eae-49bf-ad50-c5dfcae04ca0default-SCATTER-4cd82265-65b6-462c-9523-286c65163e01default" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/example.md new file mode 100644 index 0000000000..14fa488195 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/SHIFT_VECTOR/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector by using a `LINSPACE` node. Then specify the amount to shift in the vector with `ROTATE_VECTOR` node. In this case, we are only shifting 3 places to the right. The resulting vector is visualized with `SCATTER` node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/VECTOR_DELETE.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/VECTOR_DELETE.md new file mode 100644 index 0000000000..269905c29d --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/VECTOR_DELETE.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..4c401b6c4b --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/docstring.txt @@ -0,0 +1,19 @@ +The VECTOR_DELETE node returns a new Vector with elements deleted from requested indices + + Inputs + ------ + v : Vector + The input vector to delete from + + Parameters + ---------- + indices: Array + specified indices to delete value(s) at from the input vector + + length: int + number of elements to delete from the input vector, default is 1 (this only applies when one index is specified for indices parameter) + + Returns + ------- + Vector + The new vector with element(s) deleted from the input vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..07ced89bc1 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from numpy import any, array, delete, arange +from flojoy import flojoy, Vector, Array + + +@flojoy +def VECTOR_DELETE(default: Vector, indices: Array, length: int = 1) -> Vector: + + + # unwrap the indices first + indices = array(indices.unwrap(), dtype=int) + + assert len(default.v) > len( + indices + ), "The length of indices parameter must be less than the length of the Vector." + assert any(indices >= 0), "The indices must be greater than zero." + + if len(indices) == 1: + assert (indices[0] + (length - 1)) < len( + default.v + ), "The length of items to delete starting from index parameter must not exceed the length of the Vector." + + if len(indices) > 1: + v = delete(default.v, indices, None) + else: + indices = arange(indices[0], length) + v = delete(default.v, indices, None) + return Vector(v=v) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/app.json new file mode 100644 index 0000000000..788f604430 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/app.json @@ -0,0 +1,255 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 208, + "height": 96, + "id": "LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 5 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -158.11513318068995, + "y": 2.8433502380470372 + }, + "selected": false, + "positionAbsolute": { + "x": -158.11513318068995, + "y": 2.8433502380470372 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0", + "label": "VECTOR DELETE", + "func": "VECTOR_DELETE", + "type": "TRANSFORMERS", + "ctrls": { + "indices": { + "type": "Array", + "default": null, + "desc": "specified indices to delete value(s) at from the input vector", + "overload": null, + "functionName": "VECTOR_DELETE", + "param": "indices", + "value": "0" + }, + "length": { + "type": "int", + "default": 1, + "desc": "number of elements to delete from the input vector, default is 1 (this only applies when one index is specified for indices parameter)", + "overload": null, + "functionName": "VECTOR_DELETE", + "param": "length", + "value": 2 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector with element(s) deleted from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/VECTOR_DELETE.py", + "selected": false + }, + "position": { + "x": 178.79385899805402, + "y": -68.85894937989926 + }, + "selected": false, + "positionAbsolute": { + "x": 178.79385899805402, + "y": -68.85894937989926 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-69115da9-f7af-44a0-ad96-a2ae12da4166", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-69115da9-f7af-44a0-ad96-a2ae12da4166", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 420.16869133149214, + "y": -252.87031100366278 + }, + "selected": false, + "positionAbsolute": { + "x": 420.16869133149214, + "y": -252.87031100366278 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-439c772a-837a-424d-bd07-656245e01cc9", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-439c772a-837a-424d-bd07-656245e01cc9", + "label": "SCATTER 1", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": true + }, + "position": { + "x": 410.27706108811014, + "y": 135.72610592210992 + }, + "selected": true, + "positionAbsolute": { + "x": 410.27706108811014, + "y": 135.72610592210992 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12", + "sourceHandle": "default", + "target": "VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12default-VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0default", + "selected": false + }, + { + "source": "VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0", + "sourceHandle": "default", + "target": "SCATTER-69115da9-f7af-44a0-ad96-a2ae12da4166", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_DELETE-454ae648-0ca5-4e30-8f6e-56edfee71ff0default-SCATTER-69115da9-f7af-44a0-ad96-a2ae12da4166default" + }, + { + "source": "LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12", + "sourceHandle": "default", + "target": "SCATTER-439c772a-837a-424d-bd07-656245e01cc9", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-f80c30e0-eb44-4a25-94bb-f95afa92ad12default-SCATTER-439c772a-837a-424d-bd07-656245e01cc9default", + "selected": false + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/example.md new file mode 100644 index 0000000000..8d619890da --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_DELETE/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector by using a `LINSPACE` node. Then starting from index 0, 2 elements are deleted using `VECTOR_DELETE`. The resulting vector is visualized with `SCATTER` node, and another node has been connected to `LINSPACE` for comparison. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INDEXING/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INDEXING/a1-[autogen]/python_code.txt index b0301e125d..873aa60acc 100644 --- a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INDEXING/a1-[autogen]/python_code.txt +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INDEXING/a1-[autogen]/python_code.txt @@ -1,4 +1,3 @@ -import numpy as np from flojoy import flojoy, Vector, Scalar @@ -8,10 +7,11 @@ def VECTOR_INDEXING( index: int = 0, ) -> Scalar: + assert ( len(default.v) > index ), "The index parameter must be less than the length of the Vector." - assert index >= 0, "The index parameter greater than zero." + assert index >= 0, "The index parameter must be greater than zero." c = default.v[index] return Scalar(c=c) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/VECTOR_INSERT.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/VECTOR_INSERT.md new file mode 100644 index 0000000000..4fd865b6f5 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/VECTOR_INSERT.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..c8ac816d43 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/docstring.txt @@ -0,0 +1,20 @@ +The VECTOR_INSERT node inserts a value to the Vector at the + specified index. + + Inputs + ------ + v : Vector + The input vector to insert value. + + Parameters + ---------- + element: int + The value to add to the input vector. + + index: int + The index of the vector to insert value. + + Returns + ------- + Vector + The new vector that contains the inserted value diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..8cf00d7cb4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +from numpy import concatenate, array +from flojoy import flojoy, Vector + + +@flojoy +def VECTOR_INSERT(default: Vector, index: int = 0, value: int = 0) -> Vector: + + + assert ( + len(default.v) > index + ), "The index parameter must be less than the length of the Vector." + assert index >= 0, "The index parameter must be greater than zero." + + if index == len(default.v) - 1: + v = concatenate((default.v, [value])) + else: + v = concatenate((default.v[:index], [value], default.v[index:])) + + return Vector(v=v) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/app.json new file mode 100644 index 0000000000..1652cf0ed4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/app.json @@ -0,0 +1,324 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 160, + "height": 160, + "id": "VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0a", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0a", + "label": "VECTOR INSERT", + "func": "VECTOR_INSERT", + "type": "TRANSFORMERS", + "ctrls": { + "index": { + "type": "int", + "default": 0, + "desc": "The index of the vector to insert value.", + "overload": null, + "functionName": "VECTOR_INSERT", + "param": "index", + "value": 0 + }, + "value": { + "type": "int", + "default": 0, + "desc": null, + "overload": null, + "functionName": "VECTOR_INSERT", + "param": "value", + "value": 13 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector that contains the inserted value" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/VECTOR_INSERT.py", + "selected": false + }, + "position": { + "x": 132.73363980782221, + "y": -275.2712172943302 + }, + "selected": false, + "positionAbsolute": { + "x": 132.73363980782221, + "y": -275.2712172943302 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-7a9f9fab-e8a8-490e-bb79-11dd2920655e", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-7a9f9fab-e8a8-490e-bb79-11dd2920655e", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -226.17189847801404, + "y": -236.96939764894648 + }, + "selected": false, + "positionAbsolute": { + "x": -226.17189847801404, + "y": -236.96939764894648 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-3cdae249-bfc6-414c-90ca-676c409f63a1", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-3cdae249-bfc6-414c-90ca-676c409f63a1", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 530.9194383287412, + "y": -298.5003635099639 + }, + "selected": false, + "positionAbsolute": { + "x": 530.9194383287412, + "y": -298.5003635099639 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-c18dd94e-5173-4351-9199-ef26d10df28d", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-c18dd94e-5173-4351-9199-ef26d10df28d", + "label": "LINSPACE 1", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -238.30662033776346, + "y": 15.672223666923344 + }, + "selected": false, + "positionAbsolute": { + "x": -238.30662033776346, + "y": 15.672223666923344 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-cf0df1c2-d8f3-440d-be66-050f14028a73", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-cf0df1c2-d8f3-440d-be66-050f14028a73", + "label": "SCATTER 1", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": true + }, + "position": { + "x": 122.75760249507664, + "y": -19.02508588254443 + }, + "selected": true, + "positionAbsolute": { + "x": 122.75760249507664, + "y": -19.02508588254443 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-7a9f9fab-e8a8-490e-bb79-11dd2920655e", + "sourceHandle": "default", + "target": "VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0a", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-7a9f9fab-e8a8-490e-bb79-11dd2920655edefault-VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0adefault" + }, + { + "source": "VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0a", + "sourceHandle": "default", + "target": "SCATTER-3cdae249-bfc6-414c-90ca-676c409f63a1", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_INSERT-933e0106-5454-4bef-aa54-33e8537e0c0adefault-SCATTER-3cdae249-bfc6-414c-90ca-676c409f63a1default" + }, + { + "source": "LINSPACE-c18dd94e-5173-4351-9199-ef26d10df28d", + "sourceHandle": "default", + "target": "SCATTER-cf0df1c2-d8f3-440d-be66-050f14028a73", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-c18dd94e-5173-4351-9199-ef26d10df28ddefault-SCATTER-cf0df1c2-d8f3-440d-be66-050f14028a73default" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/example.md new file mode 100644 index 0000000000..560d9e6876 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_INSERT/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector by using a `LINSPACE` node. Then, a value specified (13) is inserted at index 0 `VECTOR_INSERT`. The value is visualized with `SCATTER` node. Another set of example excluding `VECTOR_INSERT` node has been added for comparison. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.md new file mode 100644 index 0000000000..1ee225fb68 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..a05015a675 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +The VECTOR_MAX node returns the maximum value from the Vector + + Inputs + ------ + v : Vector + The input vector to use max peration + + Returns + ------- + Scalar + The maximum value found from the input vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..8511d82d79 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/a1-[autogen]/python_code.txt @@ -0,0 +1,9 @@ +import numpy as np +from flojoy import flojoy, Vector, Scalar + + +@flojoy +def VECTOR_MAX(default: Vector) -> Scalar: + + + return Scalar(c=np.max(default.v)) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/app.json new file mode 100644 index 0000000000..98e1f718db --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/app.json @@ -0,0 +1,376 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 160, + "height": 160, + "id": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "label": "VECTOR MAX", + "func": "VECTOR_MAX", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "The maximum value found from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.py", + "selected": false + }, + "position": { + "x": 130.31981266859236, + "y": -328.83929636806715 + }, + "selected": false, + "positionAbsolute": { + "x": 130.31981266859236, + "y": -328.83929636806715 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "label": "VECTOR MIN", + "func": "VECTOR_MIN", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "The minimum value found from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.py", + "selected": false + }, + "position": { + "x": 145.13349056115274, + "y": 35.87207046216116 + }, + "selected": false, + "positionAbsolute": { + "x": 145.13349056115274, + "y": 35.87207046216116 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 8 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 50 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 200 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -321.7726099556296, + "y": -142.40389954737725 + }, + "selected": false, + "positionAbsolute": { + "x": -321.7726099556296, + "y": -142.40389954737725 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether to show relative delta from last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 523.8297982318611, + "y": -364.2688477798421 + }, + "selected": false, + "positionAbsolute": { + "x": 523.8297982318611, + "y": -364.2688477798421 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether to show relative delta from last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 531.0832930102642, + "y": 7.055164039401802 + }, + "selected": false, + "positionAbsolute": { + "x": 531.0832930102642, + "y": 7.055164039401802 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "sourceHandle": "default", + "target": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48default-VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3default" + }, + { + "source": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "sourceHandle": "default", + "target": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48default-VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ffdefault" + }, + { + "source": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "sourceHandle": "default", + "target": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3default-BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5default" + }, + { + "source": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "sourceHandle": "default", + "target": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ffdefault-BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152default" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/example.md new file mode 100644 index 0000000000..ad5f2b9948 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector starting from 8 and ending at 50 by using a `LINSPACE` node. Then a `VECTOR_MAX` node is connected to the example vector where it will find the maximum value and the one below will find the minimum value. The value is visualized with `BIG_NUMBER` node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.md new file mode 100644 index 0000000000..6aef5d9dff --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..d8033d9379 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +The VECTOR_MIN node returns the minimum value from the Vector + + Inputs + ------ + v : Vector + The input vector to use min peration + + Returns + ------- + Scalar + The minimum value found from the input vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..56563e9a5c --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/a1-[autogen]/python_code.txt @@ -0,0 +1,9 @@ +import numpy as np +from flojoy import flojoy, Vector, Scalar + + +@flojoy +def VECTOR_MIN(default: Vector) -> Scalar: + + + return Scalar(c=np.min(default.v)) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/app.json new file mode 100644 index 0000000000..98e1f718db --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/app.json @@ -0,0 +1,376 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 160, + "height": 160, + "id": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "label": "VECTOR MAX", + "func": "VECTOR_MAX", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "The maximum value found from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MAX/VECTOR_MAX.py", + "selected": false + }, + "position": { + "x": 130.31981266859236, + "y": -328.83929636806715 + }, + "selected": false, + "positionAbsolute": { + "x": 130.31981266859236, + "y": -328.83929636806715 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "label": "VECTOR MIN", + "func": "VECTOR_MIN", + "type": "TRANSFORMERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Scalar", + "desc": "The minimum value found from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/VECTOR_MIN.py", + "selected": false + }, + "position": { + "x": 145.13349056115274, + "y": 35.87207046216116 + }, + "selected": false, + "positionAbsolute": { + "x": 145.13349056115274, + "y": 35.87207046216116 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 8 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 50 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 200 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -321.7726099556296, + "y": -142.40389954737725 + }, + "selected": false, + "positionAbsolute": { + "x": -321.7726099556296, + "y": -142.40389954737725 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether to show relative delta from last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 523.8297982318611, + "y": -364.2688477798421 + }, + "selected": false, + "positionAbsolute": { + "x": 523.8297982318611, + "y": -364.2688477798421 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "type": "VISUALIZERS", + "data": { + "id": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "label": "BIG NUMBER 1", + "func": "BIG_NUMBER", + "type": "VISUALIZERS", + "ctrls": { + "suffix": { + "type": "str", + "default": null, + "desc": "any suffix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "type": "str", + "default": null, + "desc": "any prefix to show with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "title": { + "type": "str", + "default": null, + "desc": "title of the plot, default \"BIG_NUMBER\"", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + }, + "relative_delta": { + "type": "bool", + "default": true, + "desc": "whether to show relative delta from last run along with big number", + "overload": null, + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": true + }, + "scientific_notation": { + "type": "bool", + "default": false, + "desc": null, + "overload": null, + "functionName": "BIG_NUMBER", + "param": "scientific_notation", + "value": false + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|Scalar|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly big number visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py", + "selected": false + }, + "position": { + "x": 531.0832930102642, + "y": 7.055164039401802 + }, + "selected": false, + "positionAbsolute": { + "x": 531.0832930102642, + "y": 7.055164039401802 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "sourceHandle": "default", + "target": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48default-VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3default" + }, + { + "source": "LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48", + "sourceHandle": "default", + "target": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-be66f6ee-60ec-4c9e-b7a5-7d637dfd0a48default-VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ffdefault" + }, + { + "source": "VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3", + "sourceHandle": "default", + "target": "BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_MAX-a96e94bf-eb75-4fb7-8f6c-f87279b5a6b3default-BIG_NUMBER-4c8e520d-df00-4e5b-8d3b-39fdc20885e5default" + }, + { + "source": "VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ff", + "sourceHandle": "default", + "target": "BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_MIN-7aab6cdd-c04e-4577-8f9c-b71748fd18ffdefault-BIG_NUMBER-af51f687-5e84-4277-8ab7-452c4debd152default" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/example.md new file mode 100644 index 0000000000..e4bde7f1a9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_MIN/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector starting from 8 and ending at 50 by using a `LINSPACE` node. Then a `VECTOR_MIN` node is connected to the example vector where it will find the minimum value and the one above will find the maximum value. The value is visualized with `BIG_NUMBER` node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/VECTOR_SUBSET.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/VECTOR_SUBSET.md new file mode 100644 index 0000000000..71e2facd9f --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/VECTOR_SUBSET.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import AppDisplay from '@site/src/components/AppDisplay'; +import SectionBreak from '@site/src/components/SectionBreak'; +import AppendixSection from '@site/src/components/AppendixSection'; + +[//]: # (Docstring) + +import DocstringSource from '!!raw-loader!./a1-[autogen]/docstring.txt'; +import PythonSource from '!!raw-loader!./a1-[autogen]/python_code.txt'; + +{DocstringSource} +{PythonSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.json'; + + + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from './appendix/notes.md'; +import Hardware from './appendix/hardware.md'; +import Media from './appendix/media.md'; + +## Appendix + + + + + + diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/docstring.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/docstring.txt new file mode 100644 index 0000000000..2c57320766 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/docstring.txt @@ -0,0 +1,18 @@ +The VECTOR_SUBSET node returns the subset of values from requested indices + Inputs + ------ + v : Vector + The input vector to return subset of values from + + Parameters + ---------- + indices: Array + specified indices to extract values at from the input vector + + length: int + number of elements to extract from the input vector, default is 1 (this only applies when one index is specified for indices parameter) + + Returns + ------- + Vector + The new vector with subset of elements extracted from the input vector diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/python_code.txt b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/python_code.txt new file mode 100644 index 0000000000..3e2844347f --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/a1-[autogen]/python_code.txt @@ -0,0 +1,27 @@ +from numpy import any, array, arange, take +from flojoy import flojoy, Vector, Array + + +@flojoy +def VECTOR_SUBSET(default: Vector, indices: Array, length: int = 1) -> Vector: + + + # unwrap the indices first + indices = array(indices.unwrap(), dtype=int) + + assert len(default.v) > len( + indices + ), "The length of indices parameter must be less than the length of the Vector." + assert any(indices >= 0), "The indices must be greater than zero." + + if len(indices) == 1: + assert (indices[0] + (length - 1)) < len( + default.v + ), "The length of items to delete starting from index parameter must not exceed the length of the Vector." + + if len(indices) > 1: + v = take(default.v, indices) + else: + indices = arange(indices[0], length) + v = take(default.v, indices) + return Vector(v=v) diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/hardware.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/hardware.md new file mode 100644 index 0000000000..7f78a555c4 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/hardware.md @@ -0,0 +1 @@ +This node does not require any peripheral hardware to operate. Please see INSTRUMENTS for nodes that interact with the physical world through connected hardware. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/media.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/media.md new file mode 100644 index 0000000000..8bcee9be90 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/media.md @@ -0,0 +1 @@ +No supporting screenshots, photos, or videos have been added to the media.md file for this node. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/notes.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/notes.md new file mode 100644 index 0000000000..04aded2ec9 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/appendix/notes.md @@ -0,0 +1 @@ +No theory or technical notes have been contributed for this node yet. \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/app.json b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/app.json new file mode 100644 index 0000000000..ca4db7e0a3 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/app.json @@ -0,0 +1,305 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 160, + "height": 160, + "id": "VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65", + "type": "TRANSFORMERS", + "data": { + "id": "VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65", + "label": "VECTOR SUBSET", + "func": "VECTOR_SUBSET", + "type": "TRANSFORMERS", + "ctrls": { + "indices": { + "type": "Array", + "default": null, + "desc": "specified indices to extract values at from the input vector", + "overload": null, + "functionName": "VECTOR_SUBSET", + "param": "indices", + "value": "3, 1, 9" + }, + "length": { + "type": "int", + "default": 1, + "desc": "number of elements to extract from the input vector, default is 1 (this only applies when one index is specified for indices parameter)", + "overload": null, + "functionName": "VECTOR_SUBSET", + "param": "length", + "value": 1 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "The new vector with subset of elements extracted from the input vector" + } + ], + "path": "TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/VECTOR_SUBSET.py", + "selected": false + }, + "position": { + "x": 104.03576804813667, + "y": -249.72160283864238 + }, + "selected": false, + "positionAbsolute": { + "x": 104.03576804813667, + "y": -249.72160283864238 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "LINSPACE-d585a7bc-2746-403c-a11d-8e126f184986", + "type": "GENERATORS", + "data": { + "id": "LINSPACE-d585a7bc-2746-403c-a11d-8e126f184986", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "GENERATORS", + "ctrls": { + "start": { + "type": "float", + "default": 10, + "desc": "The start point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "start", + "value": 0 + }, + "end": { + "type": "float", + "default": 0, + "desc": "The end point of the data.", + "overload": null, + "functionName": "LINSPACE", + "param": "end", + "value": 10 + }, + "step": { + "type": "int", + "default": 1000, + "desc": "The number of points in the vector.", + "overload": null, + "functionName": "LINSPACE", + "param": "step", + "value": 10 + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Vector|OrderedPair", + "multiple": false, + "desc": "Optional input in case LINSPACE is used in a loop. Not used." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Vector", + "desc": "v: the vector between start and end with step number of points." + } + ], + "path": "GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", + "selected": false + }, + "position": { + "x": -228.13999483234682, + "y": -219.17458038428336 + }, + "selected": false, + "positionAbsolute": { + "x": -228.13999483234682, + "y": -219.17458038428336 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247", + "type": "VISUALIZERS", + "data": { + "id": "SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "OrderedPair|DataFrame|Matrix|Vector", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing Plotly Scatter visualization" + } + ], + "path": "VISUALIZERS/PLOTLY/SCATTER/SCATTER.py", + "selected": false + }, + "position": { + "x": 428.99358461694226, + "y": -314.5602635329144 + }, + "selected": false, + "positionAbsolute": { + "x": 428.99358461694226, + "y": -314.5602635329144 + }, + "dragging": true + }, + { + "width": 208, + "height": 96, + "id": "TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398", + "type": "GENERATORS", + "data": { + "id": "TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398", + "label": "TEXT", + "func": "TEXT", + "type": "GENERATORS", + "ctrls": { + "value": { + "type": "str", + "default": "Hello World!", + "desc": "The value set in Parameters", + "overload": null, + "functionName": "TEXT", + "param": "value", + "value": "This is an app that extracts the values from the input vector given the indices to locate the values from." + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "_", + "id": "_", + "type": "Any", + "multiple": false, + "desc": null + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "desc": "text_blob: return the value being set in Parameters" + } + ], + "path": "GENERATORS/SIMULATIONS/TEXT/TEXT.py", + "selected": false + }, + "position": { + "x": 936.9816915983375, + "y": -214.31949084904693 + }, + "selected": false, + "positionAbsolute": { + "x": 936.9816915983375, + "y": -214.31949084904693 + }, + "dragging": true + }, + { + "width": 384, + "height": 288, + "id": "TEXT_VIEW-51dabb17-f619-4f5b-963e-a84f3dec216e", + "type": "VISUALIZERS", + "data": { + "id": "TEXT_VIEW-51dabb17-f619-4f5b-963e-a84f3dec216e", + "label": "TEXT VIEW", + "func": "TEXT_VIEW", + "type": "VISUALIZERS", + "ctrls": {}, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "TextBlob", + "multiple": false, + "desc": "the DataContainer to be visualized in text format" + } + ], + "path": "VISUALIZERS/DATA_STRUCTURE/TEXT_VIEW/TEXT_VIEW.py", + "selected": true + }, + "position": { + "x": 840.4770466400951, + "y": -598.4440869703409 + }, + "selected": true, + "positionAbsolute": { + "x": 840.4770466400951, + "y": -598.4440869703409 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-d585a7bc-2746-403c-a11d-8e126f184986", + "sourceHandle": "default", + "target": "VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65", + "targetHandle": "default", + "id": "reactflow__edge-LINSPACE-d585a7bc-2746-403c-a11d-8e126f184986default-VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65default" + }, + { + "source": "VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65", + "sourceHandle": "default", + "target": "SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247", + "targetHandle": "default", + "id": "reactflow__edge-VECTOR_SUBSET-e808198b-5507-406c-816b-edfa5cd67c65default-SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247default" + }, + { + "source": "SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247", + "sourceHandle": "default", + "target": "TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398", + "targetHandle": "_", + "id": "reactflow__edge-SCATTER-ab4ed575-e472-4057-a8aa-15f49220d247default-TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398_" + }, + { + "source": "TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398", + "sourceHandle": "default", + "target": "TEXT_VIEW-51dabb17-f619-4f5b-963e-a84f3dec216e", + "targetHandle": "default", + "id": "reactflow__edge-TEXT-8b9ff74a-8faa-4e7d-b66a-b1c757520398default-TEXT_VIEW-51dabb17-f619-4f5b-963e-a84f3dec216edefault" + } + ], + "viewport": { + "x": 637.654905587641, + "y": 363.60612546109087, + "zoom": 0.7111497425822767 + } + } +} \ No newline at end of file diff --git a/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/example.md b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/example.md new file mode 100644 index 0000000000..d99a6d8e66 --- /dev/null +++ b/docs/nodes/TRANSFORMERS/VECTOR_MANIPULATION/VECTOR_SUBSET/examples/EX1/example.md @@ -0,0 +1 @@ +In this example, we generate a vector by using a `LINSPACE` node. Then the values located at indices 3, 1, 9 are extracted using `VECTOR_SUBSET`. The resulting vector is visualized with `SCATTER` node. \ No newline at end of file