From 2f8e754702f9d77bc8293d9a040c1d1da7a977fe Mon Sep 17 00:00:00 2001 From: smahmed776 Date: Sat, 10 Jun 2023 18:28:33 +0000 Subject: [PATCH] improve autogen script for docs --- .../AI_ML/CLASSIFICATION/ONE_HOT_ENCODING.md | 57 ++ .../CLASSIFICATION/a1-[autogen]/docstring.txt | 14 + .../a1-[autogen]/parameters.yaml | 6 + .../a1-[autogen]/python_code.txt | 36 + .../AI_ML/CLASSIFICATION/appendix/hardware.md | 0 .../AI_ML/CLASSIFICATION/appendix/media.md | 0 .../AI_ML/CLASSIFICATION/appendix/notes.md | 0 .../AI_ML/CLASSIFICATION/examples/EX1/app.txt | 166 +++++ .../CLASSIFICATION/examples/EX1/example.md | 3 + .../CLASSIFICATION/examples/EX1/output.txt | 0 .../OBJECT_DETECTION/OBJECT_DETECTION.md | 57 ++ .../a1-[autogen]/docstring.txt | 12 + .../a1-[autogen]/parameters.yaml | 0 .../a1-[autogen]/python_code.txt | 44 ++ .../OBJECT_DETECTION/appendix/hardware.md | 0 .../AI_ML/OBJECT_DETECTION/appendix/media.md | 0 .../AI_ML/OBJECT_DETECTION/appendix/notes.md | 0 .../OBJECT_DETECTION/examples/EX1/app.txt | 166 +++++ .../OBJECT_DETECTION/examples/EX1/example.md | 1 + .../OBJECT_DETECTION/examples/EX1/output.txt | 0 .../EXTRACTORS/FILE/READ_CSV/READ_CSV.md | 50 ++ .../FILE/READ_CSV/a1-[autogen]/docstring.txt | 8 + .../READ_CSV/a1-[autogen]/parameters.yaml | 3 + .../READ_CSV/a1-[autogen]/python_code.txt | 10 + .../FILE/READ_CSV/appendix/hardware.md | 0 .../FILE/READ_CSV/appendix/media.md | 0 .../FILE/READ_CSV/appendix/notes.md | 0 .../PLOTLY_DATASET/PLOTLY_DATASET.md | 57 ++ .../PLOTLY_DATASET/a1-[autogen]/docstring.txt | 0 .../a1-[autogen]/parameters.yaml | 14 + .../a1-[autogen]/python_code.txt | 10 + .../PLOTLY_DATASET/appendix/hardware.md | 0 .../PLOTLY_DATASET/appendix/media.md | 0 .../PLOTLY_DATASET/appendix/notes.md | 0 .../PLOTLY_DATASET/examples/EX1/app.txt | 124 ++++ .../PLOTLY_DATASET/examples/EX1/example.md | 9 + .../PLOTLY_DATASET/examples/EX1/output.txt | 0 .../SAMPLE_DATASETS/R_DATASET/R_DATASET.md | 57 ++ .../R_DATASET/a1-[autogen]/docstring.txt | 10 + .../R_DATASET/a1-[autogen]/parameters.yaml | 87 +++ .../R_DATASET/a1-[autogen]/python_code.txt | 10 + .../R_DATASET/appendix/hardware.md | 0 .../R_DATASET/appendix/media.md | 0 .../R_DATASET/appendix/notes.md | 0 .../R_DATASET/examples/EX1/app.txt | 130 ++++ .../R_DATASET/examples/EX1/example.md | 9 + .../R_DATASET/examples/EX1/output.txt | 0 .../TEXT_DATASET/TEXT_DATASET.md | 57 ++ .../TEXT_DATASET/a1-[autogen]/docstring.txt | 37 + .../TEXT_DATASET/a1-[autogen]/parameters.yaml | 19 + .../TEXT_DATASET/a1-[autogen]/python_code.txt | 40 ++ .../TEXT_DATASET/appendix/hardware.md | 0 .../TEXT_DATASET/appendix/media.md | 0 .../TEXT_DATASET/appendix/notes.md | 0 .../TEXT_DATASET/examples/EX1/app.txt | 144 ++++ .../TEXT_DATASET/examples/EX1/example.md | 3 + .../TEXT_DATASET/examples/EX1/output.txt | 0 .../SKLEARNIMAGE/SKLEARNIMAGE.md | 57 ++ .../SKLEARNIMAGE/a1-[autogen]/docstring.txt | 5 + .../SKLEARNIMAGE/a1-[autogen]/parameters.yaml | 47 ++ .../SKLEARNIMAGE/a1-[autogen]/python_code.txt | 38 + .../SKLEARNIMAGE/appendix/hardware.md | 0 .../SKLEARNIMAGE/appendix/media.md | 0 .../SKLEARNIMAGE/appendix/notes.md | 0 .../SKLEARNIMAGE/examples/EX1/app.txt | 112 +++ .../SKLEARNIMAGE/examples/EX1/example.md | 9 + .../SKLEARNIMAGE/examples/EX1/output.txt | 0 .../SIMULATIONS/CONSTANT/CONSTANT.md | 50 ++ .../CONSTANT/a1-[autogen]/docstring.txt | 1 + .../CONSTANT/a1-[autogen]/parameters.yaml | 3 + .../CONSTANT/a1-[autogen]/python_code.txt | 19 + .../SIMULATIONS/CONSTANT/appendix/hardware.md | 0 .../SIMULATIONS/CONSTANT/appendix/media.md | 0 .../SIMULATIONS/CONSTANT/appendix/notes.md | 0 .../SIMULATIONS/FEEDBACK/FEEDBACK.md | 57 ++ .../FEEDBACK/a1-[autogen]/docstring.txt | 0 .../FEEDBACK/a1-[autogen]/parameters.yaml | 3 + .../FEEDBACK/a1-[autogen]/python_code.txt | 17 + .../SIMULATIONS/FEEDBACK/appendix/hardware.md | 0 .../SIMULATIONS/FEEDBACK/appendix/media.md | 0 .../SIMULATIONS/FEEDBACK/appendix/notes.md | 0 .../SIMULATIONS/FEEDBACK/examples/EX1/app.txt | 422 +++++++++++ .../FEEDBACK/examples/EX1/example.md | 1 + .../FEEDBACK/examples/EX1/output.txt | 0 .../SIMULATIONS/LINSPACE/LINSPACE.md | 50 ++ .../LINSPACE/a1-[autogen]/docstring.txt | 0 .../LINSPACE/a1-[autogen]/parameters.yaml | 9 + .../LINSPACE/a1-[autogen]/python_code.txt | 12 + .../SIMULATIONS/LINSPACE/appendix/hardware.md | 0 .../SIMULATIONS/LINSPACE/appendix/media.md | 0 .../SIMULATIONS/LINSPACE/appendix/notes.md | 0 .../nodes/GENERATORS/SIMULATIONS/RAND/RAND.md | 50 ++ .../RAND/a1-[autogen]/docstring.txt | 0 .../RAND/a1-[autogen]/parameters.yaml | 0 .../RAND/a1-[autogen]/python_code.txt | 29 + .../SIMULATIONS/RAND/appendix/hardware.md | 0 .../SIMULATIONS/RAND/appendix/media.md | 0 .../SIMULATIONS/RAND/appendix/notes.md | 0 .../SECOND_ORDER_SYSTEM.md | 50 ++ .../a1-[autogen]/docstring.txt | 0 .../a1-[autogen]/parameters.yaml | 6 + .../a1-[autogen]/python_code.txt | 52 ++ .../SECOND_ORDER_SYSTEM/appendix/hardware.md | 0 .../SECOND_ORDER_SYSTEM/appendix/media.md | 0 .../SECOND_ORDER_SYSTEM/appendix/notes.md | 0 .../nodes/GENERATORS/SIMULATIONS/SINE/SINE.md | 50 ++ .../SINE/a1-[autogen]/docstring.txt | 0 .../SINE/a1-[autogen]/parameters.yaml | 20 + .../SINE/a1-[autogen]/python_code.txt | 31 + .../SIMULATIONS/SINE/appendix/hardware.md | 0 .../SIMULATIONS/SINE/appendix/media.md | 0 .../SIMULATIONS/SINE/appendix/notes.md | 0 .../SIMULATIONS/TIMESERIES/TIMESERIES.md | 50 ++ .../TIMESERIES/a1-[autogen]/docstring.txt | 2 + .../TIMESERIES/a1-[autogen]/parameters.yaml | 0 .../TIMESERIES/a1-[autogen]/python_code.txt | 18 + .../TIMESERIES/appendix/hardware.md | 0 .../SIMULATIONS/TIMESERIES/appendix/media.md | 0 .../SIMULATIONS/TIMESERIES/appendix/notes.md | 0 .../KEITHLEY/KEITHLEY2400/KEITHLEY2400.md | 57 ++ .../KEITHLEY2400/a1-[autogen]/docstring.txt | 2 + .../KEITHLEY2400/a1-[autogen]/parameters.yaml | 6 + .../KEITHLEY2400/a1-[autogen]/python_code.txt | 66 ++ .../KEITHLEY2400/appendix/hardware.md | 0 .../KEITHLEY/KEITHLEY2400/appendix/media.md | 0 .../KEITHLEY/KEITHLEY2400/appendix/notes.md | 0 .../KEITHLEY2400/examples/EX1/app.txt | 266 +++++++ .../KEITHLEY2400/examples/EX1/example.md | 60 ++ .../KEITHLEY2400/examples/EX1/output.txt | 0 .../LABJACK/LABJACKU3/LABJACKU3.md | 57 ++ .../LABJACKU3/a1-[autogen]/docstring.txt | 1 + .../LABJACKU3/a1-[autogen]/parameters.yaml | 3 + .../LABJACKU3/a1-[autogen]/python_code.txt | 60 ++ .../LABJACK/LABJACKU3/appendix/hardware.md | 0 .../LABJACK/LABJACKU3/appendix/media.md | 0 .../LABJACK/LABJACKU3/appendix/notes.md | 0 .../LABJACK/LABJACKU3/examples/EX1/app.txt | 216 ++++++ .../LABJACK/LABJACKU3/examples/EX1/example.md | 47 ++ .../LABJACK/LABJACKU3/examples/EX1/output.txt | 0 .../PHIDGET/PHIDGET22/PHIDGET22.md | 57 ++ .../PHIDGET22/a1-[autogen]/docstring.txt | 1 + .../PHIDGET22/a1-[autogen]/parameters.yaml | 9 + .../PHIDGET22/a1-[autogen]/python_code.txt | 55 ++ .../PHIDGET/PHIDGET22/appendix/hardware.md | 0 .../PHIDGET/PHIDGET22/appendix/media.md | 0 .../PHIDGET/PHIDGET22/appendix/notes.md | 0 .../PHIDGET/PHIDGET22/examples/EX1/app.txt | 148 ++++ .../PHIDGET/PHIDGET22/examples/EX1/example.md | 45 ++ .../PHIDGET/PHIDGET22/examples/EX1/output.txt | 0 .../SERIAL_SINGLE_MEASUREMENT.md | 50 ++ .../a1-[autogen]/docstring.txt | 27 + .../a1-[autogen]/parameters.yaml | 6 + .../a1-[autogen]/python_code.txt | 42 ++ .../appendix/hardware.md | 0 .../appendix/media.md | 0 .../appendix/notes.md | 0 .../SERIAL_TIMESERIES/SERIAL_TIMESERIES.md | 57 ++ .../a1-[autogen]/docstring.txt | 31 + .../a1-[autogen]/parameters.yaml | 12 + .../a1-[autogen]/python_code.txt | 71 ++ .../SERIAL_TIMESERIES/appendix/hardware.md | 0 .../SERIAL_TIMESERIES/appendix/media.md | 0 .../SERIAL_TIMESERIES/appendix/notes.md | 0 .../SERIAL_TIMESERIES/examples/EX1/app.txt | 322 +++++++++ .../SERIAL_TIMESERIES/examples/EX1/example.md | 1 + .../SERIAL_TIMESERIES/examples/EX1/output.txt | 0 .../STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.md | 57 ++ .../a1-[autogen]/docstring.txt | 3 + .../a1-[autogen]/parameters.yaml | 6 + .../a1-[autogen]/python_code.txt | 44 ++ .../STEPPER_DRIVER_TIC/appendix/hardware.md | 0 .../STEPPER_DRIVER_TIC/appendix/media.md | 0 .../STEPPER_DRIVER_TIC/appendix/notes.md | 0 .../STEPPER_DRIVER_TIC/examples/EX1/app.txt | 86 +++ .../examples/EX1/example.md | 37 + .../examples/EX1/output.txt | 0 .../STEPPER_DRIVER_TIC_KNOB.md | 57 ++ .../a1-[autogen]/docstring.txt | 3 + .../a1-[autogen]/parameters.yaml | 12 + .../a1-[autogen]/python_code.txt | 47 ++ .../appendix/hardware.md | 0 .../STEPPER_DRIVER_TIC_KNOB/appendix/media.md | 0 .../STEPPER_DRIVER_TIC_KNOB/appendix/notes.md | 0 .../examples/EX1/app.txt | 90 +++ .../examples/EX1/example.md | 35 + .../examples/EX1/output.txt | 0 .../INSTRUMENTS/WEB_CAM/CAMERA/CAMERA.md | 50 ++ .../WEB_CAM/CAMERA/a1-[autogen]/docstring.txt | 3 + .../CAMERA/a1-[autogen]/parameters.yaml | 3 + .../CAMERA/a1-[autogen]/python_code.txt | 69 ++ .../WEB_CAM/CAMERA/appendix/hardware.md | 0 .../WEB_CAM/CAMERA/appendix/media.md | 0 .../WEB_CAM/CAMERA/appendix/notes.md | 0 .../LOADERS/CLOUD_DATABASE/LOADER/LOADER.md | 57 ++ .../LOADER/a1-[autogen]/docstring.txt | 0 .../LOADER/a1-[autogen]/parameters.yaml | 3 + .../LOADER/a1-[autogen]/python_code.txt | 33 + .../LOADER/appendix/hardware.md | 0 .../CLOUD_DATABASE/LOADER/appendix/media.md | 0 .../CLOUD_DATABASE/LOADER/appendix/notes.md | 0 .../LOADER/examples/EX1/app.txt | 459 ++++++++++++ .../LOADER/examples/EX1/example.md | 19 + .../LOADER/examples/EX1/output.txt | 0 .../LOCAL_FILE/LOCAL_FILE.md | 57 ++ .../LOCAL_FILE/a1-[autogen]/docstring.txt | 16 + .../LOCAL_FILE/a1-[autogen]/parameters.yaml | 12 + .../LOCAL_FILE/a1-[autogen]/python_code.txt | 67 ++ .../LOCAL_FILE/appendix/hardware.md | 0 .../LOCAL_FILE/appendix/media.md | 0 .../LOCAL_FILE/appendix/notes.md | 0 .../LOCAL_FILE/examples/EX1/app.txt | 137 ++++ .../LOCAL_FILE/examples/EX1/example.md | 7 + .../LOCAL_FILE/examples/EX1/output.txt | 0 .../OPEN_MATLAB/OPEN_MATLAB.md | 57 ++ .../OPEN_MATLAB/a1-[autogen]/docstring.txt | 13 + .../OPEN_MATLAB/a1-[autogen]/parameters.yaml | 3 + .../OPEN_MATLAB/a1-[autogen]/python_code.txt | 36 + .../OPEN_MATLAB/appendix/hardware.md | 0 .../OPEN_MATLAB/appendix/media.md | 0 .../OPEN_MATLAB/appendix/notes.md | 0 .../OPEN_MATLAB/examples/EX1/app.txt | 124 ++++ .../OPEN_MATLAB/examples/EX1/example.md | 1 + .../OPEN_MATLAB/examples/EX1/output.txt | 0 .../LOGIC_GATES/CONDITIONALS/CONDITIONAL.md | 57 ++ .../CONDITIONALS/a1-[autogen]/docstring.txt | 7 + .../CONDITIONALS/a1-[autogen]/parameters.yaml | 10 + .../CONDITIONALS/a1-[autogen]/python_code.txt | 35 + .../CONDITIONALS/appendix/hardware.md | 0 .../CONDITIONALS/appendix/media.md | 0 .../CONDITIONALS/appendix/notes.md | 0 .../CONDITIONALS/examples/EX1/app.txt | 282 ++++++++ .../CONDITIONALS/examples/EX1/example.md | 5 + .../CONDITIONALS/examples/EX1/output.txt | 0 .../nodes/LOGIC_GATES/LOOPS/GOTO/GOTO.md | 50 ++ .../LOOPS/GOTO/a1-[autogen]/docstring.txt | 0 .../LOOPS/GOTO/a1-[autogen]/parameters.yaml | 3 + .../LOOPS/GOTO/a1-[autogen]/python_code.txt | 10 + .../LOOPS/GOTO/appendix/hardware.md | 0 .../LOGIC_GATES/LOOPS/GOTO/appendix/media.md | 0 .../LOGIC_GATES/LOOPS/GOTO/appendix/notes.md | 0 .../nodes/LOGIC_GATES/LOOPS/LOOP/LOOP.md | 57 ++ .../LOOPS/LOOP/a1-[autogen]/docstring.txt | 7 + .../LOOPS/LOOP/a1-[autogen]/parameters.yaml | 3 + .../LOOPS/LOOP/a1-[autogen]/python_code.txt | 111 +++ .../LOOPS/LOOP/appendix/hardware.md | 0 .../LOGIC_GATES/LOOPS/LOOP/appendix/media.md | 0 .../LOGIC_GATES/LOOPS/LOOP/appendix/notes.md | 0 .../LOOPS/LOOP/examples/EX1/app.txt | 350 +++++++++ .../LOOPS/LOOP/examples/EX1/example.md | 16 + .../LOOPS/LOOP/examples/EX1/output.txt | 0 .../nodes/LOGIC_GATES/TERMINATORS/END.md | 50 ++ .../TERMINATORS/a1-[autogen]/docstring.txt | 0 .../TERMINATORS/a1-[autogen]/parameters.yaml | 0 .../TERMINATORS/a1-[autogen]/python_code.txt | 7 + .../TERMINATORS/appendix/hardware.md | 0 .../LOGIC_GATES/TERMINATORS/appendix/media.md | 0 .../LOGIC_GATES/TERMINATORS/appendix/notes.md | 0 docs/nodes/nodes/LOGIC_GATES/TIMERS/TIMER.md | 50 ++ .../TIMERS/a1-[autogen]/docstring.txt | 0 .../TIMERS/a1-[autogen]/parameters.yaml | 3 + .../TIMERS/a1-[autogen]/python_code.txt | 12 + .../LOGIC_GATES/TIMERS/appendix/hardware.md | 0 .../LOGIC_GATES/TIMERS/appendix/media.md | 0 .../LOGIC_GATES/TIMERS/appendix/notes.md | 0 .../nodes/TRANSFORMERS/ARITHMETIC/ABS/ABS.md | 50 ++ .../ARITHMETIC/ABS/a1-[autogen]/docstring.txt | 1 + .../ABS/a1-[autogen]/parameters.yaml | 0 .../ABS/a1-[autogen]/python_code.txt | 8 + .../ARITHMETIC/ABS/appendix/hardware.md | 0 .../ARITHMETIC/ABS/appendix/media.md | 0 .../ARITHMETIC/ABS/appendix/notes.md | 0 .../nodes/TRANSFORMERS/ARITHMETIC/ADD/ADD.md | 57 ++ .../ARITHMETIC/ADD/a1-[autogen]/docstring.txt | 5 + .../ADD/a1-[autogen]/parameters.yaml | 0 .../ADD/a1-[autogen]/python_code.txt | 19 + .../ARITHMETIC/ADD/appendix/hardware.md | 0 .../ARITHMETIC/ADD/appendix/media.md | 0 .../ARITHMETIC/ADD/appendix/notes.md | 0 .../ARITHMETIC/ADD/examples/EX1/app.txt | 236 ++++++ .../ARITHMETIC/ADD/examples/EX1/example.md | 5 + .../ARITHMETIC/ADD/examples/EX1/output.txt | 0 .../TRANSFORMERS/ARITHMETIC/DIVIDE/DIVIDE.md | 50 ++ .../DIVIDE/a1-[autogen]/docstring.txt | 3 + .../DIVIDE/a1-[autogen]/parameters.yaml | 0 .../DIVIDE/a1-[autogen]/python_code.txt | 19 + .../ARITHMETIC/DIVIDE/appendix/hardware.md | 0 .../ARITHMETIC/DIVIDE/appendix/media.md | 0 .../ARITHMETIC/DIVIDE/appendix/notes.md | 0 .../ARITHMETIC/MULTIPLY/MULTIPLY.md | 57 ++ .../MULTIPLY/a1-[autogen]/docstring.txt | 1 + .../MULTIPLY/a1-[autogen]/parameters.yaml | 0 .../MULTIPLY/a1-[autogen]/python_code.txt | 14 + .../ARITHMETIC/MULTIPLY/appendix/hardware.md | 0 .../ARITHMETIC/MULTIPLY/appendix/media.md | 0 .../ARITHMETIC/MULTIPLY/appendix/notes.md | 0 .../ARITHMETIC/MULTIPLY/examples/EX1/app.txt | 255 +++++++ .../MULTIPLY/examples/EX1/example.md | 3 + .../MULTIPLY/examples/EX1/output.txt | 0 .../ARITHMETIC/SUBTRACT/SUBTRACT.md | 57 ++ .../SUBTRACT/a1-[autogen]/docstring.txt | 1 + .../SUBTRACT/a1-[autogen]/parameters.yaml | 0 .../SUBTRACT/a1-[autogen]/python_code.txt | 19 + .../ARITHMETIC/SUBTRACT/appendix/hardware.md | 0 .../ARITHMETIC/SUBTRACT/appendix/media.md | 0 .../ARITHMETIC/SUBTRACT/appendix/notes.md | 0 .../ARITHMETIC/SUBTRACT/examples/EX1/app.txt | 188 +++++ .../SUBTRACT/examples/EX1/example.md | 3 + .../SUBTRACT/examples/EX1/output.txt | 0 .../EDGE_DETECTION/EDGE_DETECTION.md | 57 ++ .../EDGE_DETECTION/a1-[autogen]/docstring.txt | 12 + .../a1-[autogen]/parameters.yaml | 0 .../a1-[autogen]/python_code.txt | 47 ++ .../EDGE_DETECTION/appendix/hardware.md | 0 .../EDGE_DETECTION/appendix/media.md | 0 .../EDGE_DETECTION/appendix/notes.md | 0 .../EDGE_DETECTION/examples/EX1/app.txt | 170 +++++ .../EDGE_DETECTION/examples/EX1/example.md | 1 + .../EDGE_DETECTION/examples/EX1/output.txt | 0 .../IMAGE_SMOOTHING/IMAGE_SMOOTHING.md | 50 ++ .../a1-[autogen]/docstring.txt | 21 + .../a1-[autogen]/parameters.yaml | 11 + .../a1-[autogen]/python_code.txt | 48 ++ .../IMAGE_SMOOTHING/appendix/hardware.md | 0 .../IMAGE_SMOOTHING/appendix/media.md | 0 .../IMAGE_SMOOTHING/appendix/notes.md | 0 .../MATRIX_MANIPULATION/INVERT/INVERT.md | 50 ++ .../INVERT/a1-[autogen]/docstring.txt | 4 + .../INVERT/a1-[autogen]/parameters.yaml | 3 + .../INVERT/a1-[autogen]/python_code.txt | 36 + .../INVERT/appendix/hardware.md | 0 .../INVERT/appendix/media.md | 0 .../INVERT/appendix/notes.md | 0 .../MATRIX_MANIPULATION/MATMUL/MATMUL.md | 50 ++ .../MATMUL/a1-[autogen]/docstring.txt | 1 + .../MATMUL/a1-[autogen]/parameters.yaml | 0 .../MATMUL/a1-[autogen]/python_code.txt | 13 + .../MATMUL/appendix/hardware.md | 0 .../MATMUL/appendix/media.md | 0 .../MATMUL/appendix/notes.md | 0 .../SELECT_ARRAY/SELECT_ARRAY/SELECT_ARRAY.md | 50 ++ .../SELECT_ARRAY/a1-[autogen]/docstring.txt | 9 + .../SELECT_ARRAY/a1-[autogen]/parameters.yaml | 3 + .../SELECT_ARRAY/a1-[autogen]/python_code.txt | 20 + .../SELECT_ARRAY/appendix/hardware.md | 0 .../SELECT_ARRAY/appendix/media.md | 0 .../SELECT_ARRAY/appendix/notes.md | 0 .../SIGNAL_PROCESSING/BUTTER/BUTTER.md | 57 ++ .../BUTTER/a1-[autogen]/docstring.txt | 1 + .../BUTTER/a1-[autogen]/parameters.yaml | 0 .../BUTTER/a1-[autogen]/python_code.txt | 17 + .../BUTTER/appendix/hardware.md | 0 .../BUTTER/appendix/media.md | 0 .../BUTTER/appendix/notes.md | 0 .../BUTTER/examples/EX1/app.txt | 324 +++++++++ .../BUTTER/examples/EX1/example.md | 1 + .../BUTTER/examples/EX1/output.txt | 0 .../TRANSFORMERS/SIGNAL_PROCESSING/FIR/FIR.md | 57 ++ .../FIR/a1-[autogen]/docstring.txt | 5 + .../FIR/a1-[autogen]/parameters.yaml | 12 + .../FIR/a1-[autogen]/python_code.txt | 58 ++ .../FIR/appendix/hardware.md | 0 .../SIGNAL_PROCESSING/FIR/appendix/media.md | 0 .../SIGNAL_PROCESSING/FIR/appendix/notes.md | 0 .../FIR/examples/EX1/app.txt | 671 ++++++++++++++++++ .../FIR/examples/EX1/example.md | 1 + .../FIR/examples/EX1/output.txt | 0 .../TRANSFORMERS/SIGNAL_PROCESSING/PID/PID.md | 57 ++ .../PID/a1-[autogen]/docstring.txt | 0 .../PID/a1-[autogen]/parameters.yaml | 9 + .../PID/a1-[autogen]/python_code.txt | 58 ++ .../PID/appendix/hardware.md | 0 .../SIGNAL_PROCESSING/PID/appendix/media.md | 0 .../SIGNAL_PROCESSING/PID/appendix/notes.md | 0 .../PID/examples/EX1/app.txt | 591 +++++++++++++++ .../PID/examples/EX1/example.md | 1 + .../PID/examples/EX1/output.txt | 0 .../SIGNAL_PROCESSING/SAVGOL/SAVGOL.md | 50 ++ .../SAVGOL/a1-[autogen]/docstring.txt | 2 + .../SAVGOL/a1-[autogen]/parameters.yaml | 6 + .../SAVGOL/a1-[autogen]/python_code.txt | 19 + .../SAVGOL/appendix/hardware.md | 0 .../SAVGOL/appendix/media.md | 0 .../SAVGOL/appendix/notes.md | 0 .../TYPE_CASTING/DF_2_NP/DF_2_NP.md | 57 ++ .../DF_2_NP/a1-[autogen]/docstring.txt | 12 + .../DF_2_NP/a1-[autogen]/parameters.yaml | 0 .../DF_2_NP/a1-[autogen]/python_code.txt | 17 + .../TYPE_CASTING/DF_2_NP/appendix/hardware.md | 0 .../TYPE_CASTING/DF_2_NP/appendix/media.md | 0 .../TYPE_CASTING/DF_2_NP/appendix/notes.md | 0 .../TYPE_CASTING/DF_2_NP/examples/EX1/app.txt | 161 +++++ .../DF_2_NP/examples/EX1/example.md | 5 + .../DF_2_NP/examples/EX1/output.txt | 0 .../TYPE_CASTING/MAT_2_DF/MAT_2_DF.md | 57 ++ .../MAT_2_DF/a1-[autogen]/docstring.txt | 12 + .../MAT_2_DF/a1-[autogen]/parameters.yaml | 0 .../MAT_2_DF/a1-[autogen]/python_code.txt | 20 + .../MAT_2_DF/appendix/hardware.md | 0 .../TYPE_CASTING/MAT_2_DF/appendix/media.md | 0 .../TYPE_CASTING/MAT_2_DF/appendix/notes.md | 0 .../MAT_2_DF/examples/EX1/app.txt | 118 +++ .../MAT_2_DF/examples/EX1/example.md | 3 + .../MAT_2_DF/examples/EX1/output.txt | 0 .../TYPE_CASTING/NP_2_DF/NP_2_DF.md | 57 ++ .../NP_2_DF/a1-[autogen]/docstring.txt | 11 + .../NP_2_DF/a1-[autogen]/parameters.yaml | 0 .../NP_2_DF/a1-[autogen]/python_code.txt | 46 ++ .../TYPE_CASTING/NP_2_DF/appendix/hardware.md | 0 .../TYPE_CASTING/NP_2_DF/appendix/media.md | 0 .../TYPE_CASTING/NP_2_DF/appendix/notes.md | 0 .../TYPE_CASTING/NP_2_DF/examples/EX1/app.txt | 161 +++++ .../NP_2_DF/examples/EX1/example.md | 5 + .../NP_2_DF/examples/EX1/output.txt | 0 .../DATA_STRUCTURE/ARRAY_VIEW/ARRAY_VIEW.md | 57 ++ .../ARRAY_VIEW/a1-[autogen]/docstring.txt | 12 + .../ARRAY_VIEW/a1-[autogen]/parameters.yaml | 0 .../ARRAY_VIEW/a1-[autogen]/python_code.txt | 88 +++ .../ARRAY_VIEW/appendix/hardware.md | 0 .../ARRAY_VIEW/appendix/media.md | 0 .../ARRAY_VIEW/appendix/notes.md | 0 .../ARRAY_VIEW/examples/EX1/app.txt | 134 ++++ .../ARRAY_VIEW/examples/EX1/example.md | 5 + .../ARRAY_VIEW/examples/EX1/output.txt | 0 .../DATA_STRUCTURE/MATRIX_VIEW/MATRIX_VIEW.md | 57 ++ .../MATRIX_VIEW/a1-[autogen]/docstring.txt | 12 + .../MATRIX_VIEW/a1-[autogen]/parameters.yaml | 0 .../MATRIX_VIEW/a1-[autogen]/python_code.txt | 129 ++++ .../MATRIX_VIEW/appendix/hardware.md | 0 .../MATRIX_VIEW/appendix/media.md | 0 .../MATRIX_VIEW/appendix/notes.md | 0 .../MATRIX_VIEW/examples/EX1/app.txt | 125 ++++ .../MATRIX_VIEW/examples/EX1/example.md | 3 + .../MATRIX_VIEW/examples/EX1/output.txt | 0 .../nodes/nodes/VISUALIZERS/PLOTLY/BAR/BAR.md | 50 ++ .../PLOTLY/BAR/a1-[autogen]/docstring.txt | 1 + .../PLOTLY/BAR/a1-[autogen]/parameters.yaml | 0 .../PLOTLY/BAR/a1-[autogen]/python_code.txt | 38 + .../PLOTLY/BAR/appendix/hardware.md | 0 .../VISUALIZERS/PLOTLY/BAR/appendix/media.md | 0 .../VISUALIZERS/PLOTLY/BAR/appendix/notes.md | 0 .../PLOTLY/BIG_NUMBER/BIG_NUMBER.md | 50 ++ .../BIG_NUMBER/a1-[autogen]/docstring.txt | 0 .../BIG_NUMBER/a1-[autogen]/parameters.yaml | 15 + .../BIG_NUMBER/a1-[autogen]/python_code.txt | 44 ++ .../PLOTLY/BIG_NUMBER/appendix/hardware.md | 0 .../PLOTLY/BIG_NUMBER/appendix/media.md | 0 .../PLOTLY/BIG_NUMBER/appendix/notes.md | 0 .../VISUALIZERS/PLOTLY/HISTOGRAM/HISTOGRAM.md | 50 ++ .../HISTOGRAM/a1-[autogen]/docstring.txt | 1 + .../HISTOGRAM/a1-[autogen]/parameters.yaml | 0 .../HISTOGRAM/a1-[autogen]/python_code.txt | 33 + .../PLOTLY/HISTOGRAM/appendix/hardware.md | 0 .../PLOTLY/HISTOGRAM/appendix/media.md | 0 .../PLOTLY/HISTOGRAM/appendix/notes.md | 0 .../nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.md | 50 ++ .../PLOTLY/IMAGE/a1-[autogen]/docstring.txt | 0 .../PLOTLY/IMAGE/a1-[autogen]/parameters.yaml | 0 .../PLOTLY/IMAGE/a1-[autogen]/python_code.txt | 28 + .../PLOTLY/IMAGE/appendix/hardware.md | 0 .../PLOTLY/IMAGE/appendix/media.md | 0 .../PLOTLY/IMAGE/appendix/notes.md | 0 .../nodes/VISUALIZERS/PLOTLY/LINE/LINE.md | 50 ++ .../PLOTLY/LINE/a1-[autogen]/docstring.txt | 1 + .../PLOTLY/LINE/a1-[autogen]/parameters.yaml | 0 .../PLOTLY/LINE/a1-[autogen]/python_code.txt | 45 ++ .../PLOTLY/LINE/appendix/hardware.md | 0 .../VISUALIZERS/PLOTLY/LINE/appendix/media.md | 0 .../VISUALIZERS/PLOTLY/LINE/appendix/notes.md | 0 .../VISUALIZERS/PLOTLY/SCATTER/SCATTER.md | 50 ++ .../PLOTLY/SCATTER/a1-[autogen]/docstring.txt | 1 + .../SCATTER/a1-[autogen]/parameters.yaml | 0 .../SCATTER/a1-[autogen]/python_code.txt | 36 + .../PLOTLY/SCATTER/appendix/hardware.md | 0 .../PLOTLY/SCATTER/appendix/media.md | 0 .../PLOTLY/SCATTER/appendix/notes.md | 0 .../VISUALIZERS/PLOTLY/SCATTER3D/SCATTER3D.md | 50 ++ .../SCATTER3D/a1-[autogen]/docstring.txt | 0 .../SCATTER3D/a1-[autogen]/parameters.yaml | 0 .../SCATTER3D/a1-[autogen]/python_code.txt | 24 + .../PLOTLY/SCATTER3D/appendix/hardware.md | 0 .../PLOTLY/SCATTER3D/appendix/media.md | 0 .../PLOTLY/SCATTER3D/appendix/notes.md | 0 .../VISUALIZERS/PLOTLY/SURFACE3D/SURFACE3D.md | 50 ++ .../SURFACE3D/a1-[autogen]/docstring.txt | 0 .../SURFACE3D/a1-[autogen]/parameters.yaml | 0 .../SURFACE3D/a1-[autogen]/python_code.txt | 20 + .../PLOTLY/SURFACE3D/appendix/hardware.md | 0 .../PLOTLY/SURFACE3D/appendix/media.md | 0 .../PLOTLY/SURFACE3D/appendix/notes.md | 0 .../nodes/VISUALIZERS/PLOTLY/TABLE/TABLE.md | 50 ++ .../PLOTLY/TABLE/a1-[autogen]/docstring.txt | 11 + .../PLOTLY/TABLE/a1-[autogen]/parameters.yaml | 0 .../PLOTLY/TABLE/a1-[autogen]/python_code.txt | 28 + .../PLOTLY/TABLE/appendix/hardware.md | 0 .../PLOTLY/TABLE/appendix/media.md | 0 .../PLOTLY/TABLE/appendix/notes.md | 0 496 files changed, 13167 insertions(+) create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/ONE_HOT_ENCODING.md create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/hardware.md create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/media.md create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/notes.md create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/example.md create mode 100644 docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/OBJECT_DETECTION.md create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/hardware.md create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/media.md create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/notes.md create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/example.md create mode 100644 docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/READ_CSV.md create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/hardware.md create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/media.md create mode 100644 docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/PLOTLY_DATASET.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/example.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/R_DATASET.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/example.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/TEXT_DATASET.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/example.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/SKLEARNIMAGE.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/example.md create mode 100644 docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/example.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/RAND.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/SECOND_ORDER_SYSTEM.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/SINE.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/notes.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/TIMESERIES.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/hardware.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/media.md create mode 100644 docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/KEITHLEY2400.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/LABJACKU3.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/PHIDGET22.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/SERIAL_TIMESERIES.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/notes.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/example.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/CAMERA.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/hardware.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/media.md create mode 100644 docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/notes.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/LOADER.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/media.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/notes.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/example.md create mode 100644 docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/media.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/notes.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/example.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/OPEN_MATLAB.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/media.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/notes.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/example.md create mode 100644 docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/CONDITIONAL.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/media.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/notes.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/example.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/GOTO.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/media.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/notes.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/LOOP.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/media.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/notes.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/example.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/END.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/media.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/notes.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/TIMER.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/hardware.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/media.md create mode 100644 docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/ABS.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/ADD.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/DIVIDE.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/SUBTRACT.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/EDGE_DETECTION.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/IMAGE_SMOOTHING.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/INVERT.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/MATMUL.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/SELECT_ARRAY.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/BUTTER.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/FIR.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/PID.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/SAVGOL.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/DF_2_NP.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/MAT_2_DF.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/NP_2_DF.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/hardware.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/media.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/notes.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/example.md create mode 100644 docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/ARRAY_VIEW.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/example.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/MATRIX_VIEW.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/app.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/example.md create mode 100644 docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/output.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/BAR.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/HISTOGRAM.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/LINE.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/SCATTER.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/SCATTER3D.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/SURFACE3D.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/notes.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/TABLE.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/docstring.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/parameters.yaml create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/python_code.txt create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/hardware.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/media.md create mode 100644 docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/notes.md diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/ONE_HOT_ENCODING.md b/docs/nodes/nodes/AI_ML/CLASSIFICATION/ONE_HOT_ENCODING.md new file mode 100644 index 000000000..d3768bbd8 --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/ONE_HOT_ENCODING.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/docstring.txt b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..4e05906b2 --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/docstring.txt @@ -0,0 +1,14 @@ +The ONE_HOT_ENCODING node creates a one hot encoding from a list of categorical features. + The `categories` parameter can be used to generate a one hot encoding without having to pass a dataframe. + By default, all categorical columns in the input dataframe will be encoded. The `columns` + parameter can be used to specify the columns to encode. + + Parameters + ---------- + categories : list of str or list of int, optional + columns: list of str, optional + + Returns + ------- + matrix + The one hot encoding of the input features. diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..fe5a784aa --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +categories: + default: '' + type: array +columns: + default: '' + type: array diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/python_code.txt b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..45458e39d --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/a1-[autogen]/python_code.txt @@ -0,0 +1,36 @@ +from flojoy import flojoy, DataContainer +import pandas as pd + + +@flojoy +def ONE_HOT_ENCODING(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + dc = dc_inputs[0] if len(dc_inputs) > 0 else None + + if dc is not None and dc.type != "dataframe": + raise ValueError( + f"unsupported DataContainer type passed to ONE_HOT_ENCODING node: '{dc.type}'" + ) + + categories = params.get("categories", []) + columns = params.get("columns", []) + + if categories: + data = pd.DataFrame({"category": categories}) + # Force pandas to treat the column as categorical + data["category"] = data["category"].astype("category") + encoded = pd.get_dummies(data, dtype=int) + + return DataContainer(type="dataframe", m=encoded) + + if not dc: + raise ValueError(f"ONE_HOT_ENCODING node did not receive input DataContainer") + + if columns: + encoded = pd.get_dummies(dc.m[columns]) + else: + cat_df = dc.m.select_dtypes(include=["object", "category"]) + encoded = pd.get_dummies(cat_df, dtype=int) + + return DataContainer(type="dataframe", m=encoded) diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/hardware.md b/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/media.md b/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/notes.md b/docs/nodes/nodes/AI_ML/CLASSIFICATION/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/app.txt b/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/app.txt new file mode 100644 index 000000000..c862d5b04 --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/app.txt @@ -0,0 +1,166 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffa", + "type": "CLASSIFICATION", + "data": { + "id": "ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffa", + "label": "ONE HOT ENCODING", + "func": "ONE_HOT_ENCODING", + "type": "CLASSIFICATION", + "ctrls": { + "categories": { + "functionName": "ONE_HOT_ENCODING", + "param": "categories", + "value": "" + }, + "columns": { + "functionName": "ONE_HOT_ENCODING", + "param": "columns", + "value": "smoker,day" + } + }, + "selected": false + }, + "position": { + "x": 492.2217042786417, + "y": 150.33145519440131 + }, + "selected": false, + "positionAbsolute": { + "x": 492.2217042786417, + "y": 150.33145519440131 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "PLOTLY_DATASET-3ec5e34e-b56a-4779-a8cd-e5e1c01d1689", + "type": "SAMPLE_DATASET", + "data": { + "id": "PLOTLY_DATASET-3ec5e34e-b56a-4779-a8cd-e5e1c01d1689", + "label": "PLOTLY DATASET", + "func": "PLOTLY_DATASET", + "type": "SAMPLE_DATASET", + "ctrls": { + "dataset_key": { + "functionName": "PLOTLY_DATASET", + "param": "dataset_key", + "value": "tips" + } + }, + "selected": true + }, + "position": { + "x": 165.0788471357846, + "y": 147.47431233725848 + }, + "selected": true, + "positionAbsolute": { + "x": 165.0788471357846, + "y": 147.47431233725848 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261", + "type": "PLOTLY_VISOR", + "data": { + "id": "TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261", + "label": "TABLE", + "func": "TABLE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 727.9359899929276, + "y": 101.7600266229727 + }, + "selected": false, + "positionAbsolute": { + "x": 727.9359899929276, + "y": 101.7600266229727 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-de791708-214d-46a3-a334-af3b779d7b49", + "type": "TERMINATOR", + "data": { + "id": "END-de791708-214d-46a3-a334-af3b779d7b49", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1133.650275707213, + "y": 167.47431233725848 + }, + "selected": false, + "positionAbsolute": { + "x": 1133.650275707213, + "y": 167.47431233725848 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "PLOTLY_DATASET-3ec5e34e-b56a-4779-a8cd-e5e1c01d1689", + "sourceHandle": "main", + "target": "ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffa", + "targetHandle": "ONE_HOT_ENCODING", + "id": "reactflow__edge-PLOTLY_DATASET-3ec5e34e-b56a-4779-a8cd-e5e1c01d1689main-ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffaONE_HOT_ENCODING" + }, + { + "source": "ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffa", + "sourceHandle": "main", + "target": "TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261", + "targetHandle": "TABLE", + "id": "reactflow__edge-ONE_HOT_ENCODING-b15db30d-818c-4c14-b6a9-2ecc0d76fffamain-TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261TABLE" + }, + { + "source": "TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261", + "sourceHandle": "main", + "target": "END-de791708-214d-46a3-a334-af3b779d7b49", + "targetHandle": "END", + "id": "reactflow__edge-TABLE-a7e5677c-e1cd-466d-a3ec-36742974d261main-END-de791708-214d-46a3-a334-af3b779d7b49END" + } + ], + "viewport": { + "x": 34.964285714285666, + "y": 190.74999999999997, + "zoom": 0.5 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/example.md b/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/example.md new file mode 100644 index 000000000..4c3c8b03c --- /dev/null +++ b/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, `ONE_HOT_ENCODING` is passed the `tips` dataset from the `PLOTLY_DATASET` node. + +`ONE_HOT_ENCODING` is passed `smoker,day` for the `columns` parameter, so the output consists of a dataframe with one hot encodings for only the `smoker` and `day` columns from the input dataset. diff --git a/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/output.txt b/docs/nodes/nodes/AI_ML/CLASSIFICATION/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/OBJECT_DETECTION.md b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/OBJECT_DETECTION.md new file mode 100644 index 000000000..d925e39ea --- /dev/null +++ b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/OBJECT_DETECTION.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/docstring.txt b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..9a32a289f --- /dev/null +++ b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ +Performs object detection on the input `DataContainer` class, specifically for the 'image' type, + represented by the RGB(A) channels. + + Args: + dc_inputs (list[DataContainer]): List of DataContainer objects containing image channels. + params (dict): Additional parameters for object detection (not used in this function). + + Returns: + DataContainer: A `DataContainer` class of type 'image' representing the output image with object detection results. + + Raises: + Exception: If an error occurs during object detection. diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/python_code.txt b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..31e1c7e9e --- /dev/null +++ b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/a1-[autogen]/python_code.txt @@ -0,0 +1,44 @@ +import traceback +from flojoy import flojoy, DataContainer +import numpy as np + +from utils.object_detection.object_detection import detect_object + + +@flojoy +def OBJECT_DETECTION(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + if dc_input.type != "image": + raise ValueError( + f"unsupported DataContainer type passed to OBJECT_DETECTION node: '{dc_input.type}'" + ) + r = dc_input.r + g = dc_input.g + b = dc_input.b + a = dc_input.a + + if a is not None: + nparr = np.stack((r, g, b, a), axis=2) + else: + nparr = np.stack((r, g, b), axis=2) + try: + img_array = detect_object(nparr) + red_channel = img_array[:, :, 0] + green_channel = img_array[:, :, 1] + blue_channel = img_array[:, :, 2] + if img_array.shape[2] == 4: + alpha_channel = img_array[:, :, 3] + else: + alpha_channel = None + return DataContainer( + type="image", + r=red_channel, + g=green_channel, + b=blue_channel, + a=alpha_channel, + ) + + except Exception: + print(traceback.format_exc()) + raise diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/hardware.md b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/media.md b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/notes.md b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/app.txt b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/app.txt new file mode 100644 index 000000000..359e7f014 --- /dev/null +++ b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/app.txt @@ -0,0 +1,166 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "type": "TERMINATOR", + "data": { + "id": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1002.9112708314901, + "y": 193.09986313255396 + }, + "selected": false, + "positionAbsolute": { + "x": 1002.9112708314901, + "y": 193.09986313255396 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115", + "type": "AI_OBJECT_DETECTION", + "data": { + "id": "OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115", + "label": "OBJECT DETECTION", + "func": "OBJECT_DETECTION", + "type": "AI_OBJECT_DETECTION", + "ctrls": {}, + "pip_dependencies": [ + { + "name": "opencv-python-headless", + "v": "4.7.0.72" + } + ], + "selected": false + }, + "position": { + "x": 592.0431664557512, + "y": 194.4231797041855 + }, + "selected": false, + "positionAbsolute": { + "x": 592.0431664557512, + "y": 194.4231797041855 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "type": "LOCAL_FILE_SYSTEM", + "data": { + "id": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "label": "LOCAL FILE", + "func": "LOCAL_FILE", + "type": "LOCAL_FILE_SYSTEM", + "ctrls": { + "file_type": { + "functionName": "LOCAL_FILE", + "param": "file_type", + "value": "image" + }, + "path": { + "functionName": "LOCAL_FILE", + "param": "path", + "value": "" + } + }, + "selected": false + }, + "position": { + "x": 202.04316645575113, + "y": 174.42317970418543 + }, + "selected": false, + "positionAbsolute": { + "x": 202.04316645575113, + "y": 174.42317970418543 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "sourceHandle": "main", + "target": "OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115", + "targetHandle": "OBJECT_DETECTION", + "id": "reactflow__edge-LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9main-OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115OBJECT_DETECTION" + }, + { + "source": "OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115", + "sourceHandle": "main", + "target": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "targetHandle": "END", + "id": "reactflow__edge-OBJECT_DETECTION-95ba5f02-5971-4499-85d5-9d3d0427f115main-END-5e6d94ed-1f79-4c57-8b2f-753a22405f55END" + } + ], + "viewport": { + "x": 197.02420568593084, + "y": 51.49831064898197, + "zoom": 0.9164609015292902 + } + }, + "ctrlsManifest": [ + { + "type": "output", + "name": "Plot", + "minWidth": 2, + "minHeight": 3, + "id": "ctrl-d81b57c0-dda4-4160-894c-8307b5df7ef7", + "hidden": false, + "param": "OBJECT_DETECTION-a9866d79-0bc0-45d7-a2a4-6825b7a012bd", + "val": 0, + "layout": { + "w": 4, + "h": 4, + "x": 2, + "y": 0, + "i": "ctrl-d81b57c0-dda4-4160-894c-8307b5df7ef7", + "minW": 2, + "minH": 3, + "moved": false, + "static": true + } + }, + { + "type": "input", + "name": "Text Input", + "minWidth": 1, + "minHeight": 1, + "id": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45", + "hidden": false, + "param": { + "id": "LOCAL_FILE_LOCALFILE_path", + "functionName": "LOCAL_FILE", + "param": "path", + "nodeId": "LOCAL_FILE-b6953411-4f5e-4f22-aaba-bdc923e56b86", + "inputId": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45" + }, + "val": 0, + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 0, + "i": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45", + "minW": 1, + "minH": 1, + "moved": false, + "static": true + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/example.md b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/example.md new file mode 100644 index 000000000..47464913d --- /dev/null +++ b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/example.md @@ -0,0 +1 @@ +ITS AN OBJECT DETECTION APP WHICH USES OBJECT DETECTION NODE TO DETECT OBJECT. \ No newline at end of file diff --git a/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/output.txt b/docs/nodes/nodes/AI_ML/OBJECT_DETECTION/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/READ_CSV.md b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/READ_CSV.md new file mode 100644 index 000000000..43005404d --- /dev/null +++ b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/READ_CSV.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/docstring.txt b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..d8f38dcda --- /dev/null +++ b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/docstring.txt @@ -0,0 +1,8 @@ + +Read a CSV file from disk or a URL, then return a dataframe. + +Parameters +---------- +file_path : str + File path to the CSV file or an URL of CSV file + diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..f8e4cf8a0 --- /dev/null +++ b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +file_path: + default: https://raw.githubusercontent.com/cs109/2014_data/master/countries.csv + type: string diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/python_code.txt b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..ea1af9192 --- /dev/null +++ b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/a1-[autogen]/python_code.txt @@ -0,0 +1,10 @@ +from flojoy import flojoy, DataContainer +import pandas as pd + + +@flojoy +def READ_CSV(dc_inputs: list[DataContainer], params: dict[str, str]): + + file_path = params["file_path"] + df = pd.read_csv(file_path) # type: ignore + return DataContainer(type="dataframe", m=df) diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/hardware.md b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/media.md b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/notes.md b/docs/nodes/nodes/EXTRACTORS/FILE/READ_CSV/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/PLOTLY_DATASET.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/PLOTLY_DATASET.md new file mode 100644 index 000000000..54e07bf1e --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/PLOTLY_DATASET.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..b9a12f14d --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/parameters.yaml @@ -0,0 +1,14 @@ +dataset_key: + default: wind + options: + - wind + - iris + - carshare + - tips + - election + - experiment + - gapminder + - medals_long + - medals_wide + - stocks + type: select diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..22fcbb61b --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/a1-[autogen]/python_code.txt @@ -0,0 +1,10 @@ +from flojoy import flojoy, DataContainer +from plotly.express import data + + +@flojoy +def PLOTLY_DATASET(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + dataset_key = params["dataset_key"] + df = getattr(data, dataset_key)() + + return DataContainer(type="dataframe", m=df) diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/media.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/app.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/app.txt new file mode 100644 index 000000000..f5cfcc1ef --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/app.txt @@ -0,0 +1,124 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "PLOTLY_DATASET-ca6c81e8-13cd-4e86-b77d-12149be0512c", + "type": "SAMPLE_DATASET", + "data": { + "id": "PLOTLY_DATASET-ca6c81e8-13cd-4e86-b77d-12149be0512c", + "label": "PLOTLY DATASET", + "func": "PLOTLY_DATASET", + "type": "SAMPLE_DATASET", + "ctrls": { + "dataset_key": { + "functionName": "PLOTLY_DATASET", + "param": "dataset_key", + "value": "wind" + } + }, + "selected": false + }, + "position": { + "x": 146.99422599727012, + "y": 155.44926663922587 + }, + "selected": false, + "positionAbsolute": { + "x": 146.99422599727012, + "y": 155.44926663922587 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "type": "PLOTLY_VISOR", + "data": { + "id": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "label": "TABLE", + "func": "TABLE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 546.9942259972702, + "y": 112.59212378208309 + }, + "selected": false, + "positionAbsolute": { + "x": 546.9942259972702, + "y": 112.59212378208309 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "type": "TERMINATOR", + "data": { + "id": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 945.5656545686987, + "y": 162.59212378208304 + }, + "selected": false, + "positionAbsolute": { + "x": 945.5656545686987, + "y": 162.59212378208304 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "PLOTLY_DATASET-ca6c81e8-13cd-4e86-b77d-12149be0512c", + "sourceHandle": "main", + "target": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "targetHandle": "TABLE", + "id": "reactflow__edge-PLOTLY_DATASET-ca6c81e8-13cd-4e86-b77d-12149be0512cmain-TABLE-e800470c-1dfa-418e-b3be-08934023ea54TABLE" + }, + { + "source": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "sourceHandle": "main", + "target": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "targetHandle": "END", + "id": "reactflow__edge-TABLE-e800470c-1dfa-418e-b3be-08934023ea54main-END-166c0b70-9c60-4e42-a618-85b66610c473END" + } + ], + "viewport": { + "x": 231.72498032641062, + "y": 32.9189448113047, + "zoom": 0.7070174838334414 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/example.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/example.md new file mode 100644 index 000000000..83f6e85a7 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/example.md @@ -0,0 +1,9 @@ +## The PLOTLY_DATASET app + +The workflow of this app is described below: + +[PLOTLY_DATASET](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SAMPLE_DATASET/PLOTLY_DATASET/PLOTLY_DATASET.py) : This is a Plotly Dataset node. It takes one parameter `dataset_key`, the name of dataset to load from plotly sample datasets. In this case it is 'wind' which is default value of this parameter. It passing a DataContainer class of an `dataframe` with `m` key e.g `DataContainer(type='dataframe, m=df)` to the next node `Table`. + +[TABLE](https://github.com/flojoy-io/nodes/blob/main/VISUALIZERS/PLOTLY/TABLE/TABLE.py): This node creates a Plotly table visualization for a given input `DataContainer` 'dataframe' type. + +[TERMINATE](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/TERMINATORS/END.py): This node terminating the current script run. The output of this node is same as its parent node. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/output.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/PLOTLY_DATASET/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/R_DATASET.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/R_DATASET.md new file mode 100644 index 000000000..adf96768a --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/R_DATASET.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..86e8227d3 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/docstring.txt @@ -0,0 +1,10 @@ + +Retrieves a pandas DataFrame from rdatasets using the provided dataset_key parameter and returns it wrapped in a DataContainer. + +Args: + dc_inputs (list[DataContainer]): A list of DataContainer objects, but not used in this function. + params (dict): A dictionary of parameters for this function. + dataset_key (str): The key used to retrieve the DataFrame. + +Returns: + DataContainer: A DataContainer object containing the retrieved pandas DataFrame. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e4700895b --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/parameters.yaml @@ -0,0 +1,87 @@ +dataset_key: + default: iris + options: + - ability.cov + - airmiles + - AirPassengers + - airquality + - anscombe + - attenu + - attitude + - austres + - BJsales + - BOD + - cars + - ChickWeight + - chickwts + - co2 + - crimtab + - discoveries + - DNase + - esoph + - euro + - EuStockMarkets + - faithful + - Formaldehyde + - freeny + - HairEyeColor + - Harman23 + - Harman74 + - Indometh + - infert + - InsectSprays + - iris + - iris3 + - islands + - JohnsonJohnson + - LakeHuron + - LakeHuron + - LifeCycleSavings + - Loblolly + - longley + - lynx + - morley + - mtcars + - nhtemp + - Nile + - nottem + - npk + - occupationalStatus + - Orange + - OrchardSprays + - PlantGrowth + - precip + - presidents + - pressure + - Puromycin + - quakes + - randu + - rivers + - rock + - Seatbelts + - sleep + - stackloss + - sunspot.month + - sunspot.year + - sunspots + - swiss + - Theoph + - Titanic + - ToothGrowth + - treering + - trees + - UCBAdmissions + - UKDriverDeaths + - UKgas + - USAccDeaths + - USArrests + - USJudgeRatings + - USPersonalExpenditure + - USPersonalExpenditure + - VADeaths + - volcano + - warpbreaks + - women + - WorldPhones + - WWWusage + type: select diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..0f7bd66d3 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/a1-[autogen]/python_code.txt @@ -0,0 +1,10 @@ +from flojoy import flojoy, DataContainer +from rdatasets import data + + +@flojoy +def R_DATASET(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dataset_key = params["dataset_key"] + df = data(dataset_key) + return DataContainer(type="dataframe", m=df) diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/media.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/app.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/app.txt new file mode 100644 index 000000000..46539a4f9 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/app.txt @@ -0,0 +1,130 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 380, + "height": 293, + "id": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "type": "PLOTLY_VISOR", + "data": { + "id": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "label": "TABLE", + "func": "TABLE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 546.9942259972702, + "y": 112.59212378208309 + }, + "selected": false, + "positionAbsolute": { + "x": 546.9942259972702, + "y": 112.59212378208309 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "type": "TERMINATOR", + "data": { + "id": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 945.5656545686987, + "y": 162.59212378208304 + }, + "selected": false, + "positionAbsolute": { + "x": 945.5656545686987, + "y": 162.59212378208304 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "R_DATASET-d7ea4e14-0fd2-432e-a1b1-b234286f995d", + "type": "SAMPLE_DATASET", + "data": { + "id": "R_DATASET-d7ea4e14-0fd2-432e-a1b1-b234286f995d", + "label": "R DATASET", + "func": "R_DATASET", + "type": "SAMPLE_DATASET", + "ctrls": { + "dataset_key": { + "functionName": "R_DATASET", + "param": "dataset_key", + "value": "iris" + } + }, + "pip_dependencies": [ + { + "name": "rdatasets", + "v": "0.1.0" + } + ], + "selected": false + }, + "position": { + "x": 155.4876003476146, + "y": 177.61454275878134 + }, + "selected": false, + "positionAbsolute": { + "x": 155.4876003476146, + "y": 177.61454275878134 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "sourceHandle": "main", + "target": "END-166c0b70-9c60-4e42-a618-85b66610c473", + "targetHandle": "END", + "id": "reactflow__edge-TABLE-e800470c-1dfa-418e-b3be-08934023ea54main-END-166c0b70-9c60-4e42-a618-85b66610c473END" + }, + { + "source": "R_DATASET-d7ea4e14-0fd2-432e-a1b1-b234286f995d", + "sourceHandle": "main", + "target": "TABLE-e800470c-1dfa-418e-b3be-08934023ea54", + "targetHandle": "TABLE", + "id": "reactflow__edge-R_DATASET-d7ea4e14-0fd2-432e-a1b1-b234286f995dmain-TABLE-e800470c-1dfa-418e-b3be-08934023ea54TABLE" + } + ], + "viewport": { + "x": 231.72498032641062, + "y": 32.9189448113047, + "zoom": 0.7070174838334414 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/example.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/example.md new file mode 100644 index 000000000..c5df5e85c --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/example.md @@ -0,0 +1,9 @@ +## The R_DATASET app + +The workflow of this app is described below: + +[R_DATASET](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SAMPLE_DATASET/R_DATASET/R_DATASET.py) : This is a R Dataset node. It takes one parameter `dataset_key`, the name of dataset to load from [`rdatasets`](https://github.com/vincentarelbundock/Rdatasets/tree/master/csv/datasets) package. In this case it is 'iris' which is default value of this parameter. It passing a DataContainer class of an `dataframe` with `m` key e.g `DataContainer(type='dataframe, m=df)` to the next node `Table`. + +[TABLE](https://github.com/flojoy-io/nodes/blob/main/VISUALIZERS/PLOTLY/TABLE/TABLE.py): This node creates a Plotly table visualization for a given input `DataContainer` 'dataframe' type. + +[TERMINATE](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/TERMINATORS/END.py): This node terminating the current script run. The output of this node is same as its parent node. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/output.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/R_DATASET/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/TEXT_DATASET.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/TEXT_DATASET.md new file mode 100644 index 000000000..6558deadd --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/TEXT_DATASET.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..34feccc0d --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/docstring.txt @@ -0,0 +1,37 @@ +The TEXT_DATASET node loads the 20 newsgroups dataset from scikit-learn. + The data is returned as a dataframe with one column containing the text + and the other containing the category. + + Parameters + ---------- + subset: "train" | "test" | "all", default="train" + Select the dataset to load: "train" for the training set, "test" for the test set, "all" for both. + categories: list of str, optional + Select the categories to load. By default, all categories are loaded. + The list of all categories is: + 'alt.atheism', + 'comp.graphics', + 'comp.os.ms-windows.misc', + 'comp.sys.ibm.pc.hardware', + 'comp.sys.mac.hardware', + 'comp.windows.x', + 'misc.forsale', + 'rec.autos', + 'rec.motorcycles', + 'rec.sport.baseball', + 'rec.sport.hockey', + 'sci.crypt', + 'sci.electronics', + 'sci.med', + 'sci.space', + 'soc.religion.christian', + 'talk.politics.guns', + 'talk.politics.mideast', + 'talk.politics.misc', + 'talk.religion.misc' + remove_headers: boolean, default=false + Remove the headers from the data. + remove_footers: boolean, default=false + Remove the footers from the data. + remove_quotes: boolean, default=false + Remove the quotes from the data. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..cf3e37e96 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/parameters.yaml @@ -0,0 +1,19 @@ +categories: + default: '' + type: array +remove_footers: + default: false + type: boolean +remove_headers: + default: false + type: boolean +remove_quotes: + default: false + type: boolean +subset: + default: train + options: + - train + - test + - all + type: select diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..aee5f28b3 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/a1-[autogen]/python_code.txt @@ -0,0 +1,40 @@ +from flojoy import flojoy, DataContainer +from sklearn.datasets import fetch_20newsgroups +from sklearn.utils import Bunch +import pandas as pd +from typing import cast + + +# TODO: Add more datasets to this node. +@flojoy +def TEXT_DATASET(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + subset = params.get("subset", "train") + categories = params.get("categories", None) + remove_headers = params.get("remove_headers", False) + remove_footers = params.get("remove_footers", False) + remove_quotes = params.get("remove_quotes", False) + + to_remove = [] + if remove_headers: + to_remove.append("headers") + if remove_footers: + to_remove.append("footers") + if remove_quotes: + to_remove.append("quotes") + to_remove = tuple(to_remove) + + if categories: + newsgroups = fetch_20newsgroups( + subset=subset, categories=categories, remove=to_remove + ) + else: + newsgroups = fetch_20newsgroups(subset=subset, remove=to_remove) + + newsgroups = cast(Bunch, newsgroups) + data = newsgroups.data + labels = [newsgroups.target_names[i] for i in newsgroups.target] + + df = pd.DataFrame({"Text": data, "Label": labels}) + return DataContainer(type="dataframe", m=df) diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/media.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/app.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/app.txt new file mode 100644 index 000000000..147eb6669 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/app.txt @@ -0,0 +1,144 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "TEXT_DATASET-2ca8078c-4419-4cbb-93b9-7e28996e6e92", + "type": "SAMPLE_DATASET", + "data": { + "id": "TEXT_DATASET-2ca8078c-4419-4cbb-93b9-7e28996e6e92", + "label": "TEXT DATASET", + "func": "TEXT_DATASET", + "type": "SAMPLE_DATASET", + "ctrls": { + "subset": { + "functionName": "TEXT_DATASET", + "param": "subset", + "value": "train" + }, + "categories": { + "functionName": "TEXT_DATASET", + "param": "categories", + "value": "comp.graphics, alt.atheism" + }, + "remove_headers": { + "functionName": "TEXT_DATASET", + "param": "remove_headers", + "value": true + }, + "remove_footers": { + "functionName": "TEXT_DATASET", + "param": "remove_footers", + "value": true + }, + "remove_quotes": { + "functionName": "TEXT_DATASET", + "param": "remove_quotes", + "value": true + } + }, + "selected": false + }, + "position": { + "x": -81.45429553856721, + "y": 157.80386901898453 + }, + "selected": false, + "positionAbsolute": { + "x": -81.45429553856721, + "y": 157.80386901898453 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-ff3e5e34-44fa-4fba-9498-77f9facbed5f", + "type": "TERMINATOR", + "data": { + "id": "END-ff3e5e34-44fa-4fba-9498-77f9facbed5f", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 670.7381867293549, + "y": 146.92341815739366 + }, + "selected": true, + "positionAbsolute": { + "x": 670.7381867293549, + "y": 146.92341815739366 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "TABLE-150dec7c-56da-482e-a01f-f97a84625247", + "type": "PLOTLY_VISOR", + "data": { + "id": "TABLE-150dec7c-56da-482e-a01f-f97a84625247", + "label": "TABLE", + "func": "TABLE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 195.29523623151152, + "y": 67.15994603870857 + }, + "selected": false, + "positionAbsolute": { + "x": 195.29523623151152, + "y": 67.15994603870857 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "TEXT_DATASET-2ca8078c-4419-4cbb-93b9-7e28996e6e92", + "sourceHandle": "main", + "target": "TABLE-150dec7c-56da-482e-a01f-f97a84625247", + "targetHandle": "TABLE", + "id": "reactflow__edge-TEXT_DATASET-2ca8078c-4419-4cbb-93b9-7e28996e6e92main-TABLE-150dec7c-56da-482e-a01f-f97a84625247TABLE" + }, + { + "source": "TABLE-150dec7c-56da-482e-a01f-f97a84625247", + "sourceHandle": "main", + "target": "END-ff3e5e34-44fa-4fba-9498-77f9facbed5f", + "targetHandle": "END", + "id": "reactflow__edge-TABLE-150dec7c-56da-482e-a01f-f97a84625247main-END-ff3e5e34-44fa-4fba-9498-77f9facbed5fEND" + } + ], + "viewport": { + "x": 21.464285714285666, + "y": 190.74999999999997, + "zoom": 0.5 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/example.md b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/example.md new file mode 100644 index 000000000..1915d4d63 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, the `TEXT_DATASET` node is used to load the 20 newsgroups dataset. Only the training subset is selected, and the two categories that are loaded are `comp.graphics` and `alt.atheism`. + +`REMOVE_HEADERS`, `REMOVE_FOOTERS`, and `REMOVE_QUOTES` are also set to `true` in order to remove the headers, footers, and quotes from the data. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/output.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_DATASETS/TEXT_DATASET/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/SKLEARNIMAGE.md b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/SKLEARNIMAGE.md new file mode 100644 index 000000000..965793af9 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/SKLEARNIMAGE.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..17763ed02 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/docstring.txt @@ -0,0 +1,5 @@ +Node designed to load example images from scikit-image. + + Examples can be found here: + https://scikit-image.org/docs/stable/auto_examples/index.html + diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..d6fadd4ac --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/parameters.yaml @@ -0,0 +1,47 @@ +img_key: + default: astronaut + options: + - astronaut + - binary_blobs + - brain + - brick + - camera + - cat + - cell + - cells3d + - checkerboard + - chelsea + - clock + - coffee + - coins + - colorwheel + - create_image_fetcher + - data_dir + - download_all + - eagle + - file_hash + - grass + - gravel + - horse + - hubble_deep_field + - human_mitosis + - image_fetcher + - immunohistochemistry + - kidney + - lbp_frontal_face_cascade_filename + - lfw_subset + - lily + - logo + - microaneurysms + - moon + - nickel_solidification + - page + - protein_transport + - retina + - rocket + - shepp_logan_phantom + - skin + - stereo_motorcycle + - text + - vortex + type: select diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..c514c207b --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/a1-[autogen]/python_code.txt @@ -0,0 +1,38 @@ +from flojoy import flojoy, DataContainer +from skimage import data + + +@flojoy +def SKLEARNIMAGE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + img_key = params["img_key"] + + img_array = getattr(data, img_key)() + + if len(img_array.shape) == 2: + red = green = blue = img_array + alpha = None + elif len(img_array.shape) == 3: + # Color image + if img_array.shape[2] == 3: + red, green, blue = ( + img_array[:, :, 0], + img_array[:, :, 1], + img_array[:, :, 2], + ) + alpha = None + elif img_array.shape[2] == 4: + red, green, blue, alpha = ( + img_array[:, :, 0], + img_array[:, :, 1], + img_array[:, :, 2], + img_array[:, :, 3], + ) + + return DataContainer( + type="image", + r=red, + g=green, + b=blue, + a=alpha, + ) diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/media.md b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/app.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/app.txt new file mode 100644 index 000000000..32c5e48d2 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/app.txt @@ -0,0 +1,112 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099d", + "type": "AI_OBJECT_DETECTION", + "data": { + "id": "OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099d", + "label": "OBJECT_DETECTION", + "func": "OBJECT_DETECTION", + "type": "AI_OBJECT_DETECTION", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 789.4991899510262, + "y": 238.42581072187443 + }, + "selected": false, + "positionAbsolute": { + "x": 789.4991899510262, + "y": 238.42581072187443 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-96628568-bd55-42e1-af93-59402261ba3e", + "type": "TERMINATOR", + "data": { + "id": "END-96628568-bd55-42e1-af93-59402261ba3e", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1197.4316774983556, + "y": 230.30485876868525 + }, + "selected": false, + "positionAbsolute": { + "x": 1197.4316774983556, + "y": 230.30485876868525 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "SKLEARNIMAGE-225596a1-2971-4367-91ed-74671aba172a", + "type": "SAMPLE_IMAGE", + "data": { + "id": "SKLEARNIMAGE-225596a1-2971-4367-91ed-74671aba172a", + "label": "SKLEARNIMAGE", + "func": "SKLEARNIMAGE", + "type": "SAMPLE_IMAGE", + "ctrls": { + "img_key": { + "functionName": "SKLEARNIMAGE", + "param": "img_key", + "value": "astronaut" + } + }, + "pip_dependencies": [ + { + "name": "scikit-image", + "v": "0.20.0" + } + ], + "selected": false + }, + "position": { + "x": 443.97916363890124, + "y": 237.20815230248894 + }, + "selected": false, + "positionAbsolute": { + "x": 443.97916363890124, + "y": 237.20815230248894 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099d", + "sourceHandle": "main", + "target": "END-96628568-bd55-42e1-af93-59402261ba3e", + "targetHandle": "END", + "id": "reactflow__edge-OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099dmain-END-96628568-bd55-42e1-af93-59402261ba3eEND" + }, + { + "source": "SKLEARNIMAGE-225596a1-2971-4367-91ed-74671aba172a", + "sourceHandle": "main", + "target": "OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099d", + "targetHandle": "OBJECT_DETECTION", + "id": "reactflow__edge-SKLEARNIMAGE-225596a1-2971-4367-91ed-74671aba172amain-OBJECT_DETECTION-5aa2a713-048e-4f3c-ba00-94eca81e099dOBJECT_DETECTION" + } + ], + "viewport": { + "x": 197.88510420585555, + "y": 38.16888746940003, + "zoom": 0.7622193595343526 + } + }, + "ctrlsManifest": [] +} \ No newline at end of file diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/example.md b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/example.md new file mode 100644 index 000000000..d84fb0e7d --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/example.md @@ -0,0 +1,9 @@ +## The SKLEARNIMAGE app + +The workflow of this app is described below: + +[SKLEARNIMAGE](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SAMPLE_IMAGES/SKLEARN_IMAGE/SKLEARNIMAGE.py) : This is a SK Learn Image node. It takes one parameter `img_key`, the name of sample image to load from `scikit-image` package. In this case it is 'astronaut' which is default value of this parameter. It passing a DataContainer class of an image (r,g,b,a) to the next node `Object Detection`. + +[OBJECT_DETECTION](https://github.com/flojoy-io/nodes/blob/main/AI_ML/OBJECT_DETECTION/OBJECT_DETECTION.py): This is Object detection node which detects objects from a given `DataContainer` class of `image` type using `opencv` python library. + +[TERMINATE](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/TERMINATORS/END.py): This node terminating the current script run. The output of this node is same as its parent node. diff --git a/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/output.txt b/docs/nodes/nodes/GENERATORS/SAMPLE_IMAGES/SKLEARNIMAGE/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.md new file mode 100644 index 000000000..5ef7f9649 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..c824bc749 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Generates a single x-y vector of numeric (floating point) constants \ No newline at end of file diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..1df59e542 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +constant: + default: 3 + type: float diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..00aa42ac4 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def CONSTANT(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + if dc_inputs.__len__() > 0: + x = dc_inputs[0].y + y = np.full(len(x), params["constant"]) + return DataContainer(x=x, y=y) + + x = list() + for i in range(1000): + x.append(i) + y = np.full(1000, params["constant"]) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/CONSTANT/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.md new file mode 100644 index 000000000..a3730deb0 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..04ed233e6 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +referred_node: + default: '' + type: node_reference diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..a47449340 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/a1-[autogen]/python_code.txt @@ -0,0 +1,17 @@ +from flojoy import flojoy, DataContainer, get_job_result +from rq.job import NoSuchJobError +import traceback + + +@flojoy +def FEEDBACK(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + referred_node = params["referred_node"] + + try: + result = get_job_result(referred_node) + return result + except (Exception, NoSuchJobError) as e: + x = dc_inputs[0].x + y = dc_inputs[0].y + print("Job not found: ", e, traceback.format_exc()) + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/app.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/app.txt new file mode 100644 index 000000000..617e5f60c --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/app.txt @@ -0,0 +1,422 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 181, + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "type": "default", + "position": { + "x": 199.83204415740659, + "y": 241.1242907400127 + }, + "data": { + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "label": "loop", + "func": "LOOP", + "type": "LOOP", + "ctrls": { + "num_loops": { + "functionName": "LOOP", + "param": "num_loops", + "value": "2" + } + }, + "inputs": [ + { + "name": "end", + "id": "end", + "type": "source" + }, + { + "name": "body", + "id": "body", + "type": "source" + } + ], + "selected": true + }, + "selected": true, + "positionAbsolute": { + "x": 199.83204415740659, + "y": 241.1242907400127 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "label": "12", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": 12 + } + }, + "selected": false + }, + "position": { + "x": 489.05257411095033, + "y": 181.57268309469492 + }, + "selected": false, + "positionAbsolute": { + "x": 489.05257411095033, + "y": 181.57268309469492 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "type": "ARITHMETIC", + "data": { + "id": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "label": "add", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 946.2259097889257, + "y": 362.8672435261466 + }, + "selected": false, + "positionAbsolute": { + "x": 946.2259097889257, + "y": 362.8672435261466 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "type": "LOOP", + "data": { + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "label": "Goto Loop", + "func": "GOTO", + "type": "LOOP", + "ctrls": { + "goto_node_id": { + "functionName": "GOTO", + "param": "goto_node_id", + "value": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb" + } + }, + "selected": false + }, + "position": { + "x": 1144.5272324794553, + "y": 342.4701951821843 + }, + "selected": false, + "positionAbsolute": { + "x": 1144.5272324794553, + "y": 342.4701951821843 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "type": "TERMINATOR", + "data": { + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 478.0211151222852, + "y": -26.63223441103102 + }, + "selected": false, + "positionAbsolute": { + "x": 478.0211151222852, + "y": -26.63223441103102 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "type": "SIMULATION", + "data": { + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "label": "FeedBack", + "func": "FEEDBACK", + "type": "SIMULATION", + "ctrls": { + "referred_node": { + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04" + } + }, + "selected": false + }, + "position": { + "x": 728.6605236177678, + "y": 231.2645362967596 + }, + "selected": false, + "positionAbsolute": { + "x": 728.6605236177678, + "y": 231.2645362967596 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-54835399-b8a7-4b80-9125-fdde08ead00d", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-54835399-b8a7-4b80-9125-fdde08ead00d", + "label": "43", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "43" + } + }, + "selected": false + }, + "position": { + "x": -113.95140341495814, + "y": 236.00342606417018 + }, + "selected": false, + "positionAbsolute": { + "x": -113.95140341495814, + "y": 236.00342606417018 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440", + "label": "-1", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "-1" + } + }, + "selected": false + }, + "position": { + "x": 551.7628822993277, + "y": 434.57485463559885 + }, + "selected": false, + "positionAbsolute": { + "x": 551.7628822993277, + "y": 434.57485463559885 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138CONSTANT" + }, + { + "source": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "sourceHandle": "main", + "target": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "targetHandle": "GOTO", + "id": "reactflow__edge-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04main-GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263GOTO" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "end", + "target": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "targetHandle": "END", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbend-END-12d90ef2-4084-4532-94f2-dde2ba198b79END" + }, + { + "source": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "sourceHandle": "main", + "target": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "targetHandle": "FEEDBACK", + "id": "reactflow__edge-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138main-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0FEEDBACK" + }, + { + "source": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "sourceHandle": "main", + "target": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "targetHandle": "ADD", + "id": "reactflow__edge-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0main-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04ADD" + }, + { + "source": "CONSTANT-54835399-b8a7-4b80-9125-fdde08ead00d", + "sourceHandle": "main", + "target": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "targetHandle": "LOOP", + "id": "reactflow__edge-CONSTANT-54835399-b8a7-4b80-9125-fdde08ead00dmain-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbLOOP" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440CONSTANT" + }, + { + "source": "CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440", + "sourceHandle": "main", + "target": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "targetHandle": "add_y", + "id": "reactflow__edge-CONSTANT-f606c508-90df-4d7c-a629-86ea8bc72440main-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04add_y" + } + ], + "viewport": { + "x": 178.95788989770995, + "y": 69.74260865081652, + "zoom": 0.7756174461376771 + } + }, + "ctrlsManifest": [ + { + "type": "output", + "name": "Seven Segment Display", + "minWidth": 2, + "minHeight": 3, + "id": "ctrl-4b484ce1-533a-4be6-a395-c9b96104d9e9", + "hidden": false, + "param": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "val": 0, + "layout": { + "w": 2, + "h": 3, + "x": 4, + "y": 0, + "i": "ctrl-4b484ce1-533a-4be6-a395-c9b96104d9e9", + "minW": 2, + "minH": 3, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Text Input", + "minWidth": 1, + "minHeight": 1, + "id": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92", + "hidden": false, + "param": { + "id": "CONDITIONAL_CONDITIONAL_operator_type", + "functionName": "CONDITIONAL", + "param": "operator_type", + "nodeId": "CONDITIONAL-2e565212-13e4-497c-89ca-2440fb98f68c", + "inputId": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92" + }, + "val": "<=", + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 0, + "i": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92", + "minW": 1, + "minH": 1, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Node Reference", + "minWidth": 2, + "minHeight": 2, + "id": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "hidden": false, + "param": { + "id": "FEEDBACK_FeedBack_referred_node", + "functionName": "FEEDBACK", + "param": "referred_node", + "nodeId": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "inputId": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "type": "node_reference" + }, + "val": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "layout": { + "w": 2, + "h": 2, + "x": 2, + "y": 0, + "i": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "minW": 2, + "minH": 2, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Slider", + "minWidth": 2, + "minHeight": 1, + "id": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "hidden": false, + "param": { + "id": "num_loops", + "functionName": "LOOP", + "param": "num_loops", + "nodeId": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "inputId": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "type": "int" + }, + "val": "2", + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 2, + "i": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "minW": 2, + "minH": 1, + "moved": false, + "static": false + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/example.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/example.md new file mode 100644 index 000000000..d88bda163 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/example.md @@ -0,0 +1 @@ +THIS APP DEMONSTRATES HOW FEEDBACK NODE, LOOPS NODE & GOTO NODE WORKS. diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/output.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/FEEDBACK/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.md new file mode 100644 index 000000000..86c96d3e9 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..bfac8970e --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/parameters.yaml @@ -0,0 +1,9 @@ +end: + default: 0 + type: float +start: + default: 10 + type: float +step: + default: 1000 + type: int diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..359e31cef --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/a1-[autogen]/python_code.txt @@ -0,0 +1,12 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def LINSPACE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + x = None + if dc_inputs.__len__() > 0: + x = dc_inputs[0].y + y = np.linspace(params["start"], params["end"], params["step"]) + result = DataContainer(x=x, y=y) + return result diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/LINSPACE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/RAND.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/RAND.md new file mode 100644 index 000000000..0b179bf65 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/RAND.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..2f8bec7cb --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/a1-[autogen]/python_code.txt @@ -0,0 +1,29 @@ +import numpy as np +from flojoy import flojoy, DataContainer +import traceback + + +@flojoy +def RAND(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + x = None + if len(dc_inputs) > 0: + x = dc_inputs[0].y + y = np.random.normal(size=len(x)) + else: + y = np.random.normal(size=1000) + + return DataContainer(x=x, y=y) + + +@flojoy +def RAND_MOCK(dc_inputs, params): + print("running mock version of rand") + x = None + if len(dc_inputs) > 0: + x = dc_inputs[0].y + y = x + else: + y = np.full( + 1000, 1000 + ) # for reproducibility returning an array with constant values + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/RAND/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/SECOND_ORDER_SYSTEM.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/SECOND_ORDER_SYSTEM.md new file mode 100644 index 000000000..5cb717946 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/SECOND_ORDER_SYSTEM.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..b9bd0b167 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +d1: + default: 250 + type: float +d2: + default: 100 + type: float diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..39e3f9dd8 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/a1-[autogen]/python_code.txt @@ -0,0 +1,52 @@ +import numpy as np +from flojoy import flojoy, DataContainer +from node_sdk.small_memory import SmallMemory + +memory_key = "SECOND_ORDER_SYSTEM" + + +@flojoy +def SECOND_ORDER_SYSTEM(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + # Let's first define things that won't change over + # each iteration: time constants, etc ... + d1 = params["d1"] # first time constant in us, 250 + d2 = params["d2"] # second time constant in us, 100 + node_id = params.get("node_id", 0) + + # ... and now some helper functions + x1 = np.exp(-1.0 / d1) if d1 > 0 else 0.0 + x2 = np.exp(-1.0 / d2) if d2 > 0 else 0.0 + ac = (1.0 - x1) * (1.0 - x2) + bpd = x1 + x2 + bd = x1 * x2 + + # Now we require memory. The only thing we need in memory is the last two + # values the system had in this basic example. + data = SmallMemory().read_memory(node_id, memory_key) + if data is None: + initialize = True + elif type(data) == np.ndarray: + initialize = False + else: + raise TypeError("Error loading object from REDIS.") + + # We're going to store and read the data in reverse order to + # how it is accessed here. We will write the functionality + # below to assume the most recent time step is the first + # index. However, for visualization and external access, + # it makes the most sense to have the first time step + # as the first index! + y_primes = np.zeros((2, 1)) if initialize else data[::-1] + + # Using input from controller as v[0].y ... + response = ac * dc_inputs[0].y[-1] + bpd * y_primes[0] - bd * y_primes[1] + y_primes[1] = y_primes[0] + + # prepend the most recent result to the front of the histrory + y_primes = np.insert(y_primes, 0, response) + # We now write to memory, reversing the order ... + SmallMemory().write_to_memory(node_id, memory_key, y_primes[::-1]) + # ... and return the result! + return DataContainer( + x=dc_inputs[0].y, y=np.ones_like(dc_inputs[0].y) * float(y_primes[0]) + ) # returns input output pair diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SECOND_ORDER_SYSTEM/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/SINE.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/SINE.md new file mode 100644 index 000000000..6e22560e1 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/SINE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..bd905aeea --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/parameters.yaml @@ -0,0 +1,20 @@ +amplitude: + default: 1 + type: float +frequency: + default: 1 + type: float +offset: + default: 0 + type: float +phase: + default: 0.0 + type: float +waveform: + default: sine + options: + - sine + - square + - triangle + - sawtooth + type: select diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..dc5327e0d --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/a1-[autogen]/python_code.txt @@ -0,0 +1,31 @@ +import numpy as np +from flojoy import flojoy, DataContainer +from scipy import signal + + +@flojoy +def SINE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + valid_waveforms = ["sine", "square", "triangle", "sawtooth"] + x = None + if dc_inputs.__len__() > 0: + x = dc_inputs[0].y + + waveform = params["waveform"] + A = params["amplitude"] + F = params["frequency"] + Y0 = params["offset"] + PHASE = params["phase"] + if waveform not in valid_waveforms: + waveform = valid_waveforms[0] + print("invalid waveform passed as param, using default:", waveform) + + if waveform == "sine": + y = Y0 + A * np.sin(np.radians(2 * np.pi * F) * x + np.radians(PHASE)) + elif waveform == "square": + y = Y0 + A * signal.square(2 * np.pi * F * x / 10 + np.radians(PHASE)) + elif waveform == "triangle": + y = Y0 + A * signal.sawtooth(2 * np.pi * F * x / 10 + np.radians(PHASE), 0.5) + elif waveform == "sawtooth": + y = Y0 + A * signal.sawtooth(2 * np.pi * F / 10 * x + np.radians(PHASE)) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/SINE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/TIMESERIES.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/TIMESERIES.md new file mode 100644 index 000000000..136c22c69 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/TIMESERIES.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/docstring.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..931b57977 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/docstring.txt @@ -0,0 +1,2 @@ + +Generates a random timeseries vector diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/python_code.txt b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..00df7b4b6 --- /dev/null +++ b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/a1-[autogen]/python_code.txt @@ -0,0 +1,18 @@ +import numpy as np +from flojoy import flojoy, DataContainer +import pandas.testing as testing +import traceback + + +@flojoy +def TIMESERIES(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + try: + np.random.seed(1) + testing.N, testing.K = 1000, 1 # rows, columns + df = testing.makeTimeDataFrame(freq="MS") + except Exception: + print(traceback.format_exc()) + + return DataContainer(x=df.index.to_numpy(), y=df["A"].to_numpy()) diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/hardware.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/media.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/notes.md b/docs/nodes/nodes/GENERATORS/SIMULATIONS/TIMESERIES/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/KEITHLEY2400.md b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/KEITHLEY2400.md new file mode 100644 index 000000000..e92ec9261 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/KEITHLEY2400.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..702d9b2f7 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/docstring.txt @@ -0,0 +1,2 @@ + +IV curve measurement with a Keithley 2400 source meter, send voltages and measure currents diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..5c8db9102 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +baudrate: + default: 9600 + type: float +comport: + default: /dev/ttyUSB0 + type: string diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..e26f00d58 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/a1-[autogen]/python_code.txt @@ -0,0 +1,66 @@ +import serial +from flojoy import flojoy, DataContainer + + +@flojoy +def KEITHLEY2400(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + # Start serial communication with the instrument + ser: serial = serial.Serial() + + # Specific parameters + ser.port = params["comport"] # Specify serial port for com + ser.baudrate = params["baudrate"] # Specify Baudrate + + # General parameters + ser.bytesize = serial.EIGHTBITS # Specify Bites number + ser.parity = serial.PARITY_NONE # Specify Parity + ser.stopbits = serial.STOPBITS_ONE # Specify Stop bites + ser.timeout = 1 + # Open Serial Com + ser.open() + + # Keithley 2400 Configuration + ser.write(b"*RST\n") # reinitialisation of the instrument + ser.write(b":SOUR:FUNC:MODE VOLT\n") # Sourcing tension + ser.write(b':SENS:FUNC "CURR"\n') # Measuring current + ser.write( + b":SENS:CURR:PROT 1.05\n" + ) # Current protection set at 1.05A (Keithley 2400) + + voltages = dc_inputs[0].y + currents_neg: list[float] = [] # measured currents + + for voltage in voltages: + ser.write(b":SOUR:VOLT %f\n" % voltage) # Source Tension (V) + ser.write(b":OUTP ON\n") # Instrument output open + ser.write(b":INIT\n") # Start measuring + ser.write(b":FETC?\n") # Retrieve the measured values + + current_str: str = ( + ser.readline().decode("ascii").strip() + ) # Save answers in a string + voltage_current_values: str = current_str.split(",") # Split the string + currents_neg.append(-float(voltage_current_values[1])) + + ser.write(b":OUTP OFF\n") # Close output from Instrument + + # Close Serial Communication + ser.close() + + return DataContainer(x={"a": voltages, "b": currents_neg}, y=currents_neg) + + +@flojoy +def KEITHLEY2400_MOCK(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + Mock Function for Keithley2400 node + + voltages = dc_inputs[0].y + currents_neg = [] # measured currents + + for voltage in voltages: + voltage_current_values = voltages * 0.15 + currents_neg.append(-float(voltage_current_values[1])) + + return DataContainer(x={"a": voltages, "b": currents_neg}, y=currents_neg) diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/app.txt new file mode 100644 index 000000000..6d9f8466f --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/app.txt @@ -0,0 +1,266 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 135, + "id": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "type": "default", + "data": { + "id": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "0" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0.6" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "10" + } + }, + "selected": false + }, + "position": { + "x": 1.3714312052589008, + "y": 280.86285687947384 + }, + "selected": false, + "positionAbsolute": { + "x": 1.3714312052589008, + "y": 280.86285687947384 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2", + "type": "KEITHLEY2400", + "data": { + "id": "KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2", + "label": "KEITHLEY2400", + "func": "KEITHLEY2400", + "type": "KEITHLEY2400", + "ctrls": { + "comport": { + "functionName": "KEITHLEY2400", + "param": "comport", + "value": "/dev/ttyUSB0" + }, + "baudrate": { + "functionName": "KEITHLEY2400", + "param": "baudrate", + "value": "9600" + } + }, + "selected": false + }, + "position": { + "x": 411.6611111244576, + "y": 279.7462908670198 + }, + "selected": false, + "positionAbsolute": { + "x": 411.6611111244576, + "y": 279.7462908670198 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-7ebef9ed-07f9-4363-abc6-16e0d50589f7", + "type": "TERMINATOR", + "data": { + "id": "END-7ebef9ed-07f9-4363-abc6-16e0d50589f7", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1226.0471936627987, + "y": 282.4445145949168 + }, + "selected": false, + "positionAbsolute": { + "x": 1226.0471936627987, + "y": 282.4445145949168 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "LINE-f9a46878-a550-45e4-9564-d2fcb73a8134", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-f9a46878-a550-45e4-9564-d2fcb73a8134", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 784.8859596750218, + "y": 242.04955647111308 + }, + "selected": false, + "positionAbsolute": { + "x": 784.8859596750218, + "y": 242.04955647111308 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "sourceHandle": "main", + "target": "KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2", + "targetHandle": "KEITHLEY2400", + "id": "reactflow__edge-LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135cemain-KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2KEITHLEY2400" + }, + { + "source": "KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2", + "sourceHandle": "main", + "target": "LINE-f9a46878-a550-45e4-9564-d2fcb73a8134", + "targetHandle": "LINE", + "id": "reactflow__edge-KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2main-LINE-f9a46878-a550-45e4-9564-d2fcb73a8134LINE" + }, + { + "source": "LINE-f9a46878-a550-45e4-9564-d2fcb73a8134", + "sourceHandle": "main", + "target": "END-7ebef9ed-07f9-4363-abc6-16e0d50589f7", + "targetHandle": "END", + "id": "reactflow__edge-LINE-f9a46878-a550-45e4-9564-d2fcb73a8134main-END-7ebef9ed-07f9-4363-abc6-16e0d50589f7END" + } + ], + "viewport": { + "x": 226.6796457828928, + "y": 31.056018042519327, + "zoom": 0.6853504029717089 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + }, + "param": { + "id": "LINSPACE_LINSPACE_start", + "functionName": "LINSPACE", + "param": "start", + "nodeId": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "inputId": "INPUT_PLACEHOLDER", + "type": "float" + }, + "val": 0 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-ea31ed1b-1e45-4f56-a3e2-763e1b5ed939", + "layout": { + "x": 0, + "y": 1, + "h": 2, + "w": 2, + "i": "ctrl-ea31ed1b-1e45-4f56-a3e2-763e1b5ed939", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "LINSPACE_LINSPACE_end", + "functionName": "LINSPACE", + "param": "end", + "nodeId": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "inputId": "ctrl-ea31ed1b-1e45-4f56-a3e2-763e1b5ed939", + "type": "float" + }, + "val": 0.6 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-d950fa9c-10f6-4466-9043-01cb5812ed88", + "layout": { + "x": 0, + "y": 2, + "h": 2, + "w": 2, + "i": "ctrl-d950fa9c-10f6-4466-9043-01cb5812ed88", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "LINSPACE_LINSPACE_step", + "functionName": "LINSPACE", + "param": "step", + "nodeId": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "inputId": "ctrl-d950fa9c-10f6-4466-9043-01cb5812ed88", + "type": "float" + }, + "val": 10 + }, + { + "type": "input", + "name": "Text Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-01e8bbab-f3a8-4fc3-8bd5-18c69b7ca3b1", + "layout": { + "x": 0, + "y": 3, + "h": 2, + "w": 2, + "i": "ctrl-01e8bbab-f3a8-4fc3-8bd5-18c69b7ca3b1", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "KEITHLEY2400_KEITHLEY2400_comport", + "functionName": "KEITHLEY2400", + "param": "comport", + "nodeId": "KEITHLEY2400-54df98a4-25c9-4fbe-9430-7dbadacf03f2", + "inputId": "ctrl-01e8bbab-f3a8-4fc3-8bd5-18c69b7ca3b1", + "type": "string" + }, + "val": "/dev/ttyUSB0" + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/example.md new file mode 100644 index 000000000..04b2cb722 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/example.md @@ -0,0 +1,60 @@ + +In this page, we will go through an example on how to record an Iv curve, using Flojoy, a Keithley2400 sourcemeter and a computer + +Also covered will be a general guide on how to create a flojoy app including node parameters and saving the app. + + +**HARDWARE** : In order to record an IV curve from an electric device (LED, Solar cells, etc,..) with Flojoy, you'll need a setup with : + +- A Sourcemeter Keithley 2400, which is able to send voltages to the electronic device and record current from it. It has its own nodes in the Flojoy application called KEITHLEY2400. +- A source of light that you'll use as a fake sun for calibrating the output of your solar cells. (You can also use the real sun by doing the experiment outside) +- A computer which is connected to the Keithley 2400 with a serial communication cable. + + +![image](./assets/KEITHLEY2400_setup.jpg) +*Setup with a computer, a Keithley2400 sourcemeter, a solar cell for testing and artificial sun* + + + +**SOFTWARE** : In order to record an IV curve you'll need to use our software Flojoy, you can follow these instructions https://docs.flojoy.io/getting-started/install/ in order to use the software on your computer + + + +**PACKAGE** : + + - After installing all the package from the Flojoy software you'll need to install the "pyserial" package : $ pip install pyserial, this will allow you to use serial communications with the Keithley 2400 to exchange data with him. + +**RUN FLOJOY** : When your setup is ready you can run the app Flojoy and start using it in order to record your IV curve, here are the steps to follow when opening the app : + +- Selecting the nodes you need for your IV curve : LINSPACE (in Generators, SIMULATION) ; KEITHLEY2400 (in Instruments, KEITHLEY2400) ; LINE (in Visualizations, VISOR) and finally END (in Terminator, TERMINATOR). Place them and connect them together on the graphical interface : + +![image](./assets/KEITHLEY2400_nodes.png) +*Choose the nodes you'll need from this menu* + +After selecting your nodes from the menu you should have an interface similar to this : + +![image](./assets/KEITHLEY2400_nodes1.png) +*Classical setup for an IV curve measurement* + + +- Choosing the parameters for your experiment, you need to go to the Controle section by clicking on CTRLS and then toggle Edit, after that you can clisk on the button "add" and choose the type of parameters you want to add, to start we'll add NUMERIC INPUT to define our voltages range : + LINSPACE START : Define your first Voltage + LINSPACE END : Define your last Voltage + LINSPACE STEP : Define the number of voltages between the first and the last one. + + Here's a look at the CRTL section after defining the LINSPACE parameters : + + ![image](./assets/KEITHLEY2400_parameters.png) + * Crtl section after defining the parameters for LINSPACE* + +- After that you'll need to select your serial communication parameters for the Comport, you'll need to add a TEXT INPUT : + KEITHLEY2400 COMPORT : Define your communication port where the sourcemeter is connected (Default is : /dev/tty/USBO (Linux)) + KEITHLEY2400 BAUDRATE : Define the Baud rate of your communication protocol (Default is : 9600, the value has to corresponds to the Instrument settings) + +- Last step : When you have defined all your parameters, you should turn on your sourcemeter, place your solar cell under the light and click "PLAY" in order to start the experiment. The LINSPACE will generate data that will be send as voltage to the instrument and we'll record the output current from the solar cell. + +- The plot will be available in the "Debug" section where you can use your data and play with it using Plotly interface. + +![image](./assets/KEITHLEY2400_ivcurve.png) + +- When you are done you can save the Flojoy interface in your computer, so you'll be able to use it again for other measurements. diff --git a/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/KEITHLEY/KEITHLEY2400/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/LABJACKU3.md b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/LABJACKU3.md new file mode 100644 index 000000000..dd41bf346 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/LABJACKU3.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..6d323ef90 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Takes a number of sensors as parameters and return their temperature measurement \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..564f2cf68 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +numbers: + default: 1 + type: int diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..d94430914 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/a1-[autogen]/python_code.txt @@ -0,0 +1,60 @@ +from flojoy import flojoy, DataContainer +import LabJackPython +import u3 # Import the library from LabJackPython in order to use our U3-LV device + + +@flojoy +def LABJACKU3(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + voltages: list[float] = [] + temperatures: list[float] = [] + temperatures_celsius: list[float] = [] + sensor_num: list[int] = [] + sensor_number: int = params["numbers"] + + # Create an instance of U3 class + d = u3.U3() + # Config the U3 for daq from temperature sensors + d.configIO(FIOAnalog=255, EIOAnalog=0) + + for i in range(0, sensor_number): + # Loop on the LabJack pins + voltage: float = d.getAIN(i) + # Convert Voltage into temperature in Celsius : + temperature: float = voltage * 100.0 + temperature_celsius: float = (temperature - 32) / 1.8 + + sensor_num.append(i + 1) + voltages.append(voltage) + temperatures.append(temperature) + temperatures_celsius.append(temperature_celsius) + + return DataContainer( + type="ordered_pair", + x={"a": sensor_num, "b": temperatures_celsius}, + y=temperatures_celsius, + ) + + +@flojoy +def LABJACKU3_MOCK(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + Mock function for Labjack node + voltages: list[float] = [] # Declaration of variable + temperatures: list[float] = [] + temperatures_celsius: list[float] = [] + sensor_number = 6 # Mock Number of sensors + voltage = 0.6 # Mock value + + for i in range(1, sensor_number): + # Convert Voltage into temperature in Celsius + temperature: float = voltage * 100.0 + temperature_celsius: float = (temperature - 32) / 1.8 + + voltages.append(voltage) + temperatures.append(temperature) + temperatures_celsius.append(temperature_celsius) + + return DataContainer( + x={"a": temperatures, "b": temperatures_celsius}, y=temperatures_celsius + ) diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/app.txt new file mode 100644 index 000000000..fe68d8a88 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/app.txt @@ -0,0 +1,216 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1", + "type": "LABJACK", + "data": { + "id": "LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1", + "label": "LABJACKU3", + "func": "LABJACKU3", + "type": "LABJACK", + "ctrls": { + "numbers": { + "functionName": "LABJACKU3", + "param": "numbers", + "value": "6" + } + }, + "pip_dependencies": [ + { + "name": "labjackpython", + "v": "2.1.0" + } + ], + "selected": false + }, + "position": { + "x": 501.52747152415037, + "y": 328.9688571496145 + }, + "selected": false, + "positionAbsolute": { + "x": 501.52747152415037, + "y": 328.9688571496145 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "GOTO-ffb40d6a-c197-4010-8a99-8672d63939e6", + "type": "LOOP", + "data": { + "id": "GOTO-ffb40d6a-c197-4010-8a99-8672d63939e6", + "label": "GOTO", + "func": "GOTO", + "type": "LOOP", + "ctrls": { + "goto_node_id": { + "functionName": "GOTO", + "param": "goto_node_id", + "value": "LOOP-931e5323-9532-4bc3-af39-0cb17c079331" + } + }, + "selected": false + }, + "position": { + "x": 1247.241757238436, + "y": 318.96885714961445 + }, + "selected": false, + "positionAbsolute": { + "x": 1247.241757238436, + "y": 318.96885714961445 + }, + "dragging": true + }, + { + "width": 150, + "height": 181, + "id": "LOOP-931e5323-9532-4bc3-af39-0cb17c079331", + "type": "LOOP", + "data": { + "id": "LOOP-931e5323-9532-4bc3-af39-0cb17c079331", + "label": "LOOP", + "func": "LOOP", + "type": "LOOP", + "ctrls": { + "num_loops": { + "functionName": "LOOP", + "param": "num_loops", + "value": "10" + } + }, + "inputs": [ + { + "name": "end", + "id": "end", + "type": "source" + }, + { + "name": "body", + "id": "body", + "type": "source" + } + ], + "selected": false + }, + "position": { + "x": 101.52747152415034, + "y": 251.82600000675723 + }, + "selected": false, + "positionAbsolute": { + "x": 101.52747152415034, + "y": 251.82600000675723 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-2cf1ce1a-e1be-4aed-87d1-b240e7673f52", + "type": "TERMINATOR", + "data": { + "id": "END-2cf1ce1a-e1be-4aed-87d1-b240e7673f52", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1215.8131858098645, + "y": 68.9688571496144 + }, + "selected": false, + "positionAbsolute": { + "x": 1215.8131858098645, + "y": 68.9688571496144 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7", + "type": "PLOTLY_VISOR", + "data": { + "id": "BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7", + "label": "BAR", + "func": "BAR", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 832.9560429527219, + "y": 287.54028572104295 + }, + "selected": false, + "positionAbsolute": { + "x": 832.9560429527219, + "y": 287.54028572104295 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-931e5323-9532-4bc3-af39-0cb17c079331", + "sourceHandle": "body", + "target": "LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1", + "targetHandle": "LABJACKU3", + "id": "reactflow__edge-LOOP-931e5323-9532-4bc3-af39-0cb17c079331body-LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1LABJACKU3" + }, + { + "source": "LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1", + "sourceHandle": "main", + "target": "BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7", + "targetHandle": "BAR", + "id": "reactflow__edge-LABJACKU3-da654963-a9c7-4668-bbf5-5c04d14065f1main-BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7BAR" + }, + { + "source": "BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7", + "sourceHandle": "main", + "target": "GOTO-ffb40d6a-c197-4010-8a99-8672d63939e6", + "targetHandle": "GOTO", + "id": "reactflow__edge-BAR-9baa21b1-ef0f-4b3a-9eac-86ad8d9df7d7main-GOTO-ffb40d6a-c197-4010-8a99-8672d63939e6GOTO" + }, + { + "source": "LOOP-931e5323-9532-4bc3-af39-0cb17c079331", + "sourceHandle": "end", + "target": "END-2cf1ce1a-e1be-4aed-87d1-b240e7673f52", + "targetHandle": "END", + "id": "reactflow__edge-LOOP-931e5323-9532-4bc3-af39-0cb17c079331end-END-2cf1ce1a-e1be-4aed-87d1-b240e7673f52END" + } + ], + "viewport": { + "x": 280.39350600472176, + "y": 94.24473945324536, + "zoom": 0.8555103158038797 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/example.md new file mode 100644 index 000000000..ae483ad49 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/example.md @@ -0,0 +1,47 @@ +- This is a tutorial for using the node called LabJAck u3 in order to measure temperature with temperature sensors (Add models) + + +**- Hardware required** : +- A LabJack U3 LV daq +- N temperature sensors (This tutorial will present connections with LM34Caz/Nopb : https://www.digikey.com/en/products/detail/texas-instruments/LM34CAZ-NOPB/117873) +- Connections cables (USB, Electronic cables) + + +**- Software required :** +- Flojoy software running (Go to the page -- Getting started/Installation) +- Exodriver for the LabJackU3 device and their requirements follow the guideline from : (https://labjack.com/pages/support?doc=/software-driver/installer-downloads/exodriver/) + +**Connection :** +You need to connect the LABJACKU3 Device to your computer with an USB cable. + +The you need to connect the temperature sensor to the Labjacku3 device. +Before that if you use the LM34Caz/Nopb you'll need to add a small resistor between the Vout and the LabJack device to the circuit to protect the sensor (see pictures) : + +![image](./assets/LABJACKU3_sensor.jpg) +*Connection on the LM34 temperature sensor* + +![image](./assets/LABJACKU3_connections.jpg) +*Connection between the sensor and the LabjackU3 device* + +The connections are describe here on the pictures below (Left LabJack and right Sensors pin) : +VS --> +Vs pin (Power supply from the computer transferred to the sensor with this connection) +Ground --> Ground Pin +Ground --> Resistor Pin (See photos) +FI0 (For your first sensor) --> Vout pin on the sensor (Voltage are received with these FIi port where i goes from 0 to 7) + +When you have these 4 connections, your setup is ready, you can place your sensor where you want to measure temperature and then start Flojoy. + +**Node Management :** + +The LabJack Node doesn't need any data input, so it can be placed on the left on the interface : + +![image](./assets/LABJACKU3_nodes.png) +*Classical node placement for temperature measurements* + +You'll need to set up one parameter in the CRTL panel which is the number of temperature sensors you are using for your experiment : + +After that you can choose your Visualisation node that fits your project to display the temperature measurements as you want. + +Also you can use the loop node (See documentation) in order to update the temperature measurements, you can set the parameters you want for the loops (Delay, number of loops, etc..) + +![image](./assets/LABJACKU3_nodeswithloop.png) diff --git a/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/LABJACK/LABJACKU3/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/PHIDGET22.md b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/PHIDGET22.md new file mode 100644 index 000000000..890a3e6cf --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/PHIDGET22.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..2896c1e1f --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Declaration of the Event handler, print Voltage variation for a channel \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..c3785f2ea --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/parameters.yaml @@ -0,0 +1,9 @@ +calibration1: + default: 0.015 + type: float +calibration2: + default: 0.06 + type: float +n_sensors: + default: 3 + type: int diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..f6170836c --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/a1-[autogen]/python_code.txt @@ -0,0 +1,55 @@ +from flojoy import flojoy, DataContainer +import Phidget22 +from Phidget22.Phidget import * +from Phidget22.Devices.VoltageRatioInput import * + + +def onVoltageRatioChange(self, voltageRatio): + + print("VoltageRatio [" + str(self.getChannel()) + "]: " + str(voltageRatio)) + + +@flojoy +def PHIDGET22(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + Pressure Measurement with Phidget 22 sensors + voltage: list[float] = [] + pressions: list[float] = [] + N = params["n_sensors"] + + for i in range(0, N): + # Creation of an instance of the VoltageRationInput class + voltageRatioInput = VoltageRatioInput() + # Set Channel for Communication with the Phidget Interface Kit : + voltageRatioInput.setChannel(i) + # Assign the handler that will be called when the event occurs : + voltageRatioInput.setOnVoltageRatioChangeHandler(onVoltageRatioChange) + # Open the Channel after event handler is set : + voltageRatioInput.openWaitForAttachment(5000) + + volt_i: float = ( + voltageRatioInput.getVoltageRatio() + ) # Measure Voltage from the sensor + voltage.append(volt_i) # Add Voltage to the list of measurements + + # Example of a Calibration to convert Voltage into pressions : + pression_i: float = (volt_i - params["calibration1"]) / params["calibration2"] + + pressions.append(pression_i) + + return DataContainer(x={"a": voltage, "b": pressions}, y=pressions) + + +@flojoy +def PHIDGET22_MOCK(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + Mock Function for the node Phidget 22 + voltage: list[float] = [] + pressions: list[float] = [] + N = 4 + + for i in range(0, N): + volt_i: int = i * 10 + 4 # Scalar operation to modify data + voltage.append(volt_i) # Add Voltage to the list of measurements + pression_i: float = (volt_i - 0.015) / 0.06 + pressions.append(pression_i) + + return DataContainer(x={"a": voltage, "b": pressions}, y=pressions) diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/app.txt new file mode 100644 index 000000000..6db9d4fdc --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/app.txt @@ -0,0 +1,148 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "PHIDGET22-d0424b3f-03be-4cac-8b67-ffbc3571008d", + "type": "PHIDGET", + "data": { + "id": "PHIDGET22-d0424b3f-03be-4cac-8b67-ffbc3571008d", + "label": "PHIDGET22", + "func": "PHIDGET22", + "type": "PHIDGET", + "ctrls": { + "n_sensors": { + "functionName": "PHIDGET22", + "param": "n_sensors", + "value": 3 + }, + "calibration1": { + "functionName": "PHIDGET22", + "param": "calibration1", + "value": 0.015 + }, + "calibration2": { + "functionName": "PHIDGET22", + "param": "calibration2", + "value": 0.06 + } + }, + "pip_dependencies": [ + { + "name": "Phidget22" + } + ], + "selected": false + }, + "position": { + "x": 805.5589512354383, + "y": 209.5153736171739 + }, + "selected": false, + "positionAbsolute": { + "x": 805.5589512354383, + "y": 209.5153736171739 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8", + "type": "PLOTLY_VISOR", + "data": { + "id": "SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8", + "label": "SCATTER", + "func": "SCATTER", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1179.8446655211528, + "y": 160.9439450457453 + }, + "selected": false, + "positionAbsolute": { + "x": 1179.8446655211528, + "y": 160.9439450457453 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-164f1210-c01b-4eec-8091-e3d59172ea66", + "type": "TERMINATOR", + "data": { + "id": "END-164f1210-c01b-4eec-8091-e3d59172ea66", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1585.5589512354384, + "y": 220.94394504574535 + }, + "selected": false, + "positionAbsolute": { + "x": 1585.5589512354384, + "y": 220.94394504574535 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "PHIDGET22-d0424b3f-03be-4cac-8b67-ffbc3571008d", + "sourceHandle": "main", + "target": "SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8", + "targetHandle": "SCATTER", + "id": "reactflow__edge-PHIDGET22-d0424b3f-03be-4cac-8b67-ffbc3571008dmain-SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8SCATTER" + }, + { + "source": "SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8", + "sourceHandle": "main", + "target": "END-164f1210-c01b-4eec-8091-e3d59172ea66", + "targetHandle": "END", + "id": "reactflow__edge-SCATTER-e1ca5543-92a9-4adb-8e90-856b4929c2a8main-END-164f1210-c01b-4eec-8091-e3d59172ea66END" + } + ], + "viewport": { + "x": 101.96428571428567, + "y": 103.24999999999997, + "zoom": 0.5 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + }, + "param": { + "id": "PHIDGET22_PHIDGET22_n_sensors", + "functionName": "PHIDGET22", + "param": "n_sensors", + "nodeId": "PHIDGET22-40ee0d32-7bac-4f5e-af57-419c81c66fab", + "inputId": "INPUT_PLACEHOLDER", + "type": "int" + }, + "val": 3 + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/example.md new file mode 100644 index 000000000..08d32d01c --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/example.md @@ -0,0 +1,45 @@ +- This is a tutorial for using the node called Phidget 22 and measure pressures from Flexiforce sensors using a Phidget InterfaceKit + + +**Hardware required** : +- A Phidget InterfaceKit (Model 8/8/8 1018_3 is the one we used to develop the node) +- N pressure sensors (This tutorial will present measurement from FlexiForce sensor but you can use all the Sensors compatible with Phidget). +- Connections cables (USB, Electronic cables) + + +**Software required :** +- Flojoy software running (Go to the page -- Getting started/Installation) +- Phidget 22 PAckage -- (It should be installed automatically from Requirements) (Otherwise follow docs from : https://www.phidgets.com/docs/Main_Page) + +**Connection :** +- Connect the PHIDGET Interfacekit to your computer with an USB Cable +- Connect the Flexiforce sensors with the Phidget Interfacekit using a Flexiforce adapter (See Image) + +![image](./assets/Phidget22_sensor.jpg) + +**Node Management :** + +The PHIDGET22 node doesn't need any data input, so it can be placed on the left on the Flojoy interface : + +![image](./assets/PHIDGET22_nodes.png) + +You'll need to set up one numeric parameters in the CRTL panel which is the number of pressure sensors you are using for your experiment. +Note that the node is measuring voltage from the sensors (The calibration will depend on the type of sensor you are using) + +![image](./assets/PHIDGET22_ctrl.png) + +**Calibration :** + +In order to Calibrate your sensor, you'll need to apply some known pressures (3 or 4 is best, and you can use pad sensor to increase the voltage) +and measure some voltages with the Flojoy application. +From these measurements you deduce the relation between the voltage and the pressure applied on the sensor, and you can use operationnal +nodes in order to convert voltage into pressures. + +**Visualisation :** + +After that you can choose your Visualisation node that fits your project to display the pressure measurements as you want. + +Also, you can use the loop node (See documentation) in order to update the measurements, you can set the parameters you want for the loops +(Delay, number of loops, etc..) + +![image](./assets/PHIDGET22_nodeswithloop.png) \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/PHIDGET/PHIDGET22/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT.md new file mode 100644 index 000000000..e4af6434c --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/SERIAL_SINGLE_MEASUREMENT.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..5ad243df4 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/docstring.txt @@ -0,0 +1,27 @@ + +Node to take a single reading of data from an Ardunio, +or a similar serial device. +For example you can record temperature following this tutorial: + +https://learn.adafruit.com/thermistor/using-a-thermistor + +with Serial.println(steinhart) as the only line printing. + +It is important that the last line Arduino is returning is the +data with a new line at the end (i.e. println()). + +The other lines must be returned with print() +with print(",") between each line. + +For example: + +print(reading0) +print(",") +println(reading1) + +If there is more than one column, the SELECT_ARRAY node must be +used after this node. + +params: +BAUD_RATE: Baud rate for the serial device. +com_port: COM port of the serial device diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..5c8db9102 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +baudrate: + default: 9600 + type: float +comport: + default: /dev/ttyUSB0 + type: string diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..630ef6eb4 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/a1-[autogen]/python_code.txt @@ -0,0 +1,42 @@ +from flojoy import flojoy, DataContainer +from time import sleep +import serial +import numpy as np +from datetime import datetime +import plotly.graph_objects as go + + +@flojoy +def SERIAL_SINGLE_MEASUREMENT(dc_inputs, params): + + print("parameters passed to SERIAL_TIMESERIES: ", params) + COM_PORT = params["comport"] + BAUD = int(params["baudrate"]) + + ser = serial.Serial(COM_PORT, timeout=1, baudrate=BAUD) + # The first reading is commonly empty. + s = ser.readline().decode() + + # Some readings may be empty. Try a second time if so. + if s != "": + reading = s[:-2].split(",") + else: + s = ser.readline().decode() + reading = s[:-2].split(",") + + reading = np.array(reading) + reading = reading.astype("float64") + + data = go.Line(x=[0], y=[0], mode="markers") + fig = go.Figure(data=data) + return DataContainer(type="plotly", fig=fig, x=[0], y=reading) + + +@flojoy +def SERIAL_SINGLE_MEASUREMENT_MOCK(dc, params): + print("Running mock version of Serial") + + x = np.linspace(0, 100, 100) + y = np.linspace(0, 100, 100) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_SINGLE_MEASUREMENT/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/SERIAL_TIMESERIES.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/SERIAL_TIMESERIES.md new file mode 100644 index 000000000..f324652c6 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/SERIAL_TIMESERIES.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..758361082 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/docstring.txt @@ -0,0 +1,31 @@ + +Node to take simple time dependent 1d data from an Ardunio, +or a similar serial device. +For example, you can record temperature following this tutorial: + +https://learn.adafruit.com/thermistor/using-a-thermistor + +with Serial.println(steinhart) as the only line printing. + +It is important that the last line Arduino is returning is the +data with a new line at the end (i.e. println()). + +The other lines must be returned with print() +with print(",") between each line. + +For example: + +print(reading0) +print(",") +println(reading1) + +If there is more than one column, the SELECT_ARRAY node must be +used after this node. + +params: +num_readings: Number of points to record. +record_period: Length between two recordings in seconds. +BAUD_RATE: Baud rate for the serial device. +com_port: COM port of the serial device + +num_readings * record_period is roughly the run length in seconds. diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..272e50f95 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/parameters.yaml @@ -0,0 +1,12 @@ +baudrate: + default: 9600 + type: int +comport: + default: /dev/ttyACM0 + type: string +num_readings: + default: 100 + type: int +record_period: + default: 1 + type: float diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..10999aefc --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/a1-[autogen]/python_code.txt @@ -0,0 +1,71 @@ +from flojoy import flojoy, DataContainer +from time import sleep +import serial +import numpy as np +from datetime import datetime +import plotly.graph_objects as go + + +@flojoy +def SERIAL_TIMESERIES(dc_inputs, params): + + + COM_PORT = params.get("com_port", "/dev/ttyUSB0") + BAUD = params.get("baudrate", 9600) + NUM = params.get("num_readings", 100) + RECORD_PERIOD = params.get("record_period", 1) + + ser = serial.Serial(COM_PORT, timeout=1, baudrate=BAUD) + readings = [] + times = [] + # The first reading is commonly empty. + s = ser.readline().decode() + + for i in range(NUM): + ts = datetime.now() + s = ser.readline().decode() + # Some readings may be empty. + if s != "": + reading = s[:-2].split(",") + if len(reading) == 1: + reading = reading[0] + readings.append(reading) + + ts = datetime.now() + seconds = float( + ts.hour * 3600 + ts.minute * 60 + ts.second + ts.microsecond / 10**6 + ) + + times.append(seconds) + + if len(times) > 0: + time1 = seconds - times[i] + else: + # Estimate execution time. + time1 = 0.1 + + if time1 < RECORD_PERIOD: + sleep(RECORD_PERIOD - time1) + + times = np.array(times) + try: + times -= times[0] + except IndexError: + raise IndexError("No data detected from the Arduino") + + readings = np.array(readings) + readings = readings.astype("float64") + # If there are two or more columns return a Plotly figure. + if readings.ndim == 2: + data = go.Line(x=times, y=readings[:, 0], mode="markers") + fig = go.Figure(data=data) + return DataContainer(type="plotly", fig=fig, x=times, y=readings) + else: + return DataContainer(x=times, y=readings) + + +@flojoy +def SERIAL_TIMESERIES_MOCK(dc, params): + x = np.linspace(0, 100, 100) + y = np.linspace(0, 100, 100) + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/app.txt new file mode 100644 index 000000000..f7cff6df3 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/app.txt @@ -0,0 +1,322 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "type": "TERMINATOR", + "data": { + "id": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1544.1406772254813, + "y": 309.7142857142858 + }, + "selected": false, + "positionAbsolute": { + "x": 1544.1406772254813, + "y": 309.7142857142858 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4cee", + "type": "SELECT_ARRAY", + "data": { + "id": "SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4cee", + "label": "SELECT_ARRAY_1", + "func": "SELECT_ARRAY", + "type": "SELECT_ARRAY", + "ctrls": { + "column": { + "functionName": "SELECT_ARRAY", + "param": "column", + "value": "0" + } + }, + "selected": false + }, + "position": { + "x": 627.1192105282848, + "y": 104.25198394000293 + }, + "selected": false, + "positionAbsolute": { + "x": 627.1192105282848, + "y": 104.25198394000293 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325", + "type": "SELECT_ARRAY", + "data": { + "id": "SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325", + "label": "SELECT_ARRAY_2", + "func": "SELECT_ARRAY", + "type": "SELECT_ARRAY", + "ctrls": { + "column": { + "functionName": "SELECT_ARRAY", + "param": "column", + "value": "1" + } + }, + "selected": false + }, + "position": { + "x": 614.6027915252406, + "y": 536.040645969877 + }, + "selected": false, + "positionAbsolute": { + "x": 614.6027915252406, + "y": 536.040645969877 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3", + "type": "PLOTLY_VISOR", + "data": { + "id": "SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3", + "label": "SCATTER_1", + "func": "SCATTER", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1048.0107102184566, + "y": 61.98977155238117 + }, + "selected": false, + "positionAbsolute": { + "x": 1048.0107102184566, + "y": 61.98977155238117 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0", + "type": "PLOTLY_VISOR", + "data": { + "id": "SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0", + "label": "SCATTER_2", + "func": "SCATTER", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1043.1719153770464, + "y": 485.27307504050464 + }, + "selected": false, + "positionAbsolute": { + "x": 1043.1719153770464, + "y": 485.27307504050464 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608", + "type": "SERIAL", + "data": { + "id": "SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608", + "label": "SERIAL_TIMESERIES", + "func": "SERIAL_TIMESERIES", + "type": "SERIAL", + "ctrls": { + "comport": { + "functionName": "SERIAL_TIMESERIES", + "param": "comport", + "value": "/dev/ttyUSB0" + }, + "baudrate": { + "functionName": "SERIAL_TIMESERIES", + "param": "baudrate", + "value": "9600" + }, + "num_readings": { + "functionName": "SERIAL_TIMESERIES", + "param": "num_readings", + "value": "10" + }, + "record_period": { + "functionName": "SERIAL_TIMESERIES", + "param": "record_period", + "value": "1" + } + }, + "pip_dependencies": [ + { + "name": "pyserial", + "v": 3.5 + } + ], + "selected": false + }, + "position": { + "x": 180.7392990498203, + "y": 282.54427222502665 + }, + "selected": false, + "positionAbsolute": { + "x": 180.7392990498203, + "y": 282.54427222502665 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4cee", + "sourceHandle": "main", + "target": "SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3", + "targetHandle": "SCATTER", + "id": "reactflow__edge-SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4ceemain-SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3SCATTER" + }, + { + "source": "SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325", + "sourceHandle": "main", + "target": "SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0", + "targetHandle": "SCATTER", + "id": "reactflow__edge-SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325main-SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0SCATTER" + }, + { + "source": "SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0", + "sourceHandle": "main", + "target": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "targetHandle": "END", + "id": "reactflow__edge-SCATTER-f46dc017-b49f-43ff-bc6e-8a8175fa50e0main-END-06a4da40-a0ae-44ad-873b-9b65d096880aEND" + }, + { + "source": "SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3", + "sourceHandle": "main", + "target": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "targetHandle": "END", + "id": "reactflow__edge-SCATTER-0f6b5ddd-6646-4119-a8ab-5b95eb628fe3main-END-06a4da40-a0ae-44ad-873b-9b65d096880aEND" + }, + { + "source": "SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608", + "sourceHandle": "main", + "target": "SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4cee", + "targetHandle": "SELECT_ARRAY", + "id": "reactflow__edge-SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608main-SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4ceeSELECT_ARRAY" + }, + { + "source": "SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608", + "sourceHandle": "main", + "target": "SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325", + "targetHandle": "SELECT_ARRAY", + "id": "reactflow__edge-SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608main-SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325SELECT_ARRAY" + } + ], + "viewport": { + "x": 197.88510420585555, + "y": 38.16888746940003, + "zoom": 0.7622193595343526 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-917255d4-18d6-4c96-88f0-0d0797b10c09", + "layout": { + "x": 0, + "y": 1, + "h": 2, + "w": 2, + "i": "ctrl-917255d4-18d6-4c96-88f0-0d0797b10c09", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "SELECT_ARRAY_SELECT_ARRAY_1_column", + "functionName": "SELECT_ARRAY", + "param": "column", + "nodeId": "SELECT_ARRAY-3d6c9d42-ba69-4d00-8ede-4a75d87c4cee", + "inputId": "ctrl-917255d4-18d6-4c96-88f0-0d0797b10c09", + "type": "float" + }, + "val": 0 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-f26735ab-ddf9-4614-bf9a-12684213347c", + "layout": { + "x": 0, + "y": 3, + "h": 2, + "w": 2, + "i": "ctrl-f26735ab-ddf9-4614-bf9a-12684213347c", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "SELECT_ARRAY_SELECT_ARRAY_2_column", + "functionName": "SELECT_ARRAY", + "param": "column", + "nodeId": "SELECT_ARRAY-03541a39-a232-4571-a81d-4df94c19c325", + "inputId": "ctrl-f26735ab-ddf9-4614-bf9a-12684213347c", + "type": "float" + }, + "val": 0 + }, + { + "name": "Numeric Input", + "type": "input", + "key": "NUMERIC_INPUT", + "minHeight": 1, + "minWidth": 1, + "hidden": false, + "id": "ctrl-9368ae69-8b4c-4f3c-a74b-bb28239f8a42", + "layout": { + "x": 0, + "y": 5, + "h": 2, + "w": 2, + "i": "ctrl-9368ae69-8b4c-4f3c-a74b-bb28239f8a42", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "SERIAL_TIMESERIES_SERIAL_TIMESERIES_num_readings", + "functionName": "SERIAL_TIMESERIES", + "param": "num_readings", + "nodeId": "SERIAL_TIMESERIES-fae97385-f983-4077-ab50-15bd03477608", + "inputId": "ctrl-9368ae69-8b4c-4f3c-a74b-bb28239f8a42", + "type": "float" + }, + "val": 100 + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/example.md new file mode 100644 index 000000000..628fa7731 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/example.md @@ -0,0 +1 @@ +ITS AN APP FOR LOADING DATA OF A SERIAL DEVICE LIKE AN ARDUINO. \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/SERIAL/SERIAL_TIMESERIES/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.md new file mode 100644 index 000000000..8d7da9827 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/STEPPER_DRIVER_TIC.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..08bd990f4 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/docstring.txt @@ -0,0 +1,3 @@ + +Takes current limit and sleep time as parameters and allow to control position +and speed of a motor with a TIC driver diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..fd709ab8e --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +current_limit: + default: 30 + type: int +sleep_time: + default: 2 + type: int diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..51eb5295a --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/a1-[autogen]/python_code.txt @@ -0,0 +1,44 @@ +from flojoy import flojoy, DataContainer +from ticlib import ( + TicUSB, +) # Import the TicUSB library to send command to Tic drivers with USB connection +from time import sleep + + +@flojoy +def STEPPER_DRIVER_TIC(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + positions: list[int] = [50, 100, 150, 200] # Setting default positions + speeds: list[int] = [50000, 1000000, 150000, 200000] # Setting default speeds + current_limit: int = params["current_limit"] + sleep_time: int = params["sleep_time"] + + # Declaration of the stepper driver + tic: TicUSB = TicUSB() + tic.halt_and_set_position(0) # Set the position to 0 + tic.set_current_limit(current_limit) # Set the current limit of the TIC driver + tic.energize() # Turn on the driver + tic.exit_safe_start() # The driver is now ready to receive commands + + for i in range(0, len(positions)): + tic.set_max_speed(speeds[i]) # Set motor speed + tic.set_target_position(positions[i]) # Set target positions + sleep(sleep_time) + + tic.deenergize() + tic.enter_safe_start() + + return DataContainer(x={"a": positions, "b": speeds}, y=positions) + + +@flojoy +def STEPPER_DRIVER_TIC_MOCK( + dc_inputs: list[DataContainer], params: dict +) -> DataContainer: + Mock function for the stepper driver + returns positions and speeds + positions: list[int] = [50, 100, 150, 200] # Setting default positions + speeds: list[int] = [50000, 1000000, 150000, 200000] # Setting default speeds + + return DataContainer(x={"a": positions, "b": speeds}, y=speeds) diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/app.txt new file mode 100644 index 000000000..9a3b72adb --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/app.txt @@ -0,0 +1,86 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "STEPPER_DRIVER_TIC-e797dbda-ccce-449d-9665-fcaaa1e52869", + "type": "STEPPER", + "data": { + "id": "STEPPER_DRIVER_TIC-e797dbda-ccce-449d-9665-fcaaa1e52869", + "label": "STEPPER DRIVER TIC", + "func": "STEPPER_DRIVER_TIC", + "type": "STEPPER", + "ctrls": { + "current_limit": { + "functionName": "STEPPER_DRIVER_TIC", + "param": "current_limit", + "value": 30 + }, + "sleep_time": { + "functionName": "STEPPER_DRIVER_TIC", + "param": "sleep_time", + "value": 2 + } + }, + "pip_dependencies": [ + { + "name": "ticlib", + "v": "0.2.2" + } + ], + "selected": true + }, + "position": { + "x": 266.2186691913081, + "y": 193.71409253512644 + }, + "selected": true, + "positionAbsolute": { + "x": 266.2186691913081, + "y": 193.71409253512644 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "type": "TERMINATOR", + "data": { + "id": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 764.7900977627365, + "y": 199.42837824941225 + }, + "selected": false, + "positionAbsolute": { + "x": 764.7900977627365, + "y": 199.42837824941225 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "STEPPER_DRIVER_TIC-e797dbda-ccce-449d-9665-fcaaa1e52869", + "sourceHandle": "main", + "target": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "targetHandle": "END", + "id": "reactflow__edge-STEPPER_DRIVER_TIC-e797dbda-ccce-449d-9665-fcaaa1e52869main-END-059c2891-15cb-4208-8e81-a4a913b70f92END" + } + ], + "viewport": { + "x": 173.69558223607845, + "y": 93.45146097973534, + "zoom": 0.5251567112201916 + } + }, + "ctrlsManifest": [] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/example.md new file mode 100644 index 000000000..812bee7d0 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/example.md @@ -0,0 +1,37 @@ +This is a tutorial for using the nodes called Stepper Motor driver Tic and Stepper Driver motor Tic Knob in order to control a motor with the Flojoy App + +**Hardware required :** + +- A Motor (Nema 15-23) +- A Tic motor driver (All models are available and should work with these nodes) -- TIC T825 was used for experimentation. +- A Power Supply wich enough power to run the driver and the motor. (You'll need to setup the good current value depending on the motor size you are using) +- Connections cables (USB, Electronic cables) + +![TIC Driver Connections](https://res.cloudinary.com/dhopxs1y3/image/upload/v1683653875/steppermotor_z7yaly.jpg) +*Connection between the computer, the Tic driver, the stepper motor and the power supply* + + +**Software required :** + +Flojoy software running (Go to the page -- Getting started/Installation) + + +**Node Management :** +- Input data : None +- Output node : End (To stop the process) + +You don't need to have a node placed before the stepper motor nodes because the only data needed by the nodes is set up with the parameters. + +**Parameters : ** + +The Stepper Driver Tic node allows you to set 2 different speeds and 4 positions for the stepper motor. +The motor will move to the first two positions with first speed parameters and then move to position 3 and 4 with the second speed parameters +(You can set the same speed for both and reduce the number of movement by settting the same position for 2,3 and 4) + +![Stepper node classic](https://res.cloudinary.com/dhopxs1y3/image/upload/v1683653875/steppernode_mssx65.png) +*Flojoy interface with the classic node* + + +At the end of the process the stepper motor will be placed in the last position set up and wait for a new parameters for the next movement. +It should be possible to use these nodes with the LOOP node in order to make a repetitive movement with the motor. + diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.md new file mode 100644 index 000000000..cb8030650 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/STEPPER_DRIVER_TIC_KNOB.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..53a177812 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/docstring.txt @@ -0,0 +1,3 @@ + +Takes knob position as parameters to control the rotation of the motor and allow to control position +and speed of a motor with a TIC driver diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..c039a9714 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/parameters.yaml @@ -0,0 +1,12 @@ +current_limit: + default: 30 + type: int +knob_value: + default: 0 + type: int +sleep_time: + default: 2 + type: int +speed: + default: 200000 + type: int diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..cfb9e28a9 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/a1-[autogen]/python_code.txt @@ -0,0 +1,47 @@ +from flojoy import flojoy, DataContainer + +# Import the TicUSB library to send command to Tic drivers with USB connection +from ticlib import TicUSB +from time import sleep + + +@flojoy +def STEPPER_DRIVER_TIC_KNOB( + dc_inputs: list[DataContainer], params: dict +) -> DataContainer: + + + speed: int = params["speed"] + sleep_time: int = params["sleep_time"] + current_limit: int = params["current_limit"] + + # Converting the knob value into a position + knob_position: int = 2 * params["knob_value"] + + # Declaration of the stepper driver (You can add serial number to specify the driver) + tic: TicUSB = TicUSB() + tic.set_current_limit(current_limit) # Set the current limit for the driver TIC + tic.energize() # Turn on the driver + tic.exit_safe_start() # The driver is now ready to receive commands + tic.set_max_speed(speed) # Set maximum speed for the motor during first movement. + + tic.halt_and_set_position(0) # Set initial position to origin + sleep(sleep_time) + + tic.set_target_position(knob_position) # Set target position for the first movement + sleep(sleep_time) + + tic.deenergize() + tic.enter_safe_start() + + return DataContainer(x={"a": knob_position, "b": knob_position}, y=knob_position) + + +@flojoy +def STEPPER_DRIVER_TIC_KNOB_MOCK( + dc_inputs: list[DataContainer], params: dict +) -> DataContainer: + Mock function for the stepper driver node + positions: list[int] = [50, 100, 150, 200] # Setting default positions + speeds: list[int] = [50000, 1000000, 150000, 200000] # Setting default speeds + return DataContainer(x={"a": positions, "b": speeds}, y=positions) diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/app.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/app.txt new file mode 100644 index 000000000..315b3e715 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/app.txt @@ -0,0 +1,90 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "type": "TERMINATOR", + "data": { + "id": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 781.9329549055936, + "y": 220.85694967798372 + }, + "selected": true, + "positionAbsolute": { + "x": 781.9329549055936, + "y": 220.85694967798372 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "STEPPER_DRIVER_TIC_KNOB-89605744-77c1-4298-8a5f-d2350f3575d9", + "type": "STEPPER2", + "data": { + "id": "STEPPER_DRIVER_TIC_KNOB-89605744-77c1-4298-8a5f-d2350f3575d9", + "label": "STEPPER DRIVER TIC KNOB", + "func": "STEPPER_DRIVER_TIC_KNOB", + "type": "STEPPER2", + "ctrls": { + "knob_value": { + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "knob_value", + "value": 0 + }, + "current_limit": { + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "current_limit", + "value": 30 + }, + "speed": { + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "speed", + "value": 200000 + }, + "sleep_time": { + "functionName": "STEPPER_DRIVER_TIC_KNOB", + "param": "sleep_time", + "value": 2 + } + }, + "selected": false + }, + "position": { + "x": 393.3615263341651, + "y": 199.42837824941216 + }, + "selected": false, + "positionAbsolute": { + "x": 393.3615263341651, + "y": 199.42837824941216 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "STEPPER_DRIVER_TIC_KNOB-89605744-77c1-4298-8a5f-d2350f3575d9", + "sourceHandle": "main", + "target": "END-059c2891-15cb-4208-8e81-a4a913b70f92", + "targetHandle": "END", + "id": "reactflow__edge-STEPPER_DRIVER_TIC_KNOB-89605744-77c1-4298-8a5f-d2350f3575d9main-END-059c2891-15cb-4208-8e81-a4a913b70f92END" + } + ], + "viewport": { + "x": 173.69558223607845, + "y": 93.45146097973534, + "zoom": 0.5251567112201916 + } + }, + "ctrlsManifest": [] +} \ No newline at end of file diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/example.md b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/example.md new file mode 100644 index 000000000..ee581c8dd --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/example.md @@ -0,0 +1,35 @@ +This is a tutorial for using the nodes called Stepper Motor driver Tic and Stepper Driver motor Tic Knob in order to control a motor with the Flojoy App + +**Hardware required :** + +- A Motor (Nema 15-23) +- A Tic motor driver (All models are available and should work with these nodes) -- TIC T825 was used for experimentation. +- A Power Supply wich enough power to run the driver and the motor. (You'll need to setup the good current value depending on the motor size you are using) +- Connections cables (USB, Electronic cables) + +![TIC Driver Connections](https://res.cloudinary.com/dhopxs1y3/image/upload/v1683653875/steppermotor_z7yaly.jpg) +*Connection between the computer, the Tic driver, the stepper motor and the power supply* + + +**Software required :** + +Flojoy software running (Go to the page -- Getting started/Installation) + + +**Node Management :** +- Input data : None +- Output node : End (To stop the process) + +You don't need to have a node placed before the stepper motor nodes because the only data needed by the nodes is set up with the parameters. + +**Parameters : ** + +The Stepper Driver Tic Knob node allows you to control the rotation of the motor with a knob. +You can choose the motor rotation with the value of the knob (From 0 to 100 is corresponding to a rotation between 0 and 360 degrees) + +![Stepper node knob](https://res.cloudinary.com/dhopxs1y3/image/upload/v1683653875/steppernodeknob_qhsk73.png) +*Flojoy interface with the knob node* + +At the end of the process the stepper motor will be placed in the last position set up and wait for a new parameters for the next movement. +It should be possible to use these nodes with the LOOP node in order to make a repetitive movement with the motor. + diff --git a/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/output.txt b/docs/nodes/nodes/INSTRUMENTS/STEPPER_MOTOR/STEPPER_DRIVER_TIC_KNOB/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/CAMERA.md b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/CAMERA.md new file mode 100644 index 000000000..f2f9cd5b0 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/CAMERA.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/docstring.txt b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..56c946d08 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/docstring.txt @@ -0,0 +1,3 @@ + +Takes a picture from a connected camera using OpenCV. +If no camera is connected, an error would be thrown. diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..53982457d --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +camera_ind: + default: 0 + type: int diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/python_code.txt b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..6bcf63129 --- /dev/null +++ b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/a1-[autogen]/python_code.txt @@ -0,0 +1,69 @@ +import cv2 +import os +from flojoy import flojoy, DataContainer +from PIL import Image +import numpy as np + + +@flojoy +def CAMERA(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + camera_ind: int = params["camera_ind"] + try: + camera = cv2.VideoCapture(camera_ind) + + if not camera.isOpened(): + raise cv2.error("Failed to open camera") + + result, frame = camera.read() + + if not result: + raise cv2.error("Failed to capture image") + camera.release() + del camera + + # Split the image channels + red_channel = frame[:, :, 0] + green_channel = frame[:, :, 1] + blue_channel = frame[:, :, 2] + + if frame.shape[2] == 4: + alpha_channel = frame[:, :, 3] + else: + alpha_channel = None + + return DataContainer( + type="image", + r=red_channel, + g=green_channel, + b=blue_channel, + a=alpha_channel, + ) + + except cv2.error as camera_error: + raise camera_error + + +@flojoy +def CAMERA_MOCK(dc_inputs: list[DataContainer], params: dict): + print("Running mock version of CAMERA node...") + + # Get the absolute path of the current directory + current_dir = os.path.dirname(os.path.abspath(__file__)) + # Construct the path to the asset file + file_path = os.path.join( + current_dir, "assets", "astronaut.png" + ) # Load example image. + print("File to be loaded: ", file_path) + f = Image.open(file_path) + img_array = np.array(f.convert("RGBA")) + red_channel = img_array[:, :, 0] + green_channel = img_array[:, :, 1] + blue_channel = img_array[:, :, 2] + if img_array.shape[2] == 4: + alpha_channel = img_array[:, :, 3] + else: + alpha_channel = None + return DataContainer( + type="image", r=red_channel, g=green_channel, b=blue_channel, a=alpha_channel + ) diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/hardware.md b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/media.md b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/notes.md b/docs/nodes/nodes/INSTRUMENTS/WEB_CAM/CAMERA/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/LOADER.md b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/LOADER.md new file mode 100644 index 000000000..d08f77a3f --- /dev/null +++ b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/LOADER.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..33184ef29 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +measurement_uuid: + default: '' + type: string diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..56b757a1e --- /dev/null +++ b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/a1-[autogen]/python_code.txt @@ -0,0 +1,33 @@ +import json +import os +import requests +from flojoy import DataContainer, flojoy +from flojoy.utils import PlotlyJSONEncoder, get_frontier_api_key + +FRONTIER_URI: str = os.environ.get("FRONTIER_URI") or "https://frontier-next.vercel.app" +MEASUREMENT_API: str = f"{FRONTIER_URI}/api/streaming" + + +@flojoy +def LOADER(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + api_key: str | None = get_frontier_api_key() + measurement_uuid: str = params["measurement_uuid"] + + if api_key is not None and measurement_uuid != "": + try: + requests.post( + MEASUREMENT_API, + json={ + "api_key": api_key, + "measurement_id": measurement_uuid, + "measurement": json.dumps(dc_inputs[0], cls=PlotlyJSONEncoder), + }, + ) + except Exception as e: + raise e + return dc_inputs[0] + else: + not_found_key = ( + "FRONTIER_API_KEY" if api_key is not None else "Measurement UUID" + ) + raise KeyError(f"{not_found_key} not found!") diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/hardware.md b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/media.md b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/notes.md b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/app.txt b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/app.txt new file mode 100644 index 000000000..7ecb56d80 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/app.txt @@ -0,0 +1,459 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 181, + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "type": "default", + "position": { + "x": 199.83204415740659, + "y": 241.1242907400127 + }, + "data": { + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "label": "loop", + "func": "LOOP", + "type": "LOOP", + "ctrls": { + "num_loops": { + "functionName": "LOOP", + "param": "num_loops", + "value": "2" + } + }, + "inputs": [ + { + "name": "end", + "id": "end", + "type": "source" + }, + { + "name": "body", + "id": "body", + "type": "source" + } + ], + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 199.83204415740659, + "y": 241.1242907400127 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "label": "12", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": 12 + } + }, + "selected": false + }, + "position": { + "x": 466.19543125380744, + "y": 197.28696880898065 + }, + "selected": false, + "positionAbsolute": { + "x": 466.19543125380744, + "y": 197.28696880898065 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "type": "ARITHMETIC", + "data": { + "id": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "label": "add", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 887.654481217497, + "y": 355.72438638328936 + }, + "selected": false, + "positionAbsolute": { + "x": 887.654481217497, + "y": 355.72438638328936 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "type": "LOOP", + "data": { + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "label": "Goto Loop", + "func": "GOTO", + "type": "LOOP", + "ctrls": { + "goto_node_id": { + "functionName": "GOTO", + "param": "goto_node_id", + "value": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb" + } + }, + "selected": false + }, + "position": { + "x": 1314.5272324794553, + "y": 311.04162375361295 + }, + "selected": false, + "positionAbsolute": { + "x": 1314.5272324794553, + "y": 311.04162375361295 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "type": "TERMINATOR", + "data": { + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 478.0211151222852, + "y": -26.63223441103102 + }, + "selected": false, + "positionAbsolute": { + "x": 478.0211151222852, + "y": -26.63223441103102 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "type": "SIMULATION", + "data": { + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "label": "FeedBack", + "func": "FEEDBACK", + "type": "SIMULATION", + "ctrls": { + "referred_node": { + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04" + } + }, + "selected": false + }, + "position": { + "x": 665.8033807606249, + "y": 228.40739343961675 + }, + "selected": false, + "positionAbsolute": { + "x": 665.8033807606249, + "y": 228.40739343961675 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "LOADER-0ade6235-d420-468c-89af-bc408aee3a24", + "type": "CLOUD_DATABASE", + "data": { + "id": "LOADER-0ade6235-d420-468c-89af-bc408aee3a24", + "label": "LOADER", + "func": "LOADER", + "type": "CLOUD_DATABASE", + "ctrls": { + "measurement_uuid": { + "functionName": "LOADER", + "param": "measurement_uuid", + "value": "" + } + }, + "selected": false + }, + "position": { + "x": 1064.7147147719838, + "y": 328.56187855063024 + }, + "selected": false, + "positionAbsolute": { + "x": 1064.7147147719838, + "y": 328.56187855063024 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1a", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1a", + "label": "-1", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "-1" + } + }, + "selected": false + }, + "position": { + "x": 553.0459523002967, + "y": 451.13717806476825 + }, + "selected": false, + "positionAbsolute": { + "x": 553.0459523002967, + "y": 451.13717806476825 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-dae9c5e6-fa8a-4f2c-8d56-f77445749237", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-dae9c5e6-fa8a-4f2c-8d56-f77445749237", + "label": "42", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "42" + } + }, + "selected": false + }, + "position": { + "x": -49.550885095089185, + "y": 265.2171743774056 + }, + "selected": false, + "positionAbsolute": { + "x": -49.550885095089185, + "y": 265.2171743774056 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138CONSTANT" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "end", + "target": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "targetHandle": "END", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbend-END-12d90ef2-4084-4532-94f2-dde2ba198b79END" + }, + { + "source": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "sourceHandle": "main", + "target": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "targetHandle": "FEEDBACK", + "id": "reactflow__edge-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138main-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0FEEDBACK" + }, + { + "source": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "sourceHandle": "main", + "target": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "targetHandle": "ADD", + "id": "reactflow__edge-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0main-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04ADD" + }, + { + "source": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "sourceHandle": "main", + "target": "LOADER-0ade6235-d420-468c-89af-bc408aee3a24", + "targetHandle": "LOADER", + "id": "reactflow__edge-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04main-LOADER-0ade6235-d420-468c-89af-bc408aee3a24LOADER" + }, + { + "source": "LOADER-0ade6235-d420-468c-89af-bc408aee3a24", + "sourceHandle": "main", + "target": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "targetHandle": "GOTO", + "id": "reactflow__edge-LOADER-0ade6235-d420-468c-89af-bc408aee3a24main-GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263GOTO" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1a", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1aCONSTANT" + }, + { + "source": "CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1a", + "sourceHandle": "main", + "target": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "targetHandle": "add_y", + "id": "reactflow__edge-CONSTANT-a17e1542-74ca-4999-985f-e69f71750b1amain-ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04add_y" + }, + { + "source": "CONSTANT-dae9c5e6-fa8a-4f2c-8d56-f77445749237", + "sourceHandle": "main", + "target": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "targetHandle": "LOOP", + "id": "reactflow__edge-CONSTANT-dae9c5e6-fa8a-4f2c-8d56-f77445749237main-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbLOOP" + } + ], + "viewport": { + "x": 226.6796457828928, + "y": 31.056018042519327, + "zoom": 0.6853504029717089 + } + }, + "ctrlsManifest": [ + { + "type": "output", + "name": "Seven Segment Display", + "minWidth": 2, + "minHeight": 3, + "id": "ctrl-4b484ce1-533a-4be6-a395-c9b96104d9e9", + "hidden": false, + "param": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "val": 0, + "layout": { + "w": 2, + "h": 3, + "x": 4, + "y": 0, + "i": "ctrl-4b484ce1-533a-4be6-a395-c9b96104d9e9", + "minW": 2, + "minH": 3, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Text Input", + "minWidth": 1, + "minHeight": 1, + "id": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92", + "hidden": false, + "param": { + "id": "CONDITIONAL_CONDITIONAL_operator_type", + "functionName": "CONDITIONAL", + "param": "operator_type", + "nodeId": "CONDITIONAL-2e565212-13e4-497c-89ca-2440fb98f68c", + "inputId": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92" + }, + "val": "<=", + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 0, + "i": "ctrl-3280c18b-84d7-4f72-a6ab-5b4721123c92", + "minW": 1, + "minH": 1, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Node Reference", + "minWidth": 2, + "minHeight": 2, + "id": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "hidden": false, + "param": { + "id": "FEEDBACK_FeedBack_referred_node", + "functionName": "FEEDBACK", + "param": "referred_node", + "nodeId": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "inputId": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "type": "node_reference" + }, + "val": "ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04", + "layout": { + "w": 2, + "h": 2, + "x": 2, + "y": 0, + "i": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "minW": 2, + "minH": 2, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Slider", + "minWidth": 2, + "minHeight": 1, + "id": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "hidden": false, + "param": { + "id": "num_loops", + "functionName": "LOOP", + "param": "num_loops", + "nodeId": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "inputId": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "type": "int" + }, + "val": "2", + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 2, + "i": "ctrl-528f60c6-3795-4f10-ab34-2e22914d632f", + "minW": 2, + "minH": 1, + "moved": false, + "static": false + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/example.md b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/example.md new file mode 100644 index 000000000..b7eebaed2 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/example.md @@ -0,0 +1,19 @@ +The workflow of this app is described below: + +`43`[CONSTANT](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py) : This is a CONSTANT node with a value of 43. It passing a DataContainer class of an ordered pair (x, y pair) to the next node `LOOP`, where x is None and y is a NumPy array with a value of 43. + +[LOOP](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py): This node is a special type that iterating through all the nodes connected to the body output a specified number of times as defined by its parameter `num_loop`, in this case this set to 2. It passes the value of the previous `CONSTANT` node to the next nodes. + +`12`[CONSTANT](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py): This is another `CONSTANT` node which value is 12. It passing the value of the previous node's output in the 'x' key and its own output in the 'y' key. e.g: `{'x': , 'y': [12,12,....]}` + +`-1`[CONSTANT](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py): Another `CONSTANT` node with a negative value of `-1`, performing the same function as the other CONSTANT nodes. + +[FEEDBACK](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py): This is another special node that fetching the output of the given node ID in it's parameter `referred_node` in this case it's `ADD` node `"ADD-0758c6a8-52b4-4b5b-9c46-2a83bdef2a04"`, on first iteration it passing the output of previous node and eventually the output of `ADD` node's output. + +[ADD](https://github.com/flojoy-io/nodes/blob/main/TRANSFORMERS/ARITHMETIC/ADD/ADD.py): Adding the value of connected inputs, in this case `CONSTANT` `-1` and output of `FEEDBACK` node. + +[LOADER](https://github.com/flojoy-io/nodes/blob/main/LOADERS/CLOUD_DATABASE/LOADER/LOADER.py): This node imports `FRONTIER_API_KEY` from `~/.flojoy/credentials` file and takes a parameter called `measurement_uuid`, which is the user measurement UUID of Frontier account. Using the `FRONTIER_API_KEY` and `measurement_uuid` sends input measurements to Frontier API on every run. This will throw an error if any of these two keys are not found. + +[GOTO](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/GOTO/GOTO.py): This node refering to the `LOOP` node to check if the specified number of iteration is completed. + +[TERMINATE](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/TERMINATORS/END.py): This node terminating the current script run. The output of this node is same as its parent node. diff --git a/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/output.txt b/docs/nodes/nodes/LOADERS/CLOUD_DATABASE/LOADER/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.md new file mode 100644 index 000000000..9f2025fa7 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..bbe55486e --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/docstring.txt @@ -0,0 +1,16 @@ +The LOCAL_FILE node loads a local file of different type and converts it to a DataContainer class. + + Parameters + ---------- + file_type : str + type of file to load, default: image. + file_path : str + path to the file to be loaded. + + Returns: + -------- + DataContainer: + type 'image' for file_type 'image' + + type 'dataframe' for file_type 'json', 'csv', 'excel', 'xml' + diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e5d90f4b5 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/parameters.yaml @@ -0,0 +1,12 @@ +file_type: + default: image + options: + - image + - csv + - json + - xml + - excel + type: select +path: + default: '' + type: string diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..123576183 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/a1-[autogen]/python_code.txt @@ -0,0 +1,67 @@ +from flojoy import flojoy, DataContainer, JobResultBuilder +from typing import Union +import numpy as np +from PIL import Image +from os import path +import pandas as pd + + +def get_file_path(file_path: str, default_path: str = None) -> str: + if default_path is None and file_path == "": + raise ValueError("File path is missing for file_path parameter!") + f_path = file_path if file_path != "" else default_path + print(f"file will be loaded from {f_path}") + return f_path + + +@flojoy +def LOCAL_FILE( + dc_inputs: list[DataContainer], params: dict +) -> Union[DataContainer, dict]: + + file_type: str = params["file_type"] + file_path: str = params["path"] + match file_type: + case "image": + default_image_path = path.join( + path.dirname(path.abspath(__file__)), + "assets", + "astronaut.png", + ) + file_path = get_file_path(file_path, default_image_path) + f = Image.open(file_path) + img_array = np.array(f.convert("RGBA")) + red_channel = img_array[:, :, 0] + green_channel = img_array[:, :, 1] + blue_channel = img_array[:, :, 2] + if img_array.shape[2] == 4: + alpha_channel = img_array[:, :, 3] + else: + alpha_channel = None + return DataContainer( + type="image", + r=red_channel, + g=green_channel, + b=blue_channel, + a=alpha_channel, + ) + case "csv": + file_path = get_file_path(file_path) + df = pd.read_csv(file_path) + return DataContainer(type="dataframe", m=df) + case "json": + file_path = get_file_path(file_path) + df = pd.read_json(file_path) + return DataContainer(type="dataframe", m=df) + case "xml": + file_path = get_file_path(file_path) + df = pd.read_xml(file_path) + return DataContainer(type="dataframe", m=df) + case "excel": + file_path = get_file_path(file_path) + df = pd.read_excel(file_path) + return DataContainer(type="dataframe", m=df) + case _: + raise ValueError( + f"LOCAL_FILE currently doesn't support file type : {file_type}" + ) diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/hardware.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/media.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/notes.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/app.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/app.txt new file mode 100644 index 000000000..dd227a1b0 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/app.txt @@ -0,0 +1,137 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "LOCAL_FILE-a9259621-d3ed-4459-b347-ea5c7598ef23", + "type": "LOCAL_FILE_SYSTEM", + "data": { + "id": "LOCAL_FILE-a9259621-d3ed-4459-b347-ea5c7598ef23", + "label": "LOCAL FILE", + "func": "LOCAL_FILE", + "type": "LOCAL_FILE_SYSTEM", + "ctrls": { + "file_type": { + "functionName": "LOCAL_FILE", + "param": "file_type", + "value": "image" + }, + "path": { + "functionName": "LOCAL_FILE", + "param": "path", + "value": "" + } + }, + "pip_dependencies": [ + { + "name": "xlrd" + }, + { + "name": "lxml" + } + ], + "selected": false + }, + "position": { + "x": 67.02657239815413, + "y": 171.76799388036227 + }, + "selected": false, + "positionAbsolute": { + "x": 67.02657239815413, + "y": 171.76799388036227 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1", + "type": "PLOTLY_VISOR", + "data": { + "id": "IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1", + "label": "IMAGE", + "func": "IMAGE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 439.8837152552969, + "y": 121.76799388036227 + }, + "selected": false, + "positionAbsolute": { + "x": 439.8837152552969, + "y": 121.76799388036227 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-d131e64e-8c1d-4f55-8e84-98d961a8d6b6", + "type": "TERMINATOR", + "data": { + "id": "END-d131e64e-8c1d-4f55-8e84-98d961a8d6b6", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 921.3122866838686, + "y": 177.48227959464788 + }, + "selected": true, + "positionAbsolute": { + "x": 921.3122866838686, + "y": 177.48227959464788 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOCAL_FILE-a9259621-d3ed-4459-b347-ea5c7598ef23", + "sourceHandle": "main", + "target": "IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1", + "targetHandle": "IMAGE", + "id": "reactflow__edge-LOCAL_FILE-a9259621-d3ed-4459-b347-ea5c7598ef23main-IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1IMAGE" + }, + { + "source": "IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1", + "sourceHandle": "main", + "target": "END-d131e64e-8c1d-4f55-8e84-98d961a8d6b6", + "targetHandle": "END", + "id": "reactflow__edge-IMAGE-97314e7b-4d8a-4837-b94d-9259c14c2bc1main-END-d131e64e-8c1d-4f55-8e84-98d961a8d6b6END" + } + ], + "viewport": { + "x": 226.6796457828928, + "y": 31.056018042519327, + "zoom": 0.6853504029717089 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/example.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/example.md new file mode 100644 index 000000000..aada0abf4 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/example.md @@ -0,0 +1,7 @@ +In this example `LOCAL_FILE` node is loading a default astronaut image which is then visualized with a plotly visulizer node `IMAGE`. + +### Output in debug panel +This is how it looks in debug panel after script run + + +![debug-panel-local-file](https://res.cloudinary.com/dm5f4kpjf/image/upload/v1686167126/Screenshot_52_wash9i.png) \ No newline at end of file diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/output.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/OPEN_MATLAB.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/OPEN_MATLAB.md new file mode 100644 index 000000000..fced8cf74 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/OPEN_MATLAB.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..2d7e3d315 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/docstring.txt @@ -0,0 +1,13 @@ +The OPEN_MATLAB node loads a local file of the .mat file format. + Note that if multiple 'tabs' of data are used, the number of rows + must match in order to stack the arrays. + + Parameters + ---------- + file_path : str + path to the file to be loaded. + + Returns: + -------- + DataContainer: + type 'dataframe', m diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..40946059f --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +path: + default: '' + type: string diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..fb653709a --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/a1-[autogen]/python_code.txt @@ -0,0 +1,36 @@ +from flojoy import flojoy, DataContainer, JobResultBuilder +from typing import Union +import numpy as np +from scipy.io import loadmat +from os import path +import pandas as pd + + +@flojoy +def OPEN_MATLAB( + dc_inputs: list[DataContainer], params: dict +) -> Union[DataContainer, dict]: + + file_path: str = params["path"] + + if file_path == "": + file_path = path.join( + path.dirname(path.abspath(__file__)), + "assets", + "default.mat", + ) + + if file_path[-4:] != ".mat": + raise ValueError(f"File type {file_path[-4:]} unsupported.") + + if not path.exists(file_path): + raise ValueError("File path does not exist!") + + mat = loadmat(file_path) + key = list(mat.keys())[3:] + X = mat[key[0]] + Y = mat[key[1]] + + df = pd.DataFrame(np.hstack((X, Y))) + + return DataContainer(type="dataframe", m=df) diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/hardware.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/media.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/notes.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/app.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/app.txt new file mode 100644 index 000000000..0b52a1d90 --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/app.txt @@ -0,0 +1,124 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "type": "TERMINATOR", + "data": { + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "selected": false, + "positionAbsolute": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "dragging": true + }, + { + "width": 240, + "height": 260, + "id": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "type": "PLOTLY_VISOR", + "data": { + "id": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "label": "ARRAY VIEW", + "func": "ARRAY_VIEW", + "type": "DATA_STRUCTURE", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 437.6898013585036, + "y": 178.7177912720195 + }, + "selected": false, + "positionAbsolute": { + "x": 437.6898013585036, + "y": 178.7177912720195 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "OPEN_MATLAB-f2dc77e1-ab32-4648-adaf-050c44d303bb", + "type": "LOCAL_FILE_SYSTEM", + "data": { + "id": "OPEN_MATLAB-f2dc77e1-ab32-4648-adaf-050c44d303bb", + "label": "OPEN MATLAB", + "func": "OPEN_MATLAB", + "type": "LOCAL_FILE_SYSTEM", + "ctrls": { + "path": { + "functionName": "OPEN_MATLAB", + "param": "path", + "value": "" + } + }, + "selected": false + }, + "position": { + "x": -53.201565810853026, + "y": 244.03709569435716 + }, + "selected": false, + "positionAbsolute": { + "x": -53.201565810853026, + "y": 244.03709569435716 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "sourceHandle": "main", + "target": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "targetHandle": "END", + "id": "reactflow__edge-ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162main-END-d1db4ad1-e647-4059-b60f-173210b3f769END" + }, + { + "source": "OPEN_MATLAB-f2dc77e1-ab32-4648-adaf-050c44d303bb", + "sourceHandle": "main", + "target": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "targetHandle": "ARRAY_VIEW", + "id": "reactflow__edge-OPEN_MATLAB-f2dc77e1-ab32-4648-adaf-050c44d303bbmain-ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162ARRAY_VIEW" + } + ], + "viewport": { + "x": 204.5497340380639, + "y": 0.06532218892027686, + "zoom": 1.7088476441637748 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/example.md b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/example.md new file mode 100644 index 000000000..1aa58e90b --- /dev/null +++ b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/example.md @@ -0,0 +1 @@ +In this example `OPEN_MATLAB` node is loading a default .mat file which is then partially visualized with a plotly visulizer node `ARRAY_VIEW`. diff --git a/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/output.txt b/docs/nodes/nodes/LOADERS/LOCAL_FILE_SYSTEM/OPEN_MATLAB/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/CONDITIONAL.md b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/CONDITIONAL.md new file mode 100644 index 000000000..6b78a0e2e --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/CONDITIONAL.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..0749239cb --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/docstring.txt @@ -0,0 +1,7 @@ +The CONDITIONAL node is a specialized node that compares two given DataContainer inputs + and enqueues nodes connected with `true` or `false` output based on the comparison result. + + Parameters: + ----------- + operator_type: str, optional + Specifies the type of comparison to be performed between the two inputs. The default value is `>=`. diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..1b12fb99c --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/parameters.yaml @@ -0,0 +1,10 @@ +operator_type: + default: '>=' + options: + - <= + - '>' + - < + - '>=' + - '!=' + - == + type: select diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..36fa3946b --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/a1-[autogen]/python_code.txt @@ -0,0 +1,35 @@ +from flojoy import flojoy, DataContainer, JobResultBuilder +from typing import Union +from utils.utils import compare_values + + +@flojoy +def CONDITIONAL( + dc_inputs: list[DataContainer], params: dict +) -> Union[DataContainer, dict]: + + operator = params["operator_type"] + + dc_input_x = dc_inputs[0] + dc_input_y = dc_inputs[1] + x = dc_input_x.y + y = dc_input_y.y + bool_ = compare_values(x[0], y[0], operator) + + data = None + if operator in ["<=", "<"]: + if not bool_: + data = DataContainer(x=dc_inputs[0].x, y=y) + else: + data = DataContainer(x=dc_inputs[1].x, y=x) + else: + if bool_: + data = DataContainer(x=dc_inputs[0].x, y=y) + else: + data = DataContainer(x=dc_inputs[1].x, y=x) + + next_direction = str(bool_).lower() + + return ( + JobResultBuilder().from_data(data).flow_to_directions([next_direction]).build() + ) diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/hardware.md b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/media.md b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/notes.md b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/app.txt b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/app.txt new file mode 100644 index 000000000..7b6d13603 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/app.txt @@ -0,0 +1,282 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 272, + "id": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "type": "CONDITIONAL", + "data": { + "id": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "label": "CONDITIONAL", + "func": "CONDITIONAL", + "type": "CONDITIONAL", + "ctrls": { + "operator_type": { + "functionName": "CONDITIONAL", + "param": "operator_type", + "value": ">" + } + }, + "inputs": [ + { + "name": "x", + "id": "first", + "type": "target" + }, + { + "name": "y", + "id": "second", + "type": "target" + }, + { + "name": "true", + "id": "true", + "type": "source" + }, + { + "name": "false", + "id": "false", + "type": "source" + } + ], + "selected": false + }, + "position": { + "x": 177.68282882825085, + "y": 140.0331793216858 + }, + "selected": false, + "positionAbsolute": { + "x": 177.68282882825085, + "y": 140.0331793216858 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-225071cd-08c6-4d35-84d3-18f4415e15c7", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-225071cd-08c6-4d35-84d3-18f4415e15c7", + "label": "8", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "8" + } + }, + "selected": false + }, + "position": { + "x": -79.46002831460628, + "y": 90.0331793216858 + }, + "selected": false, + "positionAbsolute": { + "x": -79.46002831460628, + "y": 90.0331793216858 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-4ee748c9-97f8-4848-aa0c-0051cf25780f", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-4ee748c9-97f8-4848-aa0c-0051cf25780f", + "label": "4", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "4" + } + }, + "selected": false + }, + "position": { + "x": -68.03145688603482, + "y": 312.8903221788286 + }, + "selected": false, + "positionAbsolute": { + "x": -68.03145688603482, + "y": 312.8903221788286 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "LINE-1c164ed0-6935-4131-8b14-b441b55b8296", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-1c164ed0-6935-4131-8b14-b441b55b8296", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 517.6828288282509, + "y": -24.252534964028428 + }, + "selected": false, + "positionAbsolute": { + "x": 517.6828288282509, + "y": -24.252534964028428 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-4a61d030-c8fa-4642-993e-1a117377d95c", + "type": "TERMINATOR", + "data": { + "id": "END-4a61d030-c8fa-4642-993e-1a117377d95c", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 873.3971145425365, + "y": -12.823963535457096 + }, + "selected": false, + "positionAbsolute": { + "x": 873.3971145425365, + "y": -12.823963535457096 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-8050f902-0f27-4fa7-9888-9308ad7f2044", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-8050f902-0f27-4fa7-9888-9308ad7f2044", + "label": "LINE 1", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 514.825685971108, + "y": 314.3188936074001 + }, + "selected": false, + "positionAbsolute": { + "x": 514.825685971108, + "y": 314.3188936074001 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-49055e07-8aad-4a25-b908-2f3c8238b768", + "type": "TERMINATOR", + "data": { + "id": "END-49055e07-8aad-4a25-b908-2f3c8238b768", + "label": "END 1", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 894.825685971108, + "y": 378.60460789311446 + }, + "selected": false, + "positionAbsolute": { + "x": 894.825685971108, + "y": 378.60460789311446 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "CONSTANT-225071cd-08c6-4d35-84d3-18f4415e15c7", + "sourceHandle": "main", + "target": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "targetHandle": "first", + "id": "reactflow__edge-CONSTANT-225071cd-08c6-4d35-84d3-18f4415e15c7main-CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277efirst" + }, + { + "source": "CONSTANT-4ee748c9-97f8-4848-aa0c-0051cf25780f", + "sourceHandle": "main", + "target": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "targetHandle": "second", + "id": "reactflow__edge-CONSTANT-4ee748c9-97f8-4848-aa0c-0051cf25780fmain-CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277esecond" + }, + { + "source": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "sourceHandle": "true", + "target": "LINE-1c164ed0-6935-4131-8b14-b441b55b8296", + "targetHandle": "LINE", + "id": "reactflow__edge-CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277etrue-LINE-1c164ed0-6935-4131-8b14-b441b55b8296LINE" + }, + { + "source": "LINE-1c164ed0-6935-4131-8b14-b441b55b8296", + "sourceHandle": "main", + "target": "END-4a61d030-c8fa-4642-993e-1a117377d95c", + "targetHandle": "END", + "id": "reactflow__edge-LINE-1c164ed0-6935-4131-8b14-b441b55b8296main-END-4a61d030-c8fa-4642-993e-1a117377d95cEND" + }, + { + "source": "CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277e", + "sourceHandle": "false", + "target": "LINE-8050f902-0f27-4fa7-9888-9308ad7f2044", + "targetHandle": "LINE", + "id": "reactflow__edge-CONDITIONAL-a1faa4f5-5a9f-4b53-a6e4-3b0c3e12277efalse-LINE-8050f902-0f27-4fa7-9888-9308ad7f2044LINE" + }, + { + "source": "LINE-8050f902-0f27-4fa7-9888-9308ad7f2044", + "sourceHandle": "main", + "target": "END-49055e07-8aad-4a25-b908-2f3c8238b768", + "targetHandle": "END", + "id": "reactflow__edge-LINE-8050f902-0f27-4fa7-9888-9308ad7f2044main-END-49055e07-8aad-4a25-b908-2f3c8238b768END" + } + ], + "viewport": { + "x": 226.6796457828928, + "y": 31.056018042519327, + "zoom": 0.6853504029717089 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/example.md b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/example.md new file mode 100644 index 000000000..4b700c95f --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/example.md @@ -0,0 +1,5 @@ +In this example, we begin with two `CONSTANT` nodes initialized with values 8 and 4. These nodes are connected to the X and Y inputs of the `CONDITIONAL` node, allowing us to compare them. + +Based on the result of the comparison, the corresponding output gate of the `CONDITIONAL` node will be activated. In this case, we have set the `operator_type` parameter to `>`, indicating that the comparison being performed is greater than. + +As a result, the `true` output gate of the `CONDITIONAL` node will be triggered, leading to the execution of the Plotly Visual `LINE` node connected to it. \ No newline at end of file diff --git a/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/output.txt b/docs/nodes/nodes/LOGIC_GATES/CONDITIONALS/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/GOTO.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/GOTO.md new file mode 100644 index 000000000..57b79da54 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/GOTO.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..25f283971 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +goto_node_id: + default: '' + type: node_reference diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..1d20b0523 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/a1-[autogen]/python_code.txt @@ -0,0 +1,10 @@ +from flojoy import JobResultBuilder, flojoy +from flojoy import DataContainer + + +@flojoy +def GOTO(dc_inputs: list[DataContainer], params: dict) -> dict: + goto_node_id = params.get("goto_node_id", None) + next_nodes = [goto_node_id] if goto_node_id is not None else [] + + return JobResultBuilder().from_inputs(dc_inputs).flow_to_nodes(next_nodes).build() diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/hardware.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/media.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/notes.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/GOTO/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/LOOP.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/LOOP.md new file mode 100644 index 000000000..31c450368 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/LOOP.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e9f8683b6 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/docstring.txt @@ -0,0 +1,7 @@ +The LOOP node is a specialized node that iterates through the body nodes for a given number of times. + To ensure proper functionality, the LOOP node relies on a companion node called the `GOTO` node. + + Parameters + ---------- + num_loops : int + number of times to iterate through body nodes default is `-1` meaning infinity. diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..a25bdaa15 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +num_loops: + default: -1 + type: int diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..373546376 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/a1-[autogen]/python_code.txt @@ -0,0 +1,111 @@ +import json + +from node_sdk.small_memory import SmallMemory + +from flojoy import JobResultBuilder, DataContainer, flojoy + +memory_key = "loop-info" + + +class LoopData: + def __init__( + self, node_id, num_loops=-1, current_iteration=0, is_finished=False + ) -> None: + self.node_id = node_id + self.num_loops = int(num_loops) + self.current_iteration = int(current_iteration) + self.is_finished = bool(is_finished) + + def restart(self): + self.current_iteration = 0 + self.is_finished = False + + def step(self): + self.current_iteration += 1 + if self.current_iteration > self.num_loops: + self.is_finished = True + + def get_data(self): + return { + "node_id": self.node_id, + "num_loops": self.num_loops, + "current_iteration": self.current_iteration, + "is_finished": self.is_finished, + } + + @staticmethod + def from_data(node_id, data: dict): + loop_data = LoopData( + node_id, + num_loops=data.get("num_loops", -1), + current_iteration=data.get("current_iteration", 0), + is_finished=data.get("is_finished", False), + ) + return loop_data + + def print(self, prefix=""): + print(f"{prefix}loop Data:", json.dumps(self.get_data(), indent=2)) + + +@flojoy +def LOOP(dc_inputs: list[DataContainer], params: dict) -> dict: + + num_loops: int = params.get("num_loops", 0) + node_id = params.get("node_id", 0) + + print("\n\nstart loop:", node_id) + + # infinite loop + if num_loops == -1: + print("infinite loop") + return build_result(inputs=dc_inputs, is_loop_finished=False) + + loop_data: LoopData = load_loop_data(node_id, num_loops) + loop_data.print("at start ") + + # loop was previously finished, but now re-executing, so restart + if loop_data.is_finished: + loop_data.restart() + else: + loop_data.step() + + if not loop_data.is_finished: + store_loop_data(node_id, loop_data) + else: + print("finished loop") + delete_loop_data(node_id) + + print("end loop\n\n") + + return build_result(dc_inputs, loop_data.is_finished) + + +def load_loop_data(node_id, default_num_loops) -> LoopData: + data = SmallMemory().read_memory(node_id, memory_key) or {} + loop_data = LoopData.from_data( + node_id=node_id, data={"num_loops": default_num_loops, **data} + ) + return loop_data + + +def store_loop_data(node_id, loop_data: LoopData): + SmallMemory().write_to_memory(node_id, memory_key, loop_data.get_data()) + loop_data.print("store ") + + +def delete_loop_data(node_id): + SmallMemory().delete_object(node_id, memory_key) + print("delete loop data") + + +def build_result(inputs, is_loop_finished: bool): + return ( + JobResultBuilder() + .from_inputs(inputs) + .flow_by_flag( + flag=is_loop_finished, + directionsWhenFalse=["body"], + directionsWhenTrue=["end"], + ) + .build() + ) diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/hardware.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/media.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/notes.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/app.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/app.txt new file mode 100644 index 000000000..5a6f9637b --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/app.txt @@ -0,0 +1,350 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 181, + "id": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "type": "LOOP", + "data": { + "id": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "label": "LOOP", + "func": "LOOP", + "type": "LOOP", + "ctrls": { + "num_loops": { + "functionName": "LOOP", + "param": "num_loops", + "value": "5" + } + }, + "inputs": [ + { + "name": "end", + "id": "end", + "type": "source" + }, + { + "name": "body", + "id": "body", + "type": "source" + } + ], + "selected": false + }, + "position": { + "x": -165.19821730816662, + "y": 224.91813286421683 + }, + "selected": false, + "positionAbsolute": { + "x": -165.19821730816662, + "y": 224.91813286421683 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207", + "type": "PLOTLY_VISOR", + "data": { + "id": "BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207", + "label": "BIG NUMBER", + "func": "BIG_NUMBER", + "type": "PLOTLY_VISOR", + "ctrls": { + "suffix": { + "functionName": "BIG_NUMBER", + "param": "suffix", + "value": "" + }, + "prefix": { + "functionName": "BIG_NUMBER", + "param": "prefix", + "value": "" + }, + "relative_delta": { + "functionName": "BIG_NUMBER", + "param": "relative_delta", + "value": "true" + }, + "title": { + "functionName": "BIG_NUMBER", + "param": "title", + "value": "" + } + }, + "selected": false + }, + "position": { + "x": 773.3732112632616, + "y": 210.63241857850255 + }, + "selected": false, + "positionAbsolute": { + "x": 773.3732112632616, + "y": 210.63241857850255 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62", + "label": "4", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "4" + } + }, + "selected": false + }, + "position": { + "x": 274.8017826918334, + "y": 413.4895614356452 + }, + "selected": false, + "positionAbsolute": { + "x": 274.8017826918334, + "y": 413.4895614356452 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79", + "type": "SIMULATION", + "data": { + "id": "FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79", + "label": "FEEDBACK", + "func": "FEEDBACK", + "type": "SIMULATION", + "ctrls": { + "referred_node": { + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75" + } + }, + "selected": false + }, + "position": { + "x": 263.37321126326196, + "y": 200.63241857850244 + }, + "selected": false, + "positionAbsolute": { + "x": 263.37321126326196, + "y": 200.63241857850244 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75", + "type": "ARITHMETIC", + "data": { + "id": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75", + "label": "MULTIPLY", + "func": "MULTIPLY", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "multiply_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 536.2303541204047, + "y": 293.4895614356452 + }, + "selected": false, + "positionAbsolute": { + "x": 536.2303541204047, + "y": 293.4895614356452 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-7f67a24c-5bd5-4906-bd86-682cb10db127", + "type": "TERMINATOR", + "data": { + "id": "END-7f67a24c-5bd5-4906-bd86-682cb10db127", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 309.0874969775476, + "y": -43.65329570721184 + }, + "selected": false, + "positionAbsolute": { + "x": 309.0874969775476, + "y": -43.65329570721184 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "GOTO-0877f4a6-d19b-4311-a671-48444fe3e254", + "type": "LOOP", + "data": { + "id": "GOTO-0877f4a6-d19b-4311-a671-48444fe3e254", + "label": "GOTO", + "func": "GOTO", + "type": "LOOP", + "ctrls": { + "goto_node_id": { + "functionName": "GOTO", + "param": "goto_node_id", + "value": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0" + } + }, + "selected": false + }, + "position": { + "x": 1240.516068406119, + "y": 272.0609900070739 + }, + "selected": false, + "positionAbsolute": { + "x": 1240.516068406119, + "y": 272.0609900070739 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-d016dbf8-556b-4a3c-9f68-c801e12b9f2c", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-d016dbf8-556b-4a3c-9f68-c801e12b9f2c", + "label": "8", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "8" + } + }, + "selected": false + }, + "position": { + "x": -408.007563009186, + "y": 245.44358920891227 + }, + "selected": false, + "positionAbsolute": { + "x": -408.007563009186, + "y": 245.44358920891227 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "sourceHandle": "body", + "target": "CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-c9429714-96da-4a0a-86c0-4e657d188db0body-CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62CONSTANT" + }, + { + "source": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "sourceHandle": "body", + "target": "FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79", + "targetHandle": "FEEDBACK", + "id": "reactflow__edge-LOOP-c9429714-96da-4a0a-86c0-4e657d188db0body-FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79FEEDBACK" + }, + { + "source": "FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79", + "sourceHandle": "main", + "target": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75", + "targetHandle": "MULTIPLY", + "id": "reactflow__edge-FEEDBACK-9cbc8309-a437-496b-b15d-052d3ebb6e79main-MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75MULTIPLY" + }, + { + "source": "CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62", + "sourceHandle": "main", + "target": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75", + "targetHandle": "multiply_y", + "id": "reactflow__edge-CONSTANT-31549d95-fa48-492f-8b7c-1239ee0bdd62main-MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75multiply_y" + }, + { + "source": "MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75", + "sourceHandle": "main", + "target": "BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207", + "targetHandle": "BIG_NUMBER", + "id": "reactflow__edge-MULTIPLY-01259e3c-f5c1-4b07-9733-c2e70b371f75main-BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207BIG_NUMBER" + }, + { + "source": "BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207", + "sourceHandle": "main", + "target": "GOTO-0877f4a6-d19b-4311-a671-48444fe3e254", + "targetHandle": "GOTO", + "id": "reactflow__edge-BIG_NUMBER-7dd775a5-2604-4b31-ad6d-8888ac9c3207main-GOTO-0877f4a6-d19b-4311-a671-48444fe3e254GOTO" + }, + { + "source": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "sourceHandle": "end", + "target": "END-7f67a24c-5bd5-4906-bd86-682cb10db127", + "targetHandle": "END", + "id": "reactflow__edge-LOOP-c9429714-96da-4a0a-86c0-4e657d188db0end-END-7f67a24c-5bd5-4906-bd86-682cb10db127END" + }, + { + "source": "CONSTANT-d016dbf8-556b-4a3c-9f68-c801e12b9f2c", + "sourceHandle": "main", + "target": "LOOP-c9429714-96da-4a0a-86c0-4e657d188db0", + "targetHandle": "LOOP", + "id": "reactflow__edge-CONSTANT-d016dbf8-556b-4a3c-9f68-c801e12b9f2cmain-LOOP-c9429714-96da-4a0a-86c0-4e657d188db0LOOP" + } + ], + "viewport": { + "x": 209.57592296752466, + "y": 82.44326331471018, + "zoom": 0.8625093914350112 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/example.md b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/example.md new file mode 100644 index 000000000..364b3ca05 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/example.md @@ -0,0 +1,16 @@ +In this example, we begin with a [`CONSTANT`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py) node that has a value of 8. + +The value is then passed to a [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node, which, in turn, passes it to the nodes connected to its body output. The [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node is a special node that takes a parameter called `num_loops`, indicating the number of iterations. In this example, we used 5 iterations, but the default value for this parameter is `-1`, meaning it will iterate infinitely. Each time the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node is executed, it checks the remaining number of iterations and enqueues all nodes connected to its body output if there are more iterations to be performed. + +Next, we have two nodes, [`CONSTANT`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/CONSTANT/CONSTANT.py) and [`FEEDBACK`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py), connected to the body output of the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node. The [`FEEDBACK`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py) node is another special node designed to collect the result of a given node ID. It takes a parameter called `node_reference`, which is the ID of a node. It attempts to retrieve the result of the specified node ID. If the result is not found, it passes the result of its parent node. In this example, we provided the ID of the [`MULTIPLY`](https://github.com/flojoy-io/nodes/blob/main/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.py) node as the parameter for the [`FEEDBACK`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py) node. + +We also have a [`MULTIPLY`](https://github.com/flojoy-io/nodes/blob/main/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.py) node, which performs element-wise multiplication on two input Numpy arrays. It is connected to a visual node called [`BIG_NUMBER`](https://github.com/flojoy-io/nodes/blob/main/VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.py), which visualizes the returned value of the [`MULTIPLY`](https://github.com/flojoy-io/nodes/blob/main/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.py) node in an indicators plot. + +To enable the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node to function correctly, another helper node called [`GOTO`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/GOTO/GOTO.py) is required. This node takes a parameter called `node_reference`, similar to the [`FEEDBACK`](https://github.com/flojoy-io/nodes/blob/main/GENERATORS/SIMULATIONS/FEEDBACK/FEEDBACK.py) node. However, the [`GOTO`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/GOTO/GOTO.py) node always enqueues the specified node, which, in this case, is the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node. Therefore, the workflow is as follows: the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node enqueues the nodes connected to its body output, then the [`GOTO`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/GOTO/GOTO.py) node enqueues the [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node again. The [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node checks if the remaining number of iterations is greater than zero. If so, it enqueues its body nodes again until the number of remaining iterations becomes zero. Finally, it enqueues the nodes connected to its end output. + +Lastly, we have an [`END`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/TERMINATORS/END.py) node which is connected with end output of [`LOOP`](https://github.com/flojoy-io/nodes/blob/main/LOGIC_GATES/LOOPS/LOOP/LOOP.py) node, which serves to terminate the program. + +### Debug Panel + +Here how it looks in debug panel: +!["loop-output"](https://res.cloudinary.com/dm5f4kpjf/image/upload/v1686080780/Screenshot_50_xlni16.png) \ No newline at end of file diff --git a/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/output.txt b/docs/nodes/nodes/LOGIC_GATES/LOOPS/LOOP/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/END.md b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/END.md new file mode 100644 index 000000000..5963f7e31 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/END.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..40ad6d853 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/a1-[autogen]/python_code.txt @@ -0,0 +1,7 @@ +from flojoy import flojoy, JobResultBuilder, DataContainer + + +@flojoy +def END(dc_inputs: list[DataContainer], params: dict) -> dict: + inputs: list[DataContainer] = dc_inputs if len(dc_inputs) > 0 else [] + return JobResultBuilder().from_inputs(inputs).flow_to_nodes([]).build() diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/hardware.md b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/media.md b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/notes.md b/docs/nodes/nodes/LOGIC_GATES/TERMINATORS/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/TIMER.md b/docs/nodes/nodes/LOGIC_GATES/TIMERS/TIMER.md new file mode 100644 index 000000000..d8701bafd --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/TIMERS/TIMER.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/docstring.txt b/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..a48018797 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +sleep_time: + default: 0 + type: int diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/python_code.txt b/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..8ec329a45 --- /dev/null +++ b/docs/nodes/nodes/LOGIC_GATES/TIMERS/a1-[autogen]/python_code.txt @@ -0,0 +1,12 @@ +from flojoy import flojoy, DataContainer, JobResultBuilder +import time + + +@flojoy +def TIMER(dc_inputs: list[DataContainer], params: dict) -> dict: + print("executing timer") + + seconds: int = params["sleep_time"] + time.sleep(seconds) + + return JobResultBuilder().from_inputs(dc_inputs).build() diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/hardware.md b/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/media.md b/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/notes.md b/docs/nodes/nodes/LOGIC_GATES/TIMERS/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/ABS.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/ABS.md new file mode 100644 index 000000000..66f818892 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/ABS.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..4c7634acb --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Returns abolute value \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..bad25aedd --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/a1-[autogen]/python_code.txt @@ -0,0 +1,8 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def ABS(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + return DataContainer(x=dc_inputs[0].y, y=np.abs(dc_inputs[0].y)) diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ABS/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/ADD.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/ADD.md new file mode 100644 index 000000000..8dbf5cd07 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/ADD.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..8b65f4a21 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/docstring.txt @@ -0,0 +1,5 @@ +Add 2 or more numeric arrays, matrices, dataframes, or constants element-wise. + When a constant is added to an array or matrix, each element in the array or + matrix will be increased by the constant value. If 2 arrays or matrices of different + sizes are added, the output will be the size of the larger array or matrix with + only the overlapping elements changed. diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..08dedfbc8 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def ADD(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + if len(dc_inputs) < 2: + raise ValueError( + f"To add the values, ADD node requires two inputs, {len(dc_inputs)} was given!" + ) + a = dc_inputs[0].y + b = dc_inputs[1].y + + x = dc_inputs[0].x + y = np.add(a, b) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/app.txt new file mode 100644 index 000000000..9195784a0 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/app.txt @@ -0,0 +1,236 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 135, + "id": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "type": "default", + "data": { + "id": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "10" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1000" + } + }, + "selected": false + }, + "position": { + "x": -85.71428571428574, + "y": 363.4285714285712 + }, + "selected": false, + "positionAbsolute": { + "x": -85.71428571428574, + "y": 363.4285714285712 + }, + "dragging": true + }, + { + "width": 115, + "height": 115, + "id": "SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbd", + "type": "SIMULATION", + "data": { + "id": "SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbd", + "label": "SINE", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": "1" + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": "0" + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": "1" + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": "0" + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 197.14285714285717, + "y": 283.2857142857143 + }, + "selected": false, + "positionAbsolute": { + "x": 197.14285714285717, + "y": 283.2857142857143 + }, + "dragging": true + }, + { + "width": 115, + "height": 115, + "id": "RAND-434f7314-f239-4e7d-a9c6-629529db1d82", + "type": "SIMULATION", + "data": { + "id": "RAND-434f7314-f239-4e7d-a9c6-629529db1d82", + "label": "RAND", + "func": "RAND", + "type": "SIMULATION", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 188.99999999999994, + "y": 469.57142857142867 + }, + "selected": false, + "positionAbsolute": { + "x": 188.99999999999994, + "y": 469.57142857142867 + }, + "dragging": true + }, + { + "width": 99, + "height": 115, + "id": "ADD-a586b5d7-4343-430d-89ce-3c2a3d156695", + "type": "ARITHMETIC", + "data": { + "id": "ADD-a586b5d7-4343-430d-89ce-3c2a3d156695", + "label": "ADD", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 416.8571428571427, + "y": 395.14285714285705 + }, + "selected": false, + "positionAbsolute": { + "x": 416.8571428571427, + "y": 395.14285714285705 + }, + "dragging": true + }, + { + "width": 250, + "height": 159, + "id": "SCATTER-da4e4991-d9a4-4c71-95e6-56b13266ede6", + "type": "VISOR", + "data": { + "id": "SCATTER-da4e4991-d9a4-4c71-95e6-56b13266ede6", + "label": "SCATTER", + "func": "SCATTER", + "type": "VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 615.5714285714288, + "y": 371.4285714285715 + }, + "selected": false, + "positionAbsolute": { + "x": 615.5714285714288, + "y": 371.4285714285715 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "sourceHandle": "main", + "target": "RAND-434f7314-f239-4e7d-a9c6-629529db1d82", + "targetHandle": "RAND", + "id": "reactflow__edge-LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135cemain-RAND-434f7314-f239-4e7d-a9c6-629529db1d82RAND" + }, + { + "source": "LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135ce", + "sourceHandle": "main", + "target": "SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbd", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-340e6c5c-8e47-4a5e-95ed-dc627e9135cemain-SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbdSINE" + }, + { + "source": "ADD-a586b5d7-4343-430d-89ce-3c2a3d156695", + "sourceHandle": "main", + "target": "SCATTER-da4e4991-d9a4-4c71-95e6-56b13266ede6", + "targetHandle": "SCATTER", + "id": "reactflow__edge-ADD-a586b5d7-4343-430d-89ce-3c2a3d156695main-SCATTER-da4e4991-d9a4-4c71-95e6-56b13266ede6SCATTER" + }, + { + "source": "SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbd", + "sourceHandle": "main", + "target": "ADD-a586b5d7-4343-430d-89ce-3c2a3d156695", + "targetHandle": "ADD", + "id": "reactflow__edge-SINE-2cd08316-0a0c-4c13-9b1d-382ba4d74cbdmain-ADD-a586b5d7-4343-430d-89ce-3c2a3d156695ADD" + }, + { + "source": "RAND-434f7314-f239-4e7d-a9c6-629529db1d82", + "sourceHandle": "main", + "target": "ADD-a586b5d7-4343-430d-89ce-3c2a3d156695", + "targetHandle": "add_y", + "id": "reactflow__edge-RAND-434f7314-f239-4e7d-a9c6-629529db1d82main-ADD-a586b5d7-4343-430d-89ce-3c2a3d156695add_y" + } + ], + "viewport": { + "x": 234.66911838622127, + "y": 107.67920450356877, + "zoom": 0.7116576751667055 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/example.md new file mode 100644 index 000000000..4f9cada5a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/example.md @@ -0,0 +1,5 @@ +In this example, `LINSPACE` generates an array from 0 to 99 (eg: [0, 1, 2… 99]). + +This array is then passed to both the `SINE` and `RAND` nodes, which compute `numpy.sine()` and `numpy.rand()` on each element of this array (respectively). + +Finally, these 2 arrays are added together element-wise - click the *Output* tab above to see the result. You guessed it - the output is a noisy sine wave. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/ADD/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/DIVIDE.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/DIVIDE.md new file mode 100644 index 000000000..6944334a3 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/DIVIDE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..1795702bb --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/docstring.txt @@ -0,0 +1,3 @@ +Divide 2 or more numeric arrays, matrices, dataframes, or constants element-wise. + When a constant is added to an array or matrix, each element in the array or + matrix will be increased by the constant value. diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..9319b392b --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def DIVIDE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + if len(dc_inputs) < 2: + raise ValueError( + f"To add the values, DIVIDE node requires two inputs, {len(dc_inputs)} was given!" + ) + a = dc_inputs[0].y + b = dc_inputs[1].y + + x = dc_inputs[0].x + y = np.divide(a, b) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/DIVIDE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.md new file mode 100644 index 000000000..40a231bf0 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/MULTIPLY.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..6d7bac546 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Takes 2 input vectors, multiplies them, and returns the result \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..87090d5c7 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/a1-[autogen]/python_code.txt @@ -0,0 +1,14 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def MULTIPLY(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + a = dc_inputs[0].y + b = dc_inputs[1].y + + x = dc_inputs[0].x + y = np.multiply(a, b) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/app.txt new file mode 100644 index 000000000..a98356c44 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/app.txt @@ -0,0 +1,255 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 135, + "id": "LINSPACE-918dfb3c-460b-4dea-a00f-6262c3a6f53f", + "type": "default", + "data": { + "id": "LINSPACE-918dfb3c-460b-4dea-a00f-6262c3a6f53f", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "10" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1000" + } + }, + "selected": false + }, + "position": { + "x": 203.80460493267987, + "y": 351.8172864003198 + }, + "selected": false, + "positionAbsolute": { + "x": 203.80460493267987, + "y": 351.8172864003198 + }, + "dragging": true + }, + { + "width": 99, + "height": 115, + "id": "MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8b", + "type": "ARITHMETIC", + "data": { + "id": "MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8b", + "label": "MULTIPLY", + "func": "MULTIPLY", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "multiply_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 622.8401381897935, + "y": 178.97328643078504 + }, + "selected": false, + "positionAbsolute": { + "x": 622.8401381897935, + "y": 178.97328643078504 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "LINSPACE-583eb3a1-cb88-4306-bb27-4ecae9f2da39", + "type": "default", + "data": { + "id": "LINSPACE-583eb3a1-cb88-4306-bb27-4ecae9f2da39", + "label": "LINSPACE_1", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "0" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "10" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1000" + } + }, + "selected": false + }, + "position": { + "x": 202.59550126110406, + "y": -77.88487354908918 + }, + "selected": false, + "positionAbsolute": { + "x": 202.59550126110406, + "y": -77.88487354908918 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "LINSPACE-506fd9f4-2691-4657-a520-51c3cb917c47", + "type": "default", + "data": { + "id": "LINSPACE-506fd9f4-2691-4657-a520-51c3cb917c47", + "label": "LINSPACE_2", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "0" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1" + } + }, + "selected": false + }, + "position": { + "x": 605.2524720624972, + "y": 528.9324507458141 + }, + "selected": false, + "positionAbsolute": { + "x": 605.2524720624972, + "y": 528.9324507458141 + }, + "dragging": true + }, + { + "width": 99, + "height": 115, + "id": "MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5", + "type": "ARITHMETIC", + "data": { + "id": "MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5", + "label": "MULTIPLY_1", + "func": "MULTIPLY", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "multiply_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 1001.3666580554675, + "y": 399.4635467763226 + }, + "selected": false, + "positionAbsolute": { + "x": 1001.3666580554675, + "y": 399.4635467763226 + }, + "dragging": true + }, + { + "width": 190, + "height": 115, + "id": "END-955fcf8e-cfc5-4600-a481-0e1bd57865bd", + "type": "TERMINATOR", + "data": { + "id": "END-955fcf8e-cfc5-4600-a481-0e1bd57865bd", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 1286.975369507194, + "y": 404.72786372323105 + }, + "selected": true, + "positionAbsolute": { + "x": 1286.975369507194, + "y": 404.72786372323105 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-583eb3a1-cb88-4306-bb27-4ecae9f2da39", + "sourceHandle": "main", + "target": "MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8b", + "targetHandle": "MULTIPLY", + "id": "reactflow__edge-LINSPACE-583eb3a1-cb88-4306-bb27-4ecae9f2da39main-MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8bMULTIPLY" + }, + { + "source": "LINSPACE-918dfb3c-460b-4dea-a00f-6262c3a6f53f", + "sourceHandle": "main", + "target": "MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8b", + "targetHandle": "multiply_y", + "id": "reactflow__edge-LINSPACE-918dfb3c-460b-4dea-a00f-6262c3a6f53fmain-MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8bmultiply_y" + }, + { + "source": "MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8b", + "sourceHandle": "main", + "target": "MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5", + "targetHandle": "MULTIPLY", + "id": "reactflow__edge-MULTIPLY-1c80186a-9cf4-4b82-a91b-62866fe0ef8bmain-MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5MULTIPLY" + }, + { + "source": "LINSPACE-506fd9f4-2691-4657-a520-51c3cb917c47", + "sourceHandle": "main", + "target": "MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5", + "targetHandle": "multiply_y", + "id": "reactflow__edge-LINSPACE-506fd9f4-2691-4657-a520-51c3cb917c47main-MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5multiply_y" + }, + { + "source": "MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5", + "sourceHandle": "main", + "target": "END-955fcf8e-cfc5-4600-a481-0e1bd57865bd", + "targetHandle": "END", + "id": "reactflow__edge-MULTIPLY-8ba5fe03-206b-4c94-9fd3-0b6ae64809e5main-END-955fcf8e-cfc5-4600-a481-0e1bd57865bdEND" + } + ], + "viewport": { + "x": 297.0103541869116, + "y": 78.79668599001445, + "zoom": 0.9007137352142879 + } + }, + "ctrlsManifest": [] +} diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/example.md new file mode 100644 index 000000000..fa4981418 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, two `LINSPACE` generates two linear arrays: one from 10 to 0 and another from 0 to 10. We `MULTIPLY` these two arrays elementwise, and observe a quadratic function. + +When we `MULTIPLY` this quadratic function everywhere by 0, we observe 0, as expected! \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/MULTIPLY/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/SUBTRACT.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/SUBTRACT.md new file mode 100644 index 000000000..f14387ccc --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/SUBTRACT.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..bc3d3b552 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Subtract 2 input vectors and return the result \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..bed6f7958 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def SUBTRACT(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + if len(dc_inputs) < 2: + raise ValueError( + f"To substract the values, SUBSTRACT node requires two inputs, {len(dc_inputs)} was given!" + ) + a = dc_inputs[0].y + b = dc_inputs[1].y + + x = dc_inputs[0].x + y = np.subtract(a, b) + + return DataContainer(x=x, y=y) diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/app.txt new file mode 100644 index 000000000..0f8e5f7ff --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/app.txt @@ -0,0 +1,188 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 190, + "height": 115, + "id": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "type": "TERMINATOR", + "data": { + "id": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 1481.1276538172046, + "y": 301.7443219065692 + }, + "selected": true, + "positionAbsolute": { + "x": 1481.1276538172046, + "y": 301.7443219065692 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "LINSPACE-b70dcbec-87fc-47bd-98dc-26c01de91881", + "type": "default", + "data": { + "id": "LINSPACE-b70dcbec-87fc-47bd-98dc-26c01de91881", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "10" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1000" + } + }, + "selected": false + }, + "position": { + "x": 335.60460405758, + "y": 414.5947652926823 + }, + "selected": false, + "positionAbsolute": { + "x": 335.60460405758, + "y": 414.5947652926823 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "LINSPACE-0c193475-a070-4357-b9f6-1cc8320c8a65", + "type": "default", + "data": { + "id": "LINSPACE-0c193475-a070-4357-b9f6-1cc8320c8a65", + "label": "LINSPACE_1", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "10" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "0" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "1000" + } + }, + "selected": false + }, + "position": { + "x": 337.2242660007536, + "y": 164.02507602827643 + }, + "selected": false, + "positionAbsolute": { + "x": 337.2242660007536, + "y": 164.02507602827643 + }, + "dragging": true + }, + { + "width": 99, + "height": 115, + "id": "SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0", + "type": "ARITHMETIC", + "data": { + "id": "SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0", + "label": "SUBTRACT", + "func": "SUBTRACT", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "sub_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 984.775645730269, + "y": 300.51837909623805 + }, + "selected": false, + "positionAbsolute": { + "x": 984.775645730269, + "y": 300.51837909623805 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0", + "sourceHandle": "main", + "target": "END-06a4da40-a0ae-44ad-873b-9b65d096880a", + "targetHandle": "END", + "id": "reactflow__edge-SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0main-END-06a4da40-a0ae-44ad-873b-9b65d096880aEND" + }, + { + "source": "LINSPACE-0c193475-a070-4357-b9f6-1cc8320c8a65", + "sourceHandle": "main", + "target": "SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0", + "targetHandle": "SUBTRACT", + "id": "reactflow__edge-LINSPACE-0c193475-a070-4357-b9f6-1cc8320c8a65main-SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0SUBTRACT" + }, + { + "source": "LINSPACE-b70dcbec-87fc-47bd-98dc-26c01de91881", + "sourceHandle": "main", + "target": "SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0", + "targetHandle": "sub_y", + "id": "reactflow__edge-LINSPACE-b70dcbec-87fc-47bd-98dc-26c01de91881main-SUBTRACT-be7bf775-eca1-4008-9d78-7164cf815da0sub_y" + } + ], + "viewport": { + "x": 296.7009684013002, + "y": 78.64846027544155, + "zoom": 0.8997754917401063 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/example.md new file mode 100644 index 000000000..3589dec9a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, we `SUBTRACT` the outputs of two identical `LINSPACE` nodes. + +As expected, when we check the output of the app, we see 0 everywhere, as expected! \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/ARITHMETIC/SUBTRACT/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/EDGE_DETECTION.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/EDGE_DETECTION.md new file mode 100644 index 000000000..d0d108c6d --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/EDGE_DETECTION.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..5132992b4 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ +The EDGE_DETECTION node detects edges in the image passed to it. + This is done through the the Pillow image filter FIND_EDGES. + Note that the image is converted to greyscale during this processing. + + Parameters + ---------- + None + + Returns + ------- + image + The image with detected edges in white. diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..3dd9b66a7 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/a1-[autogen]/python_code.txt @@ -0,0 +1,47 @@ +from flojoy import flojoy, DataContainer +import cv2 +import numpy as np +from PIL import ImageFilter, Image + + +@flojoy +def EDGE_DETECTION(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input = dc_inputs[0] + if dc_input.type != "image": + raise ValueError( + f"unsupported DataContainer type passed to EDGE_DETECTION node: '{dc_input.type}'" + ) + r = dc_input.r + g = dc_input.g + b = dc_input.b + a = dc_input.a + + if a is not None: + rgba_image = np.stack((r, g, b, a), axis=2) + + else: + rgba_image = np.stack((r, g, b), axis=2) + + try: + image = Image.fromarray(rgba_image) + image = image.convert("L") + image = image.filter(ImageFilter.FIND_EDGES) + image = image.convert("RGB") + image = np.array(image) + + try: + r, g, b, a = cv2.split(image) + except: + r, g, b = cv2.split(image) + if a is None: + a = None + return DataContainer( + type="image", + r=r, + g=g, + b=b, + a=a, + ) + except Exception as e: + raise e diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/app.txt new file mode 100644 index 000000000..b27a518f8 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/app.txt @@ -0,0 +1,170 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "type": "TERMINATOR", + "data": { + "id": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1007.1969851172043, + "y": 184.52843456112544 + }, + "selected": false, + "positionAbsolute": { + "x": 1007.1969851172043, + "y": 184.52843456112544 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "type": "LOCAL_FILE_SYSTEM", + "data": { + "id": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "label": "LOCAL FILE", + "func": "LOCAL_FILE", + "type": "LOCAL_FILE_SYSTEM", + "ctrls": { + "file_type": { + "functionName": "LOCAL_FILE", + "param": "file_type", + "value": "image" + }, + "path": { + "functionName": "LOCAL_FILE", + "param": "path", + "value": "" + } + }, + "selected": false + }, + "position": { + "x": 202.04316645575113, + "y": 174.42317970418543 + }, + "selected": false, + "positionAbsolute": { + "x": 202.04316645575113, + "y": 174.42317970418543 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1f", + "type": "IMAGE_PROCESSING", + "data": { + "id": "EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1f", + "label": "EDGE DETECTION", + "func": "EDGE_DETECTION", + "type": "IMAGE_PROCESSING", + "ctrls": {}, + "pip_dependencies": [ + { + "name": "opencv-python-headless", + "v": "4.7.0.72" + }, + { + "name": "Pillow", + "v": "9.5.0" + } + ], + "selected": false + }, + "position": { + "x": 622.6676812585341, + "y": 173.99111377857844 + }, + "selected": false, + "positionAbsolute": { + "x": 622.6676812585341, + "y": 173.99111377857844 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9", + "sourceHandle": "main", + "target": "EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1f", + "targetHandle": "EDGE_DETECTION", + "id": "reactflow__edge-LOCAL_FILE-94057446-4687-4613-9170-0accb0759dd9main-EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1fEDGE_DETECTION" + }, + { + "source": "EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1f", + "sourceHandle": "main", + "target": "END-5e6d94ed-1f79-4c57-8b2f-753a22405f55", + "targetHandle": "END", + "id": "reactflow__edge-EDGE_DETECTION-fdb3c609-01e4-4fe3-a7dc-35d2b6f73d1fmain-END-5e6d94ed-1f79-4c57-8b2f-753a22405f55END" + } + ], + "viewport": { + "x": 383.94248946966945, + "y": 121.85910915060867, + "zoom": 1.1608238532718647 + } + }, + "ctrlsManifest": [ + { + "type": "output", + "name": "Plot", + "minWidth": 2, + "minHeight": 3, + "id": "ctrl-d81b57c0-dda4-4160-894c-8307b5df7ef7", + "hidden": false, + "param": "OBJECT_DETECTION-a9866d79-0bc0-45d7-a2a4-6825b7a012bd", + "val": 0, + "layout": { + "w": 4, + "h": 4, + "x": 2, + "y": 0, + "i": "ctrl-d81b57c0-dda4-4160-894c-8307b5df7ef7", + "minW": 2, + "minH": 3, + "moved": false, + "static": true + } + }, + { + "type": "input", + "name": "Text Input", + "minWidth": 1, + "minHeight": 1, + "id": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45", + "hidden": false, + "param": { + "id": "LOCAL_FILE_LOCALFILE_path", + "functionName": "LOCAL_FILE", + "param": "path", + "nodeId": "LOCAL_FILE-b6953411-4f5e-4f22-aaba-bdc923e56b86", + "inputId": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45" + }, + "val": 0, + "layout": { + "w": 2, + "h": 2, + "x": 0, + "y": 0, + "i": "ctrl-e813ad6f-6717-4242-b705-2ef72861fe45", + "minW": 1, + "minH": 1, + "moved": false, + "static": true + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/example.md new file mode 100644 index 000000000..3fed86f23 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/example.md @@ -0,0 +1 @@ +ITS AN EDGE DETECTION APP WHICH USES AN EDGE DETECTION FILTER NODE TO DETECT EDGES ON AN IMAGE. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/EDGE_DETECTION/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/IMAGE_SMOOTHING.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/IMAGE_SMOOTHING.md new file mode 100644 index 000000000..f62b175f5 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/IMAGE_SMOOTHING.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..45c338c31 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/docstring.txt @@ -0,0 +1,21 @@ + +Apply image smoothing operation on the input `DataContainer` class, +specifically for the 'image' type, +represented by the RGB(A) channels. + +Args: +dc_inputs (list[DataContainer]): List of DataContainer objects containing +image channels. +params (dict): Additional parameters for image smoothing. + +Params: +kernel: The strength of the smoothing. A large value will lead +to stronger smoothing. smoothing_type: The type of smoothing to use +(https://docs.opencv.org/4.x/d4/d13/tutorial_py_filtering.html). + +Returns: +DataContainer: A `DataContainer` class of type 'image' representing the +output image with image smoothing results. + +Raises: +Exception: If an error occurs during smoothing. diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..101a9e7a4 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/parameters.yaml @@ -0,0 +1,11 @@ +kernel: + default: 5 + type: int +smoothing_type: + default: average + options: + - average + - gaussian + - median + - bilateral + type: select diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..0100d9e81 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/a1-[autogen]/python_code.txt @@ -0,0 +1,48 @@ +from flojoy import flojoy, DataContainer +import cv2 +import numpy as np + + +@flojoy +def IMAGE_SMOOTHING(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input = dc_inputs[0] + if dc_input.type != "image": + raise ValueError(f"unsupported data IMAGE_SMOOTHING node: '{dc_input.type}'") + r = dc_input.r + g = dc_input.g + b = dc_input.b + a = dc_input.a + kernel = params.get("kernel", 5) + smoothing_type = params.get("smoothing_type", "average") + + if a is not None: + rgba_image = np.stack((r, g, b, a), axis=2) + else: + rgba_image = np.stack((r, g, b), axis=2) + + try: + match smoothing_type: + case "average": + image = cv2.blur(rgba_image, (kernel, kernel)) + case "gaussian": + image = cv2.GaussianBlur(rgba_image, (kernel, kernel), 0) + case "median": + image = cv2.medianBlur(rgba_image, kernel) + case "bilateral": + image = cv2.bilateralFilter(rgba_image, kernel, kernel * 5, kernel * 5) + try: + r, g, b, a = cv2.split(image) + except: + r, g, b = cv2.split(image) + if a is None: + a = None + return DataContainer( + type="image", + r=r, + g=g, + b=b, + a=a, + ) + except Exception as e: + raise e diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/INVERT.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/INVERT.md new file mode 100644 index 000000000..b82346b5b --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/INVERT.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..61fd93ca2 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/docstring.txt @@ -0,0 +1,4 @@ +Takes 2 inputs, one matrix and one rcond if not square matrix. + Inverts them (or pseudo invert) and returns the result. + If the entered value is a scalar it returns the multiplciative + inverse 1/x \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..3e81ccc42 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +rcond: + default: 1.0 + type: float diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..30046b9a2 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/a1-[autogen]/python_code.txt @@ -0,0 +1,36 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def INVERT(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + print(f"INVERT params: {params}") + a = np.eye(3) + b: float = params["rcond"] + + if dc_inputs.__len__ > 0: + if ( + dc_inputs[0].type == "ordered_pair" + ): # v[0] is a DataContainer object with type attribute + print("Performing simple inversion") + a = dc_inputs[0].y # scalar valued + return DataContainer(x=a, y=1 / a) + elif dc_inputs[0].type == "matrix": + a = dc_inputs[0].m + if not a.shape[0] == a.shape[1]: + print("Not square matrix! Using pseudoinversion...") + assert ( + type(b) == float + ), "Need scalar value to compare SVDs for pseudoinversion" + retval = np.linalg.pinv(a, rcond=b, hermitian=False) + else: + try: + retval = np.linalg.inv(a) + except np.linalg.LinAlgError: + raise ValueError("Inversion failed! Singular matrix returned...") + return DataContainer(type="matrix", m=retval) + else: + raise ValueError("Incorrect input DataContainer type.") + else: + return DataContainer(type="matrix", m=np.eye(3)) diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/INVERT/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/MATMUL.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/MATMUL.md new file mode 100644 index 000000000..b1d2a1db1 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/MATMUL.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..3a4fe4eb4 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Takes 2 input matrices, multiplies them, and returns the result \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..3b7b45c08 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/a1-[autogen]/python_code.txt @@ -0,0 +1,13 @@ +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def MATMUL(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + a: np.ndarray = np.eye(3) + b: np.ndarray = np.eye(3) + if len(dc_inputs) == 2: + a = dc_inputs[0].y + b = dc_inputs[1]["y"] + return DataContainer(type="matrix", m=np.matmul(a, b)) diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/MATRIX_MANIPULATION/MATMUL/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/SELECT_ARRAY.md b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/SELECT_ARRAY.md new file mode 100644 index 000000000..7c35cbab9 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/SELECT_ARRAY.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..37a98962c --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/docstring.txt @@ -0,0 +1,9 @@ + +Node to convert an input array with multiple columns +to the selected ordered pair. + +For example, the SERIAL node can output x=time, +y1=temperature, y2=pressure. +This node will select one of temperature and pressure columns to output. + +The x axis will be return unchanged. diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..11e64450a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/parameters.yaml @@ -0,0 +1,3 @@ +column: + default: 0 + type: int diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..d316e99a7 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/a1-[autogen]/python_code.txt @@ -0,0 +1,20 @@ +from flojoy import flojoy, DataContainer +import numpy as np + + +@flojoy +def SELECT_ARRAY(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + print("parameters passed to SELECT_ARRAY: ", params) + # Index of the selected column. + COL: int = params.get("column", 0) + + # Check for numpy type. Return unchanged data if not. + if isinstance(dc_inputs[0].y, np.ndarray): + x: np.ndarray = dc_inputs[0].x + y: np.ndarray = dc_inputs[0].y[:, int(COL)] + + return DataContainer(x=x, y=y) + + else: + return dc_inputs[0] diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/SELECT_ARRAY/SELECT_ARRAY/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/BUTTER.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/BUTTER.md new file mode 100644 index 000000000..c298ebdf8 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/BUTTER.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..c0510369d --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Apply a butterworth filter to an input vector \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..bec4ed19b --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/a1-[autogen]/python_code.txt @@ -0,0 +1,17 @@ +from scipy import signal +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def BUTTER(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + print("Butterworth inputs:", dc_inputs) + + sig = dc_inputs[0].y + + sos = signal.butter(10, 15, "hp", fs=1000, output="sos") + filtered = signal.sosfilt(sos, sig) + + return DataContainer(x=sig, y=filtered) diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/app.txt new file mode 100644 index 000000000..6700eebc3 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/app.txt @@ -0,0 +1,324 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626", + "type": "default", + "data": { + "id": "LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": 10 + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": 0 + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": 1000 + } + }, + "selected": false + }, + "position": { + "x": -144.22958297787403, + "y": 234.29120307418458 + }, + "selected": false, + "positionAbsolute": { + "x": -144.22958297787403, + "y": 234.29120307418458 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4", + "type": "SIMULATION", + "data": { + "id": "SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4", + "label": "SINE", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": "69" + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 1 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 0 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 208.62755987926886, + "y": 62.86263164561308 + }, + "selected": false, + "positionAbsolute": { + "x": 208.62755987926886, + "y": 62.86263164561308 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-354ea790-a168-4de5-926e-8aced107d349", + "type": "SIMULATION", + "data": { + "id": "SINE-354ea790-a168-4de5-926e-8aced107d349", + "label": "SINE 1", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": "59" + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 1 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 0 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 202.91327416498314, + "y": 395.71977450275585 + }, + "selected": false, + "positionAbsolute": { + "x": 202.91327416498314, + "y": 395.71977450275585 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-532cc637-34de-44f7-b1e8-d1483795aa16", + "type": "ARITHMETIC", + "data": { + "id": "ADD-532cc637-34de-44f7-b1e8-d1483795aa16", + "label": "ADD", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 428.62755987926886, + "y": 245.71977450275585 + }, + "selected": false, + "positionAbsolute": { + "x": 428.62755987926886, + "y": 245.71977450275585 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9", + "type": "SIGNAL_PROCESSING", + "data": { + "id": "BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9", + "label": "BUTTER", + "func": "BUTTER", + "type": "SIGNAL_PROCESSING", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 664.3418455935546, + "y": 230.0054887884702 + }, + "selected": false, + "positionAbsolute": { + "x": 664.3418455935546, + "y": 230.0054887884702 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-f3ad568f-959a-4517-81e3-48ce7da460c9", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-f3ad568f-959a-4517-81e3-48ce7da460c9", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 952.9132741649831, + "y": 184.29120307418452 + }, + "selected": false, + "positionAbsolute": { + "x": 952.9132741649831, + "y": 184.29120307418452 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-bfcecfae-944d-4189-86f1-db1b41aeed2a", + "type": "TERMINATOR", + "data": { + "id": "END-bfcecfae-944d-4189-86f1-db1b41aeed2a", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 1375.7704170221261, + "y": 248.57691735989874 + }, + "selected": true, + "positionAbsolute": { + "x": 1375.7704170221261, + "y": 248.57691735989874 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626", + "sourceHandle": "main", + "target": "SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626main-SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4SINE" + }, + { + "source": "LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626", + "sourceHandle": "main", + "target": "SINE-354ea790-a168-4de5-926e-8aced107d349", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-c9dc355d-a512-4007-8859-6648f53e2626main-SINE-354ea790-a168-4de5-926e-8aced107d349SINE" + }, + { + "source": "SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4", + "sourceHandle": "main", + "target": "ADD-532cc637-34de-44f7-b1e8-d1483795aa16", + "targetHandle": "ADD", + "id": "reactflow__edge-SINE-e19605b9-62e1-4df0-8868-031a5d6f11d4main-ADD-532cc637-34de-44f7-b1e8-d1483795aa16ADD" + }, + { + "source": "SINE-354ea790-a168-4de5-926e-8aced107d349", + "sourceHandle": "main", + "target": "ADD-532cc637-34de-44f7-b1e8-d1483795aa16", + "targetHandle": "add_y", + "id": "reactflow__edge-SINE-354ea790-a168-4de5-926e-8aced107d349main-ADD-532cc637-34de-44f7-b1e8-d1483795aa16add_y" + }, + { + "source": "ADD-532cc637-34de-44f7-b1e8-d1483795aa16", + "sourceHandle": "main", + "target": "BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9", + "targetHandle": "BUTTER", + "id": "reactflow__edge-ADD-532cc637-34de-44f7-b1e8-d1483795aa16main-BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9BUTTER" + }, + { + "source": "BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9", + "sourceHandle": "main", + "target": "LINE-f3ad568f-959a-4517-81e3-48ce7da460c9", + "targetHandle": "LINE", + "id": "reactflow__edge-BUTTER-21ebcdfd-054c-4121-b85a-8aa0658404e9main-LINE-f3ad568f-959a-4517-81e3-48ce7da460c9LINE" + }, + { + "source": "LINE-f3ad568f-959a-4517-81e3-48ce7da460c9", + "sourceHandle": "main", + "target": "END-bfcecfae-944d-4189-86f1-db1b41aeed2a", + "targetHandle": "END", + "id": "reactflow__edge-LINE-f3ad568f-959a-4517-81e3-48ce7da460c9main-END-bfcecfae-944d-4189-86f1-db1b41aeed2aEND" + } + ], + "viewport": { + "x": 178.95788989770995, + "y": 69.74260865081652, + "zoom": 0.7756174461376771 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/example.md new file mode 100644 index 000000000..053fd6d2a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/example.md @@ -0,0 +1 @@ +THIS EXAMPLE BUTTERS THE NOISY SIGNALS & SMOOTHENS IT. diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/BUTTER/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/FIR.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/FIR.md new file mode 100644 index 000000000..563f20c02 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/FIR.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..b701307f7 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/docstring.txt @@ -0,0 +1,5 @@ +Apply a low-pass FIR filter to an input vector. This + filter takes a few inputs: the sample_rate (will be passed as a parameter + if the target node is not connected), the desired width of the + transition to the stop band and the corresponding attentuation, and + lastly the cutoff frequency. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..3829ad932 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/parameters.yaml @@ -0,0 +1,12 @@ +cutoff_freq: + default: 10.0 + type: float +sample_rate: + default: 100 + type: float +stop_band_attenuation: + default: 60 + type: float +transition_width: + default: 5.0 + type: float diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..984f9ff3c --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/a1-[autogen]/python_code.txt @@ -0,0 +1,58 @@ +from scipy import signal +from flojoy import flojoy, DataContainer +import numpy as np + + +@flojoy +def FIR(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + sample_rate: float = params["sample_rate"] # Hz + transition_width: float = params["transition_width"] # Hz + stop_band_attenuation: float = params["stop_band_attenuation"] # dB + cutoff_freq: float = params["cutoff_freq"] # Hz + print( + f"FIR params: {[sample_rate,transition_width,stop_band_attenuation,cutoff_freq]}" + ) + + try: + times = dc_inputs[1].y # v[0].x['i'] + x = dc_inputs[0].y # this is the value of the signal + except IndexError: # nothing input + # lets create some default behaviour for testing + nsamples: int = 400 + times = np.arange(nsamples) / sample_rate + test_x = ( + np.cos(2 * np.pi * 0.5 * times) + + 0.2 * np.sin(2 * np.pi * 2.5 * times + 0.1) + + 0.2 * np.sin(2 * np.pi * 15.3 * times) + + 0.1 * np.sin(2 * np.pi * 16.7 * times + 0.1) + + 0.1 * np.sin(2 * np.pi * 23.45 * times + 0.8) + ) + x = test_x + + # first we need to define the nyquist rate ... + nyq_rate: float = sample_rate / 2.0 + # ... then the transition width relative to this + transition_width: float = transition_width / nyq_rate + + # Now compute order and Kaiser param for the fitler + N, beta = signal.kaiserord(stop_band_attenuation, transition_width) + + # Now we create the filter with the Kaiser window ... + taps = signal.firwin(N, cutoff_freq / nyq_rate, window=("kaiser", beta)) + + # ... and then apply it to the signal + filtered_x = signal.lfilter(taps, 1.0, x) + + # Now, there are two considerations to be had. Firstly, + # there is a phase delay in the signal since we have applied finite + # taps ... + phase_delay: float = 0.5 * (N - 1) / sample_rate + # ... and furthermore, the first N-1 samples are 'corrupted' in + # the sense that the filter 'sacrifies' them by the imposition + # of the initial conditions. + times = times[N - 1 :] - phase_delay + filtered_x = filtered_x[N - 1 :] + + return DataContainer(x=times, y=filtered_x) diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/app.txt new file mode 100644 index 000000000..0f55892bf --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/app.txt @@ -0,0 +1,671 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "type": "default", + "data": { + "id": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "label": "TIMES", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": "0" + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": "3.99" + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": "400" + } + }, + "selected": false + }, + "position": { + "x": -381.6597627878457, + "y": 328.0017998240539 + }, + "selected": false, + "positionAbsolute": { + "x": -381.6597627878457, + "y": 328.0017998240539 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272", + "type": "SIMULATION", + "data": { + "id": "SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272", + "label": "INPUT", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": 28.648 + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 1 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 90 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 64.27115088504331, + "y": -57.56531344427435 + }, + "selected": false, + "positionAbsolute": { + "x": 64.27115088504331, + "y": -57.56531344427435 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272", + "type": "SIMULATION", + "data": { + "id": "SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272", + "label": "OSC_1", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": 143.243 + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 0.2 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 5.729 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 63.24622920222373, + "y": 129.88565546683003 + }, + "selected": false, + "positionAbsolute": { + "x": 63.24622920222373, + "y": 129.88565546683003 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-c6f501c7-e17a-4657-bc30-bb79da43b0da", + "type": "ARITHMETIC", + "data": { + "id": "ADD-c6f501c7-e17a-4657-bc30-bb79da43b0da", + "label": "add1", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 390.534078604333, + "y": 22.83876337321726 + }, + "selected": false, + "positionAbsolute": { + "x": 390.534078604333, + "y": 22.83876337321726 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1e", + "type": "SIMULATION", + "data": { + "id": "SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1e", + "label": "OSC_2", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": 876.6288 + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 0.2 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 0 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 70.1763309072428, + "y": 313.64865448430766 + }, + "selected": false, + "positionAbsolute": { + "x": 70.1763309072428, + "y": 313.64865448430766 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fb", + "type": "ARITHMETIC", + "data": { + "id": "ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fb", + "label": "add2", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 576.8582694182483, + "y": 117.30321775737411 + }, + "selected": false, + "positionAbsolute": { + "x": 576.8582694182483, + "y": 117.30321775737411 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-0ff677e5-4bb0-418d-b521-257f960f4d61", + "type": "SIMULATION", + "data": { + "id": "SINE-0ff677e5-4bb0-418d-b521-257f960f4d61", + "label": "OSC_3", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": 956.8432 + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 0.1 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 5.729 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 84.69156347834837, + "y": 490.80983265848033 + }, + "selected": false, + "positionAbsolute": { + "x": 84.69156347834837, + "y": 490.80983265848033 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-13294349-3310-478c-8b98-0a5f586b339a", + "type": "ARITHMETIC", + "data": { + "id": "ADD-13294349-3310-478c-8b98-0a5f586b339a", + "label": "add3", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 778.3572136034272, + "y": 260.41340918829394 + }, + "selected": false, + "positionAbsolute": { + "x": 778.3572136034272, + "y": 260.41340918829394 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SINE-87b52624-11b8-479a-8177-543f4fb2d3ae", + "type": "SIMULATION", + "data": { + "id": "SINE-87b52624-11b8-479a-8177-543f4fb2d3ae", + "label": "OSC_4", + "func": "SINE", + "type": "SIMULATION", + "ctrls": { + "frequency": { + "functionName": "SINE", + "param": "frequency", + "value": 1343.5912 + }, + "offset": { + "functionName": "SINE", + "param": "offset", + "value": 0 + }, + "amplitude": { + "functionName": "SINE", + "param": "amplitude", + "value": 0.1 + }, + "phase": { + "functionName": "SINE", + "param": "phase", + "value": 45.83 + }, + "waveform": { + "functionName": "SINE", + "param": "waveform", + "value": "sine" + } + }, + "selected": false + }, + "position": { + "x": 72.12544117631614, + "y": 683.9513367080441 + }, + "selected": false, + "positionAbsolute": { + "x": 72.12544117631614, + "y": 683.9513367080441 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "type": "ARITHMETIC", + "data": { + "id": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "label": "add4", + "func": "ADD", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "add_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 994.6655018180179, + "y": 419.7484445233009 + }, + "selected": false, + "positionAbsolute": { + "x": 994.6655018180179, + "y": 419.7484445233009 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2", + "type": "SIGNAL_PROCESSING", + "data": { + "id": "FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2", + "label": "FIR", + "func": "FIR", + "type": "SIGNAL_PROCESSING", + "ctrls": { + "sample_rate": { + "functionName": "FIR", + "param": "sample_rate", + "value": 100 + }, + "transition_width": { + "functionName": "FIR", + "param": "transition_width", + "value": 5 + }, + "stop_band_attenuation": { + "functionName": "FIR", + "param": "stop_band_attenuation", + "value": 60 + }, + "cutoff_freq": { + "functionName": "FIR", + "param": "cutoff_freq", + "value": 10 + } + }, + "selected": false + }, + "position": { + "x": 1184.153657004567, + "y": 533.8337171975915 + }, + "selected": false, + "positionAbsolute": { + "x": 1184.153657004567, + "y": 533.8337171975915 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-a1ca5e46-b598-414a-bbe8-e74512cb32f8", + "type": "TERMINATOR", + "data": { + "id": "END-a1ca5e46-b598-414a-bbe8-e74512cb32f8", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1951.970128726804, + "y": 493.73691549580417 + }, + "selected": false, + "positionAbsolute": { + "x": 1951.970128726804, + "y": 493.73691549580417 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-3dbd9cc9-cb99-4569-9255-5fd896702506", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-3dbd9cc9-cb99-4569-9255-5fd896702506", + "label": "LINE 1", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1150.2828137929405, + "y": 17.245987812730846 + }, + "selected": false, + "positionAbsolute": { + "x": 1150.2828137929405, + "y": 17.245987812730846 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7a", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7a", + "label": "LINE 1", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1457.4874893685353, + "y": 435.47080757694937 + }, + "selected": false, + "positionAbsolute": { + "x": 1457.4874893685353, + "y": 435.47080757694937 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272SINE" + }, + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272SINE" + }, + { + "source": "SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272", + "sourceHandle": "main", + "target": "ADD-c6f501c7-e17a-4657-bc30-bb79da43b0da", + "targetHandle": "ADD", + "id": "reactflow__edge-SINE-dc70c4b5-9116-4bdd-988c-9e3726ebf272main-ADD-c6f501c7-e17a-4657-bc30-bb79da43b0daADD" + }, + { + "source": "SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272", + "sourceHandle": "main", + "target": "ADD-c6f501c7-e17a-4657-bc30-bb79da43b0da", + "targetHandle": "add_y", + "id": "reactflow__edge-SINE-dad2f58e-9dfc-4ec2-add4-2988f67cd272main-ADD-c6f501c7-e17a-4657-bc30-bb79da43b0daadd_y" + }, + { + "source": "ADD-c6f501c7-e17a-4657-bc30-bb79da43b0da", + "sourceHandle": "main", + "target": "ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fb", + "targetHandle": "ADD", + "id": "reactflow__edge-ADD-c6f501c7-e17a-4657-bc30-bb79da43b0damain-ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fbADD" + }, + { + "source": "SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1e", + "sourceHandle": "main", + "target": "ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fb", + "targetHandle": "add_y", + "id": "reactflow__edge-SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1emain-ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fbadd_y" + }, + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1e", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-SINE-eb0dce31-56d6-4327-8c8e-3ac251e9ea1eSINE" + }, + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "SINE-0ff677e5-4bb0-418d-b521-257f960f4d61", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-SINE-0ff677e5-4bb0-418d-b521-257f960f4d61SINE" + }, + { + "source": "SINE-0ff677e5-4bb0-418d-b521-257f960f4d61", + "sourceHandle": "main", + "target": "ADD-13294349-3310-478c-8b98-0a5f586b339a", + "targetHandle": "add_y", + "id": "reactflow__edge-SINE-0ff677e5-4bb0-418d-b521-257f960f4d61main-ADD-13294349-3310-478c-8b98-0a5f586b339aadd_y" + }, + { + "source": "ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fb", + "sourceHandle": "main", + "target": "ADD-13294349-3310-478c-8b98-0a5f586b339a", + "targetHandle": "ADD", + "id": "reactflow__edge-ADD-897ef5a2-e7b7-44b4-bedb-147c880e83fbmain-ADD-13294349-3310-478c-8b98-0a5f586b339aADD" + }, + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "SINE-87b52624-11b8-479a-8177-543f4fb2d3ae", + "targetHandle": "SINE", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-SINE-87b52624-11b8-479a-8177-543f4fb2d3aeSINE" + }, + { + "source": "SINE-87b52624-11b8-479a-8177-543f4fb2d3ae", + "sourceHandle": "main", + "target": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "targetHandle": "add_y", + "id": "reactflow__edge-SINE-87b52624-11b8-479a-8177-543f4fb2d3aemain-ADD-9334e8e4-7d3d-4179-829d-44e07a9c249eadd_y" + }, + { + "source": "ADD-13294349-3310-478c-8b98-0a5f586b339a", + "sourceHandle": "main", + "target": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "targetHandle": "ADD", + "id": "reactflow__edge-ADD-13294349-3310-478c-8b98-0a5f586b339amain-ADD-9334e8e4-7d3d-4179-829d-44e07a9c249eADD" + }, + { + "source": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "sourceHandle": "main", + "target": "FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2", + "targetHandle": "FIR", + "id": "reactflow__edge-ADD-9334e8e4-7d3d-4179-829d-44e07a9c249emain-FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2FIR" + }, + { + "source": "LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5", + "sourceHandle": "main", + "target": "FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2", + "targetHandle": "FIR", + "id": "reactflow__edge-LINSPACE-ff2d20b1-d9bd-481c-a245-a8135fd82df5main-FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2FIR" + }, + { + "source": "ADD-9334e8e4-7d3d-4179-829d-44e07a9c249e", + "sourceHandle": "main", + "target": "LINE-3dbd9cc9-cb99-4569-9255-5fd896702506", + "targetHandle": "LINE", + "id": "reactflow__edge-ADD-9334e8e4-7d3d-4179-829d-44e07a9c249emain-LINE-3dbd9cc9-cb99-4569-9255-5fd896702506LINE" + }, + { + "source": "FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2", + "sourceHandle": "main", + "target": "LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7a", + "targetHandle": "LINE", + "id": "reactflow__edge-FIR-cfd328d3-f109-4745-9936-a5d7271c4ba2main-LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7aLINE" + }, + { + "source": "LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7a", + "sourceHandle": "main", + "target": "END-a1ca5e46-b598-414a-bbe8-e74512cb32f8", + "targetHandle": "END", + "id": "reactflow__edge-LINE-456cc5d9-9ed7-4af8-b8c4-d0dace558f7amain-END-a1ca5e46-b598-414a-bbe8-e74512cb32f8END" + } + ], + "viewport": { + "x": -8.106587687712704, + "y": 67.40349418405756, + "zoom": 0.5 + } + }, + "ctrlsManifest": [] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/example.md new file mode 100644 index 000000000..eb1271621 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/example.md @@ -0,0 +1 @@ +### THIS EXAMPLES DEMONSTRATES THE USAGE OF FIR FILTER IN OUR PLATFORM. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/FIR/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/PID.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/PID.md new file mode 100644 index 000000000..85cc6eff8 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/PID.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..410664d62 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/parameters.yaml @@ -0,0 +1,9 @@ +Kd: + default: 356.25 + type: float +Ki: + default: 0.0143 + type: float +Kp: + default: 5 + type: float diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..f70cc6065 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/a1-[autogen]/python_code.txt @@ -0,0 +1,58 @@ +import numpy as np +from flojoy import flojoy, DataContainer +from node_sdk.small_memory import SmallMemory + +memory_key = "pid-info" + + +@flojoy +def PID(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + # First let's get the parameters that won't change + Kp: float = params["Kp"] + Ki: float = params["Ki"] + Kd: float = params["Kd"] + node_id = params.get("node_id", 0) + # Now we need some memory! We need to keep track of the running + # integral value of the inputs (regulation errors), as well as + # the previous 3 values of the regulation error + data = SmallMemory().read_memory(node_id, memory_key) + if data is None: + initialize = True + elif type(data) == np.ndarray: + initialize = False + else: + raise TypeError("Issue reading memory from REDIS.") + integral: int = 0 if initialize else data[0] + regulation_error_primes = np.zeros((3, 1)) if initialize else data[1:] + print(f"Recovered data: {data}") + + regulation_error = dc_inputs[0].y[ + -1 + ] # constant node makes long list of items; just need the value so take last element + integral: float = integral + 0.5 * Ki * ( + regulation_error + regulation_error_primes[0] + ) + output_signal = ( + Kp * regulation_error + + integral + + 0.1667 + * Kd + * ( + regulation_error + - regulation_error_primes[2] + + 3.0 * (regulation_error_primes[0] - regulation_error_primes[1]) + ) + ) + regulation_error_primes[2]: float = regulation_error_primes[1] + regulation_error_primes[1]: float = regulation_error_primes[0] + regulation_error_primes[0]: float = regulation_error + + # Now write to memory ... + SmallMemory().write_to_memory( + node_id, memory_key, np.append(integral, regulation_error_primes) + ) + print(regulation_error, output_signal) + # ... and return the result + return DataContainer( + x=dc_inputs[0].y, y=np.ones_like(dc_inputs[0].y) * output_signal + ) diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/app.txt new file mode 100644 index 000000000..85f460836 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/app.txt @@ -0,0 +1,591 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 181, + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "type": "default", + "position": { + "x": -171.59652727116486, + "y": 229.6957193114413 + }, + "data": { + "id": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "label": "loop", + "func": "LOOP", + "type": "LOOP", + "ctrls": { + "num_loops": { + "functionName": "LOOP", + "param": "num_loops", + "value": "10" + } + }, + "inputs": [ + { + "name": "end", + "id": "end", + "type": "source" + }, + { + "name": "body", + "id": "body", + "type": "source" + } + ], + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": -171.59652727116486, + "y": 229.6957193114413 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "type": "SIMULATION", + "data": { + "id": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "label": "100", + "func": "CONSTANT", + "type": "SIMULATION", + "ctrls": { + "constant": { + "functionName": "CONSTANT", + "param": "constant", + "value": "100" + } + }, + "selected": false + }, + "position": { + "x": 176.1954312538074, + "y": 295.8583973804091 + }, + "selected": false, + "positionAbsolute": { + "x": 176.1954312538074, + "y": 295.8583973804091 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "type": "LOOP", + "data": { + "id": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "label": "Goto Loop", + "func": "GOTO", + "type": "LOOP", + "ctrls": { + "goto_node_id": { + "functionName": "GOTO", + "param": "goto_node_id", + "value": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb" + } + }, + "selected": false + }, + "position": { + "x": 1297.3843753365986, + "y": 341.04162375361295 + }, + "selected": false, + "positionAbsolute": { + "x": 1297.3843753365986, + "y": 341.04162375361295 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "type": "TERMINATOR", + "data": { + "id": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "label": "Terminate", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 689.4496865508568, + "y": 14.796337017540452 + }, + "selected": false, + "positionAbsolute": { + "x": 689.4496865508568, + "y": 14.796337017540452 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "type": "SIMULATION", + "data": { + "id": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "label": "FeedBack", + "func": "FEEDBACK", + "type": "SIMULATION", + "ctrls": { + "referred_node": { + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002" + } + }, + "selected": false + }, + "position": { + "x": 174.37480933205342, + "y": 532.6931077253308 + }, + "selected": false, + "positionAbsolute": { + "x": 174.37480933205342, + "y": 532.6931077253308 + }, + "dragging": true + }, + { + "width": 99, + "height": 130, + "id": "SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366", + "type": "ARITHMETIC", + "data": { + "id": "SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366", + "label": "SUBTRACT", + "func": "SUBTRACT", + "type": "ARITHMETIC", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "sub_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 437.1089772579022, + "y": 377.38431117925427 + }, + "selected": false, + "positionAbsolute": { + "x": 437.1089772579022, + "y": 377.38431117925427 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "type": "SIGNAL_PROCESSING", + "data": { + "id": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "label": "PID", + "func": "PID", + "type": "SIGNAL_PROCESSING", + "ctrls": { + "Kp": { + "functionName": "PID", + "param": "Kp", + "value": "5" + }, + "Ki": { + "functionName": "PID", + "param": "Ki", + "value": "0.0143" + }, + "Kd": { + "functionName": "PID", + "param": "Kd", + "value": "356.25" + } + }, + "selected": false + }, + "position": { + "x": 720.4955352778562, + "y": 361.249986639496 + }, + "selected": false, + "positionAbsolute": { + "x": 720.4955352778562, + "y": 361.249986639496 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002", + "type": "SIMULATION", + "data": { + "id": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002", + "label": "SECOND ORDER SYSTEM", + "func": "SECOND_ORDER_SYSTEM", + "type": "SIMULATION", + "ctrls": { + "d1": { + "functionName": "SECOND_ORDER_SYSTEM", + "param": "d1", + "value": 250 + }, + "d2": { + "functionName": "SECOND_ORDER_SYSTEM", + "param": "d2", + "value": 100 + } + }, + "selected": false + }, + "position": { + "x": 1061.1220207817582, + "y": 350.06529515963183 + }, + "selected": false, + "positionAbsolute": { + "x": 1061.1220207817582, + "y": 350.06529515963183 + }, + "dragging": true + }, + { + "width": 130, + "height": 130, + "id": "FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69a", + "type": "SIMULATION", + "data": { + "id": "FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69a", + "label": "FEEDBACK 1", + "func": "FEEDBACK", + "type": "SIMULATION", + "ctrls": { + "referred_node": { + "functionName": "FEEDBACK", + "param": "referred_node", + "value": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002" + } + }, + "selected": false + }, + "position": { + "x": 109.69344935318688, + "y": 122.9224380167746 + }, + "selected": false, + "positionAbsolute": { + "x": 109.69344935318688, + "y": 122.9224380167746 + }, + "dragging": true + }, + { + "width": 225, + "height": 226, + "id": "LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 303.9791636389011, + "y": -19.934704840368227 + }, + "selected": false, + "positionAbsolute": { + "x": 303.9791636389011, + "y": -19.934704840368227 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "targetHandle": "CONSTANT", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138CONSTANT" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "body", + "target": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "targetHandle": "FEEDBACK", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbbody-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0FEEDBACK" + }, + { + "source": "SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366", + "sourceHandle": "main", + "target": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "targetHandle": "PID", + "id": "reactflow__edge-SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366main-PID-921107f4-1fd5-4321-aa19-19e290d0367ePID" + }, + { + "source": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "sourceHandle": "main", + "target": "SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366", + "targetHandle": "SUBTRACT", + "id": "reactflow__edge-CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138main-SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366SUBTRACT" + }, + { + "source": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "sourceHandle": "main", + "target": "SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366", + "targetHandle": "sub_y", + "id": "reactflow__edge-FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0main-SUBTRACT-60fe753c-16b2-4b8b-a9fd-e13a8c95e366sub_y" + }, + { + "source": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "sourceHandle": "end", + "target": "FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69a", + "targetHandle": "FEEDBACK", + "id": "reactflow__edge-LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fbend-FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69aFEEDBACK" + }, + { + "source": "FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69a", + "sourceHandle": "main", + "target": "LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7", + "targetHandle": "LINE", + "id": "reactflow__edge-FEEDBACK-f7a12f60-f7fc-4932-8505-9970a0b4b69amain-LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7LINE" + }, + { + "source": "LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7", + "sourceHandle": "main", + "target": "END-12d90ef2-4084-4532-94f2-dde2ba198b79", + "targetHandle": "END", + "id": "reactflow__edge-LINE-20ec3749-e3fe-446a-bf4b-4cf206f8a2f7main-END-12d90ef2-4084-4532-94f2-dde2ba198b79END" + }, + { + "source": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "sourceHandle": "main", + "target": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002", + "targetHandle": "SECOND_ORDER_SYSTEM", + "id": "reactflow__edge-PID-921107f4-1fd5-4321-aa19-19e290d0367emain-SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002SECOND_ORDER_SYSTEM" + }, + { + "source": "SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002", + "sourceHandle": "main", + "target": "GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263", + "targetHandle": "GOTO", + "id": "reactflow__edge-SECOND_ORDER_SYSTEM-6a9c6298-9d93-4181-8411-e47b3c96a002main-GOTO-d1e8f8ee-4907-4fd5-9d89-2f65351c2263GOTO" + } + ], + "viewport": { + "x": 197.88510420585555, + "y": 38.16888746940003, + "zoom": 0.7622193595343526 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Node Reference", + "minWidth": 2, + "minHeight": 2, + "id": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "hidden": false, + "param": { + "id": "FEEDBACK_FeedBack_referred_node", + "functionName": "FEEDBACK", + "param": "referred_node", + "nodeId": "FEEDBACK-bce3a2a9-20e8-4841-8404-1d91fcfac4f0", + "inputId": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "type": "node_reference" + }, + "val": "SECOND_ORDER_SYSTEM-74fd2877-0512-40be-a0bf-02729639b1e7", + "layout": { + "w": 2, + "h": 2, + "x": 2, + "y": 0, + "i": "ctrl-420defe9-c2d0-4eeb-bfa1-a512cb5cd599", + "minW": 2, + "minH": 2, + "moved": false, + "static": false + } + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-529e4229-e69f-4032-a209-b4ae7ca5c3a1", + "layout": { + "x": 0, + "y": 3, + "h": 2, + "w": 2, + "i": "ctrl-529e4229-e69f-4032-a209-b4ae7ca5c3a1", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "CONSTANT_100_constant", + "functionName": "CONSTANT", + "param": "constant", + "nodeId": "CONSTANT-ee40698d-60e6-4eb4-88b5-4d19e0c41138", + "inputId": "ctrl-529e4229-e69f-4032-a209-b4ae7ca5c3a1", + "type": "float" + }, + "val": 10 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-7626985d-bc23-4755-ac58-196cbbe3236c", + "layout": { + "x": 0, + "y": 4, + "h": 2, + "w": 2, + "i": "ctrl-7626985d-bc23-4755-ac58-196cbbe3236c", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "LOOP_loop_num_loops", + "functionName": "LOOP", + "param": "num_loops", + "nodeId": "LOOP-faed7bdc-f766-4742-b48f-d31a7b8083fb", + "inputId": "ctrl-7626985d-bc23-4755-ac58-196cbbe3236c", + "type": "int" + }, + "val": 1000 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-8b32440c-01a2-4cbf-b344-7e6ecbc7a470", + "layout": { + "x": 0, + "y": 3, + "h": 2, + "w": 2, + "i": "ctrl-8b32440c-01a2-4cbf-b344-7e6ecbc7a470", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "PID_PID_Kp", + "functionName": "PID", + "param": "Kp", + "nodeId": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "inputId": "ctrl-8b32440c-01a2-4cbf-b344-7e6ecbc7a470", + "type": "float" + }, + "val": 5 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-988fef72-8c94-4ca7-be77-ab3e0cf5b0bd", + "layout": { + "x": 0, + "y": 5, + "h": 2, + "w": 2, + "i": "ctrl-988fef72-8c94-4ca7-be77-ab3e0cf5b0bd", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "PID_PID_Ki", + "functionName": "PID", + "param": "Ki", + "nodeId": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "inputId": "ctrl-988fef72-8c94-4ca7-be77-ab3e0cf5b0bd", + "type": "float" + }, + "val": 1 + }, + { + "type": "input", + "name": "Numeric Input", + "minWidth": 1, + "minHeight": 1, + "hidden": false, + "id": "ctrl-80f1a791-0551-4811-9e0f-babc091711ae", + "layout": { + "x": 0, + "y": 6, + "h": 2, + "w": 2, + "i": "ctrl-80f1a791-0551-4811-9e0f-babc091711ae", + "minH": 1, + "minW": 1, + "static": false + }, + "param": { + "id": "PID_PID_Kd", + "functionName": "PID", + "param": "Kd", + "nodeId": "PID-921107f4-1fd5-4321-aa19-19e290d0367e", + "inputId": "ctrl-80f1a791-0551-4811-9e0f-babc091711ae", + "type": "float" + }, + "val": 356.25 + }, + { + "type": "input", + "name": "Dropdown", + "minWidth": 2, + "minHeight": 2, + "hidden": false, + "id": "ctrl-e8e5d93d-8c62-4e68-b76e-c777331237cc", + "layout": { + "x": 0, + "y": 9, + "h": 2, + "w": 2, + "i": "ctrl-e8e5d93d-8c62-4e68-b76e-c777331237cc", + "minH": 2, + "minW": 2, + "static": false + }, + "param": { + "id": "LINE_LINE_referred_node", + "functionName": "LINE", + "param": "referred_node", + "nodeId": "LINE-a0a85b4a-77d7-420d-bb4c-cd3488218c54", + "inputId": "ctrl-e8e5d93d-8c62-4e68-b76e-c777331237cc", + "type": "node_reference" + }, + "val": 0 + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/example.md new file mode 100644 index 000000000..6c008b9cd --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/example.md @@ -0,0 +1 @@ +ITS AN ACTIVE PID CONTROLLER FOR A MOCK NONLINEAR SYSTEM TO BE DRIVEN TO A GIVEN SETPOINT. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/PID/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/SAVGOL.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/SAVGOL.md new file mode 100644 index 000000000..fdc3b9cd1 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/SAVGOL.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..df031a118 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/docstring.txt @@ -0,0 +1,2 @@ +Apply a Savitzky-Golay filter to an input vector. + The default behaviour is implementing a 3-point moving average of the data. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..b5b3aa861 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/parameters.yaml @@ -0,0 +1,6 @@ +porder: + default: 1 + type: int +wlen: + default: 3 + type: int diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..1d997297a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/a1-[autogen]/python_code.txt @@ -0,0 +1,19 @@ +import scipy +from flojoy import flojoy, DataContainer +import warnings + + +@flojoy +def SAVGOL(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + print("Savgol inputs:", dc_inputs) + signal = dc_inputs[0].y + window_length: int = params["wlen"] + poly_order: int = params["porder"] + if poly_order >= window_length: + warnings.warn( + "Polynomial order is greater than the window size. Using p=w-1..." + ) + poly_order = window_length - 1 + filtered = scipy.signal.savgol_filter(signal, window_length, poly_order) + return DataContainer(x=signal, y=filtered) diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/SIGNAL_PROCESSING/SAVGOL/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/DF_2_NP.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/DF_2_NP.md new file mode 100644 index 000000000..d9ba68390 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/DF_2_NP.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..349a24a17 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ + +Node to convert dataframe type data into matrix type data. +It takes one dataframe type data and converts it to matrix type data. + +Parameters +---------- +None + +Returns +------- +numpy array + Converted dataframe value from the input diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..19ab2dfb5 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/a1-[autogen]/python_code.txt @@ -0,0 +1,17 @@ +import pandas as pd +from flojoy import flojoy, DataContainer + + +@flojoy +def DF_2_NP(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input = dc_inputs[0] + if dc_input.type == "dataframe": + df = dc_input.m + df_to_numpy = df.to_numpy(dtype=object) + + return DataContainer(type="matrix", m=df_to_numpy) + else: + raise ValueError( + f"unsupported DataContainer type passed for DF_2_NP : {dc_input.type}" + ) diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/app.txt new file mode 100644 index 000000000..0d6a7606f --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/app.txt @@ -0,0 +1,161 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "R_DATASET-bf7b1d88-dd19-4f91-97fe-08ba3e327f25", + "type": "SAMPLE_DATASET", + "data": { + "id": "R_DATASET-bf7b1d88-dd19-4f91-97fe-08ba3e327f25", + "label": "R_DATASET", + "func": "R_DATASET", + "type": "SAMPLE_DATASET", + "ctrls": { + "dataset_key": { + "functionName": "R_DATASET", + "param": "dataset_key", + "value": "iris" + } + }, + "pip_dependencies": [ + { + "name": "rdatasets", + "v": "0.1.0" + } + ], + "selected": false + }, + "position": { + "x": 37.80888631398514, + "y": 368.07341595757464 + }, + "selected": false, + "positionAbsolute": { + "x": 37.80888631398514, + "y": 368.07341595757464 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4db", + "type": "TYPE_CASTING", + "data": { + "id": "DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4db", + "label": "DF_2_NP", + "func": "DF_2_NP", + "type": "TYPE_CASTING", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 407.8088863139851, + "y": 343.78770167186025 + }, + "selected": false, + "positionAbsolute": { + "x": 407.8088863139851, + "y": 343.78770167186025 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 762.0946005996994, + "y": 270.9305588147175 + }, + "selected": false, + "positionAbsolute": { + "x": 762.0946005996994, + "y": 270.9305588147175 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "type": "TERMINATOR", + "data": { + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1293.5231720282711, + "y": 388.0734159575746 + }, + "selected": false, + "positionAbsolute": { + "x": 1293.5231720282711, + "y": 388.0734159575746 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "R_DATASET-bf7b1d88-dd19-4f91-97fe-08ba3e327f25", + "sourceHandle": "main", + "target": "DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4db", + "targetHandle": "DF_2_NP", + "id": "reactflow__edge-R_DATASET-bf7b1d88-dd19-4f91-97fe-08ba3e327f25main-DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4dbDF_2_NP" + }, + { + "source": "DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4db", + "sourceHandle": "main", + "target": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "targetHandle": "LINE", + "id": "reactflow__edge-DF_2_NP-43b0d519-6723-45e6-a59d-36dba4a6f4dbmain-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350LINE" + }, + { + "source": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "sourceHandle": "main", + "target": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "targetHandle": "END", + "id": "reactflow__edge-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350main-END-b1c86448-6805-4081-bc7a-55ceb3d56005END" + } + ], + "viewport": { + "x": 383.94248946966945, + "y": 153.35910915060867, + "zoom": 1.1608238532718647 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/example.md new file mode 100644 index 000000000..39d3711b6 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/example.md @@ -0,0 +1,5 @@ +In this example, `R_DATASET` generates a `dataframe` type data. + +This `dataframe `type data is then passed to the `DF_2_NP` node, which converts its type to `np.ndarray`. + +Finally, this array is the input of `LINE` visualizer and plots its data. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/DF_2_NP/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/MAT_2_DF.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/MAT_2_DF.md new file mode 100644 index 000000000..35c466df4 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/MAT_2_DF.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..3f0c93fa2 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ + +Node to convert matrix type data into dataframe type data. +It takes one matrix type data and converts it to dataframe type data. + +Parameters +---------- +None + +Returns +------- +dataframe + Converted matrix value from the input diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..e72452f74 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/a1-[autogen]/python_code.txt @@ -0,0 +1,20 @@ +import traceback +from numpy import asarray +import pandas as pd +from flojoy import flojoy, DataContainer + + +@flojoy +def MAT_2_DF(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input = dc_inputs[0] + if dc_input.type == "matrix": + np_data = dc_input.m + np_array = asarray(np_data) + df = pd.DataFrame(np_array) + + return DataContainer(type="dataframe", m=df) + else: + raise ValueError( + f"unsupported DataContainer type passed for MAT_2_DF : {dc_input.type}" + ) diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/app.txt new file mode 100644 index 000000000..c87cde126 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/app.txt @@ -0,0 +1,118 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 380, + "height": 293, + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 853.5001424288464, + "y": 175.58952182389925 + }, + "selected": false, + "positionAbsolute": { + "x": 853.5001424288464, + "y": 175.58952182389925 + }, + "dragging": true + }, + { + "width": 190, + "height": 115, + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "type": "TERMINATOR", + "data": { + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1435.469598388447, + "y": 260.8338022323869 + }, + "selected": false, + "positionAbsolute": { + "x": 1435.469598388447, + "y": 260.8338022323869 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "MAT_2_DF-c5e9381e-ccc5-4e2d-bbf3-bd741271b3c8", + "type": "TYPE_CASTING", + "data": { + "id": "MAT_2_DF-c5e9381e-ccc5-4e2d-bbf3-bd741271b3c8", + "label": "MAT_2_DF", + "func": "MAT_2_DF", + "type": "TYPE_CASTING", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 527.5781006448823, + "y": 287.95393385898115 + }, + "selected": false, + "positionAbsolute": { + "x": 527.5781006448823, + "y": 287.95393385898115 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "sourceHandle": "main", + "target": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "targetHandle": "END", + "id": "reactflow__edge-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350main-END-b1c86448-6805-4081-bc7a-55ceb3d56005END" + }, + { + "source": "MAT_2_DF-c5e9381e-ccc5-4e2d-bbf3-bd741271b3c8", + "sourceHandle": "main", + "target": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "targetHandle": "LINE", + "id": "reactflow__edge-MAT_2_DF-c5e9381e-ccc5-4e2d-bbf3-bd741271b3c8main-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350LINE" + } + ], + "viewport": { + "x": 386.73223201420785, + "y": 173.6927085078579, + "zoom": 1.1728043427269372 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/example.md new file mode 100644 index 000000000..996c5a18a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, `MAT_2_DF` node gets an array `[[1],[2],[3]]` as an input. + +This array is converted into `dataframe` type and plots its data. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/MAT_2_DF/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/NP_2_DF.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/NP_2_DF.md new file mode 100644 index 000000000..a2013d8f8 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/NP_2_DF.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/docstring.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..6b7bae55a --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ + +Node to convert numpy array data into dataframe type data + +Parameters +---------- +None + +Returns +------- +dataframe + Converted numpy array value from the input diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/python_code.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..6966d11d0 --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/a1-[autogen]/python_code.txt @@ -0,0 +1,46 @@ +import pandas as pd +import numpy as np +from flojoy import flojoy, DataContainer + + +@flojoy +def NP_2_DF(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input = dc_inputs[0] + match (dc_input.type): + case "dataframe" | "parametric_dataframe": + return dc_input + + case "ordered_pair" | "parametric_ordered_pair": + df = pd.DataFrame(dc_input.y) + return DataContainer(type="dataframe", m=df) + + case "ordered_triple" | "parametric_ordered_triple": + df = pd.DataFrame(dc_input.z) + return DataContainer(type="dataframe", m=df) + + case "matrix" | "grayscale" | "parametric_matrix" | "parametric_grayscale": + np_array = np.asarray(dc_input.m) + df = pd.DataFrame(np_array) + return DataContainer(type="dataframe", m=df) + + case "image" | "parametric_image": + red = dc_input.r + green = dc_input.g + blue = dc_input.b + + if dc_input.a == None: + merge = np.stack((red, green, blue), axis=2) + merge = merge.reshape(-1, merge.shape[-1]) + df = pd.DataFrame(merge) + return DataContainer(type="dataframe", m=df) + else: + alpha = dc_inputs[0].a + merge = np.stack((red, green, blue, alpha), axis=2) + merge = merge.reshape(-1, merge.shape[-1]) + df = pd.DataFrame(merge) + return DataContainer(type="dataframe", m=df) + case _: + raise ValueError( + f"unsupported DataContainer type passed for NP_2_DF : {dc_input.type}" + ) diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/hardware.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/media.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/notes.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/app.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/app.txt new file mode 100644 index 000000000..b6e2940be --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/app.txt @@ -0,0 +1,161 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 380, + "height": 293, + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "type": "PLOTLY_VISOR", + "data": { + "id": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "label": "LINE", + "func": "LINE", + "type": "PLOTLY_VISOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 884.9517434568422, + "y": 180.93055881471747 + }, + "selected": false, + "positionAbsolute": { + "x": 884.9517434568422, + "y": 180.93055881471747 + }, + "dragging": true + }, + { + "width": 190, + "height": 115, + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "type": "TERMINATOR", + "data": { + "id": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1304.9517434568425, + "y": 259.501987386146 + }, + "selected": false, + "positionAbsolute": { + "x": 1304.9517434568425, + "y": 259.501987386146 + }, + "dragging": true + }, + { + "width": 190, + "height": 115, + "id": "SKLEARNIMAGE-b382d779-c880-4963-8556-0ff3100b2398", + "type": "SAMPLE_IMAGE", + "data": { + "id": "SKLEARNIMAGE-b382d779-c880-4963-8556-0ff3100b2398", + "label": "SKLEARNIMAGE", + "func": "SKLEARNIMAGE", + "type": "SAMPLE_IMAGE", + "ctrls": { + "img_key": { + "functionName": "SKLEARNIMAGE", + "param": "img_key", + "value": "astronaut" + } + }, + "pip_dependencies": [ + { + "name": "scikit-image", + "v": "0.20.0" + } + ], + "selected": false + }, + "position": { + "x": 213.84543108495217, + "y": 238.81880153474506 + }, + "selected": false, + "positionAbsolute": { + "x": 213.84543108495217, + "y": 238.81880153474506 + }, + "dragging": true + }, + { + "width": 150, + "height": 135, + "id": "NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10", + "type": "TYPE_CASTING", + "data": { + "id": "NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10", + "label": "NP_2_DF", + "func": "NP_2_DF", + "type": "TYPE_CASTING", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 550.9882882278093, + "y": 201.67594439188792 + }, + "selected": false, + "positionAbsolute": { + "x": 550.9882882278093, + "y": 201.67594439188792 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "sourceHandle": "main", + "target": "END-b1c86448-6805-4081-bc7a-55ceb3d56005", + "targetHandle": "END", + "id": "reactflow__edge-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350main-END-b1c86448-6805-4081-bc7a-55ceb3d56005END" + }, + { + "source": "SKLEARNIMAGE-b382d779-c880-4963-8556-0ff3100b2398", + "sourceHandle": "main", + "target": "NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10", + "targetHandle": "NP_2_DF", + "id": "reactflow__edge-SKLEARNIMAGE-b382d779-c880-4963-8556-0ff3100b2398main-NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10NP_2_DF" + }, + { + "source": "NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10", + "sourceHandle": "main", + "target": "LINE-25d4884c-0c33-43d5-87b0-cfea55a24350", + "targetHandle": "LINE", + "id": "reactflow__edge-NP_2_DF-30f08836-179e-42a6-a7a5-8565a804be10main-LINE-25d4884c-0c33-43d5-87b0-cfea55a24350LINE" + } + ], + "viewport": { + "x": 254.33229548020677, + "y": 144.557378451432, + "zoom": 0.775994799329387 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/example.md b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/example.md new file mode 100644 index 000000000..57df6ee1f --- /dev/null +++ b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/example.md @@ -0,0 +1,5 @@ +In this example, `SKLEARNIMAGE` generates an array that consists of RGB colors. + +This array is then passed to the `NP_2_DF` node, which stacks 3-4 different arrays into a single 2D array. + +Finally, this array is converted to `dataframe` type and plots its data. \ No newline at end of file diff --git a/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/output.txt b/docs/nodes/nodes/TRANSFORMERS/TYPE_CASTING/NP_2_DF/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/ARRAY_VIEW.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/ARRAY_VIEW.md new file mode 100644 index 000000000..252aa3f11 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/ARRAY_VIEW.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..35103dc93 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ + +The ARRAY_VIEW node takes "ordered_pair", "dataframe", "matrix", and "image" as input type +and displays its visualization in array format. + +Parameters +---------- +None + +Returns +------- +plotly + Visualization of the input data in array format diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..654c9a9a4 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/a1-[autogen]/python_code.txt @@ -0,0 +1,88 @@ +from flojoy import flojoy, DataContainer +import plotly.graph_objects as go +import numpy as np +import pandas as pd + +CELL_SIZE = 50 +FONT_SIZE = 10 +MAX_ALLOWED_SHAPE = 10 +l_dot = "$\\ldots$" + + +def numpy_array_as_table(arr: np.ndarray, placeholder: str): + if arr.size > MAX_ALLOWED_SHAPE: + converted_type = arr.astype(object) + new_arr = converted_type[:MAX_ALLOWED_SHAPE] + new_arr[MAX_ALLOWED_SHAPE - 2] = l_dot + else: + new_arr = arr + return new_arr.reshape(-1, 1) + + +@flojoy +def ARRAY_VIEW(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + dc_input = dc_inputs[0] + match dc_input.type: + case "ordered_pair": + data = dc_input.y + cell_values = numpy_array_as_table(data, l_dot) + case "dataframe": + data = pd.DataFrame(dc_input.m).to_numpy(dtype=object) + data = data[:, :-1] + cell_values = numpy_array_as_table(data, l_dot) + case "matrix": + data = dc_input.m + cell_values = numpy_array_as_table(data, l_dot) + case "image": + red = dc_input.r + green = dc_input.g + blue = dc_input.b + + if dc_input.a == None: + merge = np.stack((red, green, blue), axis=2) + else: + alpha = dc_inputs[0].a + merge = np.stack((red, green, blue, alpha), axis=2) + + merge = merge.reshape(-1, merge.shape[-1]) + cell_values = numpy_array_as_table(merge, l_dot) + case _: + raise ValueError( + f"unsupported DataContainer type passed for ARRAY_VIEW: {dc_input.type}" + ) + + fig = go.Figure( + data=[ + go.Table( + header=dict(line={"width": 0}, values=[]), + cells=dict( + values=cell_values, + line={"width": 3}, + font={"size": FONT_SIZE}, + height=CELL_SIZE, + align="center", + format=[".3"], + ), + ) + ] + ) + if dc_input.type == "image" or dc_input.type == "dataframe": + width = MAX_ALLOWED_SHAPE * CELL_SIZE + 800 + + else: + width = MAX_ALLOWED_SHAPE * CELL_SIZE + 80 + height = width + 80 + fig.layout = go.Layout( + autosize=False, + width=width, + height=height, + margin=dict(l=0, r=0, t=0, b=0), + xaxis=dict(visible=False), + yaxis=dict(visible=False), + hovermode="closest", + font=dict(size=FONT_SIZE), + ) + + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/app.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/app.txt new file mode 100644 index 000000000..c3cb26e98 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/app.txt @@ -0,0 +1,134 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 210, + "height": 130, + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "type": "TERMINATOR", + "data": { + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "selected": false, + "positionAbsolute": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "dragging": true + }, + { + "width": 150, + "height": 150, + "id": "LINSPACE-1fbf482b-1149-49c0-8733-fa70d153dba3", + "type": "default", + "data": { + "id": "LINSPACE-1fbf482b-1149-49c0-8733-fa70d153dba3", + "label": "LINSPACE", + "func": "LINSPACE", + "type": "SIMULATION", + "ctrls": { + "start": { + "functionName": "LINSPACE", + "param": "start", + "value": 10 + }, + "end": { + "functionName": "LINSPACE", + "param": "end", + "value": 0 + }, + "step": { + "functionName": "LINSPACE", + "param": "step", + "value": 1000 + } + }, + "selected": false + }, + "position": { + "x": -51.90922250527529, + "y": 240.49397658402108 + }, + "selected": false, + "positionAbsolute": { + "x": -51.90922250527529, + "y": 240.49397658402108 + }, + "dragging": true + }, + { + "width": 240, + "height": 260, + "id": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "type": "PLOTLY_VISOR", + "data": { + "id": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "label": "ARRAY VIEW", + "func": "ARRAY_VIEW", + "type": "DATA_STRUCTURE", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 450.5469442156465, + "y": 183.00350555773372 + }, + "selected": true, + "positionAbsolute": { + "x": 450.5469442156465, + "y": 183.00350555773372 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LINSPACE-1fbf482b-1149-49c0-8733-fa70d153dba3", + "sourceHandle": "main", + "target": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "targetHandle": "ARRAY_VIEW", + "id": "reactflow__edge-LINSPACE-1fbf482b-1149-49c0-8733-fa70d153dba3main-ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162ARRAY_VIEW" + }, + { + "source": "ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162", + "sourceHandle": "main", + "target": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "targetHandle": "END", + "id": "reactflow__edge-ARRAY_VIEW-f74a04cc-1bc3-4bf8-bb01-d7b621375162main-END-d1db4ad1-e647-4059-b60f-173210b3f769END" + } + ], + "viewport": { + "x": 383.94248946966945, + "y": 153.35910915060867, + "zoom": 1.1608238532718647 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/example.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/example.md new file mode 100644 index 000000000..3bb70ef9c --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/example.md @@ -0,0 +1,5 @@ +In this example, `LINSPACE` passes the array that the value continuously decreases as the indices increase. + +The first index value is `10` and the last index value is `0`. + +The array is passed down to `ARRAY_VIEW`, and the visualization of this result is available. \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/output.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/ARRAY_VIEW/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/MATRIX_VIEW.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/MATRIX_VIEW.md new file mode 100644 index 000000000..59281f416 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/MATRIX_VIEW.md @@ -0,0 +1,57 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + +import Example1 from './examples/EX1/example.md'; +import App1 from '!!raw-loader!./examples/EX1/app.txt'; +import Data1 from '!!raw-loader!./examples/EX1/output.txt'; + + + {App1} + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..afb8a7527 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/docstring.txt @@ -0,0 +1,12 @@ + +The MATRIX_VIEW node "matrix" or "ordered_pair" type as input type and displays its visualization +using plotly table in matrix format. + +Parameters +---------- +None + +Returns +------- +plotly + Visualization of the input data in matrix format diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..e57e8e634 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/a1-[autogen]/python_code.txt @@ -0,0 +1,129 @@ +from flojoy import flojoy, DataContainer +import plotly.graph_objects as go +import numpy as np + + +CELL_SIZE = 50 +FONT_SIZE = 10 +MAX_ALLOWED_SHAPE = 10 +MIN_ALLOWED_SHAPE = 4 +v_dot = "$\\vdots$" +d_dot = "$\\ddots$" +l_dot = "$\\ldots$" + + +def numpy_2d_array_as_table( + arr: np.ndarray, + arr_shape: int, + placeholder: str, +): + new_arr = arr + if arr_shape > MAX_ALLOWED_SHAPE: + new_arr = np.full( + (MAX_ALLOWED_SHAPE, MAX_ALLOWED_SHAPE), placeholder, dtype=object + ) + new_arr[:-2, :-2] = arr[: MAX_ALLOWED_SHAPE - 2, : MAX_ALLOWED_SHAPE - 2] + last_row = arr[arr_shape - 1, :] + first_cols = last_row[: MAX_ALLOWED_SHAPE - 2] + new_arr[MAX_ALLOWED_SHAPE - 1, : MAX_ALLOWED_SHAPE - 2] = first_cols + last_col = arr[:, arr.shape[1] - 1] + first_rows = last_col[: MAX_ALLOWED_SHAPE - 2] + new_arr[: MAX_ALLOWED_SHAPE - 2, MAX_ALLOWED_SHAPE - 1] = first_rows + new_arr[MAX_ALLOWED_SHAPE - 1, MAX_ALLOWED_SHAPE - 1 :] = arr[ + arr_shape - 1, arr.shape[1] - 1 : + ] + new_arr[0, MAX_ALLOWED_SHAPE - 2] = l_dot + new_arr[MAX_ALLOWED_SHAPE - 1, MAX_ALLOWED_SHAPE - 2] = l_dot + + new_arr[MAX_ALLOWED_SHAPE - 2, 0] = v_dot + new_arr[MAX_ALLOWED_SHAPE - 2, MAX_ALLOWED_SHAPE - 1] = v_dot + elif arr_shape < MIN_ALLOWED_SHAPE: + row_cols_needed = max(MIN_ALLOWED_SHAPE - arr_shape, 0) + new_arr = np.pad( + arr.astype(object), + ((0, row_cols_needed), (0, row_cols_needed)), + mode="constant", + constant_values=placeholder, + ) + new_arr[:, MIN_ALLOWED_SHAPE - 1] = v_dot + if row_cols_needed > 1: + new_arr[MIN_ALLOWED_SHAPE - row_cols_needed :, 0] = v_dot + new_arr[0, MIN_ALLOWED_SHAPE - row_cols_needed :] = l_dot + new_arr[MIN_ALLOWED_SHAPE - 1, MIN_ALLOWED_SHAPE - row_cols_needed :] = l_dot + new_arr[MIN_ALLOWED_SHAPE - 1, :] = l_dot + + return new_arr.T + + +def numpy_1d_array_as_table(arr: np.ndarray, placeholder: str): + if arr.size > MAX_ALLOWED_SHAPE: + converted_type = arr.astype(object) + new_arr = converted_type[:MAX_ALLOWED_SHAPE] + new_arr[MAX_ALLOWED_SHAPE - 2] = l_dot + elif arr.size < MIN_ALLOWED_SHAPE: + new_arr = np.full((MIN_ALLOWED_SHAPE,), placeholder, dtype=object) + new_arr[: arr.size] = arr[: arr.size] + else: + new_arr = arr + return new_arr.reshape(-1, 1) + + +def numpy_array_as_table(arr: np.ndarray): + ndim = arr.ndim + if ndim == 1: + cell_values = numpy_1d_array_as_table(arr, l_dot) + elif ndim > 2: + raise ValueError("MATRIX_VIEW can process only 2D arrays!") + else: + row_shape, col_shape = arr.shape + if row_shape != col_shape: + raise ValueError("Rows and columns must be of same shape!") + cell_values = numpy_2d_array_as_table(arr, row_shape, d_dot) + return cell_values + + +@flojoy +def MATRIX_VIEW(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + + dc_input = dc_inputs[0] + match dc_input.type: + case "matrix": + np_arr = dc_input.m + cell_values = numpy_array_as_table(np_arr) + case "ordered_pair": + np_arr = dc_input.y + cell_values = numpy_array_as_table(np_arr) + case _: + raise ValueError( + f"unsupported DataContainer type passed for MATRIX_VIEW: {dc_input.type}" + ) + fig = go.Figure( + data=[ + go.Table( + header=dict(line={"width": 0}, values=[]), + cells=dict( + values=cell_values, + line={"width": 3}, + font={"size": FONT_SIZE}, + height=CELL_SIZE, + align="center", + format=[".3"], + ), + ) + ] + ) + width = MAX_ALLOWED_SHAPE * CELL_SIZE + 80 + height = width + 80 + fig.layout = go.Layout( + autosize=False, + width=width, + height=height, + margin=dict(l=0, r=0, t=0, b=0), + xaxis=dict(visible=False), + yaxis=dict(visible=False), + hovermode="closest", + font=dict(size=FONT_SIZE), + ) + + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/app.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/app.txt new file mode 100644 index 000000000..505c6a6fb --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/app.txt @@ -0,0 +1,125 @@ +{ + "rfInstance": { + "nodes": [ + { + "width": 150, + "height": 150, + "id": "MATMUL-6b9405af-2106-43ff-bea1-dbab31afe1c0", + "type": "MATRIX_MANIPULATION", + "data": { + "id": "MATMUL-6b9405af-2106-43ff-bea1-dbab31afe1c0", + "label": "MATMUL", + "func": "MATMUL", + "type": "MATRIX_MANIPULATION", + "ctrls": {}, + "inputs": [ + { + "name": "y", + "id": "matmul_y", + "type": "target" + } + ], + "selected": false + }, + "position": { + "x": 51.30881719559784, + "y": 253.37565457062772 + }, + "selected": false, + "positionAbsolute": { + "x": 51.30881719559784, + "y": 253.37565457062772 + }, + "dragging": true + }, + { + "width": 210, + "height": 130, + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "type": "TERMINATOR", + "data": { + "id": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "label": "END", + "func": "END", + "type": "TERMINATOR", + "ctrls": {}, + "selected": false + }, + "position": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "selected": false, + "positionAbsolute": { + "x": 1066.7749715880866, + "y": 253.50666759254665 + }, + "dragging": true + }, + { + "width": 240, + "height": 260, + "id": "MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8f", + "type": "PLOTLY_VISOR", + "data": { + "id": "MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8f", + "label": "MATRIX VIEW", + "func": "MATRIX_VIEW", + "type": "DATA_STRUCTURE", + "ctrls": {}, + "selected": true + }, + "position": { + "x": 536.733844813559, + "y": 179.07792896180706 + }, + "selected": true, + "positionAbsolute": { + "x": 536.733844813559, + "y": 179.07792896180706 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8f", + "sourceHandle": "main", + "target": "END-d1db4ad1-e647-4059-b60f-173210b3f769", + "targetHandle": "END", + "id": "reactflow__edge-MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8fmain-END-d1db4ad1-e647-4059-b60f-173210b3f769END" + }, + { + "source": "MATMUL-6b9405af-2106-43ff-bea1-dbab31afe1c0", + "sourceHandle": "main", + "target": "MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8f", + "targetHandle": "MATRIX_VIEW", + "id": "reactflow__edge-MATMUL-6b9405af-2106-43ff-bea1-dbab31afe1c0main-MATRIX_VIEW-0839dd9e-2f8a-42ea-9df3-c1b362f56e8fMATRIX_VIEW" + } + ], + "viewport": { + "x": 383.94248946966945, + "y": 153.35910915060867, + "zoom": 1.1608238532718647 + } + }, + "ctrlsManifest": [ + { + "type": "input", + "name": "Slider", + "id": "INPUT_PLACEHOLDER", + "hidden": false, + "minHeight": 1, + "minWidth": 2, + "layout": { + "x": 0, + "y": 0, + "h": 2, + "w": 2, + "minH": 1, + "minW": 2, + "i": "INPUT_PLACEHOLDER" + } + } + ] +} \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/example.md b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/example.md new file mode 100644 index 000000000..886bc215e --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/example.md @@ -0,0 +1,3 @@ +In this example, `MATMULT` multiplies two matrices which are `a : np.ndarray = np.asarray([[3,1,2], [5,6,4], [5,8,9]])` and `b : np.ndarray = np.asarray([[1,2,3], [4,5,6], [7,8,9]])`. + +The calculation is passed down to `MATRIX_VIEW`, and the visualization of this result is available. diff --git a/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/output.txt b/docs/nodes/nodes/VISUALIZERS/DATA_STRUCTURE/MATRIX_VIEW/examples/EX1/output.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/BAR.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/BAR.md new file mode 100644 index 000000000..873a234bf --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/BAR.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..70e2b1215 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Node creates a Plotly Bar visualization for a given input data container. \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..f6ca80448 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/a1-[autogen]/python_code.txt @@ -0,0 +1,38 @@ +from flojoy import flojoy, DataContainer +import plotly.graph_objects as go +import pandas as pd +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def BAR(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=node_name) + fig = go.Figure(layout=layout) + match dc_input.type: + case "ordered_pair": + x = dc_input.x + if isinstance(dc_input.x, dict): + dict_keys = list(dc_input.x.keys()) + x = dc_input.x[dict_keys[0]] + y = dc_input.y + fig.add_trace(go.Bar(x=x, y=y)) + case "dataframe": + df = pd.DataFrame(dc_input.m) + for col in df.columns: + if df[col].dtype == "object": + counts = df[col].value_counts() + fig.add_trace( + go.Bar(x=counts.index.tolist(), y=counts.tolist(), name=col) + ) + else: + fig.add_trace(go.Bar(x=df.index, y=df[col], name=col)) + fig.update_layout(xaxis_title="X Axis", yaxis_title="Y Axis") + case _: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BAR/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.md new file mode 100644 index 000000000..b9a12eb1f --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/BIG_NUMBER.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..db8b67900 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/parameters.yaml @@ -0,0 +1,15 @@ +prefix: + default: '' + type: string +relative_delta: + default: 'true' + options: + - 'true' + - 'false' + type: select +suffix: + default: '' + type: string +title: + default: '' + type: string diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..0275012c3 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/a1-[autogen]/python_code.txt @@ -0,0 +1,44 @@ +from flojoy import flojoy, DataContainer +from node_sdk.small_memory import SmallMemory +import plotly.graph_objects as go +from nodes.VISUALIZERS.template import plot_layout + +MEMORY_KEY = "BIG_NUMBER_MEMORY_KEY" + + +@flojoy +def BIG_NUMBER(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + dc_input = dc_inputs[0] + job_id = params["job_id"] + relative_delta = True if params["relative_delta"] == "true" else False + suffix = params["suffix"] + prefix = params["prefix"] + title = params["title"] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=title if title != "" else node_name) + fig = go.Figure(layout=layout) + match dc_input.type: + case "ordered_pair": + prev_num = SmallMemory().read_memory(job_id, MEMORY_KEY) + big_num = dc_input.y[-1] + fig.add_trace( + go.Indicator( + mode="number+delta", + value=int(float(big_num)), + domain={"y": [0, 1], "x": [0, 1]}, + number={"prefix": prefix, "suffix": suffix}, + delta=None + if prev_num is None + else { + "reference": int(float(prev_num)), + "relative": relative_delta, + "valueformat": ".1%" if relative_delta is True else ".1f", + }, + ) + ) + SmallMemory().write_to_memory(job_id, MEMORY_KEY, big_num) + case _: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/BIG_NUMBER/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/HISTOGRAM.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/HISTOGRAM.md new file mode 100644 index 000000000..5c490896e --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/HISTOGRAM.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..faff83df2 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Node creates a Plotly Histogram visualization for a given input data container. \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..4402fd1a1 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/a1-[autogen]/python_code.txt @@ -0,0 +1,33 @@ +from flojoy import flojoy, DataContainer +import plotly.graph_objects as go +import pandas as pd +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def HISTOGRAM(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=node_name) + fig = go.Figure(layout=layout) + match dc_input.type: + case "ordered_pair": + x = dc_input.x + if isinstance(dc_input.x, dict): + dict_keys = list(dc_input.x.keys()) + x = dc_input.x[dict_keys[0]] + y = dc_input.y + + # Want to show the distribution of y values on the x axis + fig.add_trace(go.Histogram(x=y)) + case "dataframe": + df = pd.DataFrame(dc_input.m) + for col in df.columns: + fig.add_trace(go.Histogram(x=df[col], name=col)) + fig.update_layout(xaxis_title="Value", yaxis_title="Frequency") + case _: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/HISTOGRAM/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.md new file mode 100644 index 000000000..bc68b9ef2 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..23cff8d2c --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/a1-[autogen]/python_code.txt @@ -0,0 +1,28 @@ +from flojoy import flojoy, DataContainer +import plotly.express as px +import numpy as np +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def IMAGE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + if dc_input.type == "image": + r = dc_input.r + g = dc_input.g + b = dc_input.b + a = dc_input.a + else: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + if a is None: + img_combined = np.stack((r, g, b), axis=2) + else: + img_combined = np.stack((r, g, b, a), axis=2) + layout = plot_layout(title="IMAGE") + fig = px.imshow(img=img_combined) + fig.layout = layout + + return DataContainer(type="plotly", fig=fig, r=r, g=g, b=b, a=a) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/IMAGE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/LINE.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/LINE.md new file mode 100644 index 000000000..676eacd7e --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/LINE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..2dc0cb5f7 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Node creates a Plotly Line visualization for a given input data container. \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..2e95d4716 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/a1-[autogen]/python_code.txt @@ -0,0 +1,45 @@ +from flojoy import flojoy, DataContainer +import numpy as np +import plotly.graph_objects as go +import pandas as pd +from nodes.VISUALIZERS.template import plot_layout +from typing import cast + + +@flojoy +def LINE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=node_name) + fig = go.Figure(layout=layout) + match dc_input.type: + case "ordered_pair": + x = dc_input.x + if isinstance(dc_input.x, dict): + dict_keys = list(dc_input.x.keys()) + x = dc_input.x[dict_keys[0]] + y = dc_input.y + fig.add_trace(go.Line(x=x, y=y, mode="lines")) + case "dataframe": + df = pd.DataFrame(dc_input.m) + for col in df.columns: + fig.add_trace(go.Scatter(x=df.index, y=df[col], mode="lines", name=col)) + fig.update_layout(xaxis_title="X Axis", yaxis_title="Y Axis") + case "matrix": + y_columns: np.ndarray = dc_input.m + for i, col in enumerate(y_columns.T): + fig.add_trace( + go.Scatter( + x=np.arange(0, col.size), + y=col, + mode="lines", + name=i, + ) + ) + + case _: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/LINE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/SCATTER.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/SCATTER.md new file mode 100644 index 000000000..5eef65ade --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/SCATTER.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..f689be27e --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/docstring.txt @@ -0,0 +1 @@ +Node creates a Plotly Scatter visualization for a given input data container. \ No newline at end of file diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..9571c7538 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/a1-[autogen]/python_code.txt @@ -0,0 +1,36 @@ +import plotly.graph_objects as go +from flojoy import flojoy, DataContainer +import pandas as pd +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def SCATTER(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=node_name) + fig = go.Figure(layout=layout) + match dc_input.type: + case "ordered_pair": + x = dc_input.x + if isinstance(dc_input.x, dict): + dict_keys = list(dc_input.x.keys()) + x = dc_input.x[dict_keys[0]] + y = dc_input.y + fig.add_trace(go.Scatter(x=x, y=y, mode="markers", marker=dict(size=4))) + case "dataframe": + df = pd.DataFrame(dc_input.m) + for col in df.columns: + fig.add_trace( + go.Scatter(x=df[col], y=df.index, mode="markers", name=col) + ) + fig.update_layout( + xaxis_title="X Axis", + yaxis_title="Y Axis", + ) + case _: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + return DataContainer(type="plotly", fig=fig) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/SCATTER3D.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/SCATTER3D.md new file mode 100644 index 000000000..a2016104c --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/SCATTER3D.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..b7bf873a1 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/a1-[autogen]/python_code.txt @@ -0,0 +1,24 @@ +import plotly.graph_objects as go +from flojoy import DataContainer, flojoy +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def SCATTER3D(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + if dc_input.type == "ordered_triple": + x = dc_input.x + if isinstance(dc_input.x, dict): + dict_keys = list(dc_input.x.keys()) + x = dc_input.x[dict_keys[0]] + y = dc_input.y + z = dc_input.z + else: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + layout = plot_layout(title=node_name) + fig = go.Figure(data=go.Scatter3d(x=x, y=y, z=z, mode="markers"), layout=layout) + + return DataContainer(type="plotly", fig=fig, x=x, y=y, z=z) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SCATTER3D/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/SURFACE3D.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/SURFACE3D.md new file mode 100644 index 000000000..310d68c86 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/SURFACE3D.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..2bf58be96 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/a1-[autogen]/python_code.txt @@ -0,0 +1,20 @@ +import plotly.graph_objects as go +from flojoy import DataContainer, flojoy +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def SURFACE3D(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + if dc_input.type == "ordered_triple": + x = dc_input.x + y = dc_input.y + z = dc_input.z + else: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) + layout = plot_layout(title=node_name) + fig = go.Figure(data=go.Surface(x=x, y=y, z=z, mode="markers"), layout=layout) + return DataContainer(type="plotly", fig=fig, x=x, y=y, z=z) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/SURFACE3D/appendix/notes.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/TABLE.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/TABLE.md new file mode 100644 index 000000000..00dbf2c2e --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/TABLE.md @@ -0,0 +1,50 @@ + +[//]: # (Custom component imports) + +import DocString from '@site/src/components/DocString'; +import PythonCode from '@site/src/components/PythonCode'; +import Parameters from '@site/src/components/Parameters'; +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'; +import ParametersSource from '!!raw-loader!./a1-[autogen]/parameters.yaml'; + +{DocstringSource} +{PythonSource} +{ParametersSource} + + + + + +[//]: # (Examples) + +## Examples + + + + + + + + +[//]: # (Appendix) + +import Notes from '!!raw-loader!./appendix/notes.md'; +import Hardware from '!!raw-loader!./appendix/hardware.md'; +import Media from '!!raw-loader!./appendix/media.md'; + +## Appendix + +{Notes} +{Hardware} +{Media} + + diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/docstring.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/docstring.txt new file mode 100644 index 000000000..5db2af338 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/docstring.txt @@ -0,0 +1,11 @@ +Node creates a Plotly table visualization for a given input data container. + + Args: + dc_inputs (list): A list of DataContainer object(s) containing the input data. + params (dict): A dictionary containing the parameters needed for the visualization. + + Returns: + DataContainer: A DataContainer object containing the generated visualization and the processed data. + + Raises: + ValueError: If the input data container is not supported. diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/parameters.yaml b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/parameters.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/python_code.txt b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/python_code.txt new file mode 100644 index 000000000..f8d1fb470 --- /dev/null +++ b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/a1-[autogen]/python_code.txt @@ -0,0 +1,28 @@ +from flojoy import flojoy, DataContainer +import plotly.graph_objects as go +import pandas as pd +from nodes.VISUALIZERS.template import plot_layout + + +@flojoy +def TABLE(dc_inputs: list[DataContainer], params: dict) -> DataContainer: + + dc_input: DataContainer = dc_inputs[0] + node_name = __name__.split(".")[-1] + layout = plot_layout(title=node_name) + if dc_input.type in ["dataframe", "plotly"]: + df = pd.DataFrame(dc_input.m) + fig = go.Figure( + data=[ + go.Table( + header=dict(values=list(df.columns), align="left"), + cells=dict(values=[df[col] for col in df.columns], align="left"), + ) + ], + layout=layout, + ) + return DataContainer(type="plotly", fig=fig, m=df) + else: + raise ValueError( + f"unsupported DataContainer type passed for {node_name}: {dc_input.type}" + ) diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/hardware.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/hardware.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/media.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/media.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/notes.md b/docs/nodes/nodes/VISUALIZERS/PLOTLY/TABLE/appendix/notes.md new file mode 100644 index 000000000..e69de29bb