For the complete documentation index, see llms.txt. This page is also available as Markdown.

Scripts

Violet Scripts allow you to author and run code that can reference (and write to) your live Violet data.

Overview

Use Scripts to size subsystems, analyze test results, compare data between applications, generate reports or execute external simulations and workflows.

Script outputs can be consumed or referenced elsewhere in Violet, for example in Parameters, Requirements and Verifications.

Violet Scripts function as embedded Jupyter Notebooks and can contain 1 or more code cells. For a primer on Jupyter, we recommend you check out their how-to here.

Getting started

To get started, navigate to Scripts and click .

In the Inspector panel, select Settings. Provide a name and description (optional) for your script, and specify your language of choice: Python, Julia or MATLAB.

Next, let's test your skills. With Python selected, type print('hello world') in a code cell and click Run All. This will execute the script and display the output below the cell.

Variables

Use Violet Variables to reference and consume your live Violet data. Variables will update automatically when the source data changes.

Variables can reference data from Integrations (ie. live data from applications you've connected), Parameters, Requirements, Verifications or other Scripts outputs.

To create a Violet Variable, use the reserved syntax Violet["variable_name"] within your script, replacing variable_name with the name of your choice. Variable names must be unique within each script and can only contain letters, numbers and underscores.

In the Inputs panel, you will be prompted to link a property.

Use the search field to find and select the data of your choice, then click Run to see the updated results.

Auto-run

Setting a Script to Auto-run will trigger it to re-execute when the value of an input variable changes.

In the example below, a script variable is linked to a parameter. When the value of the parameter is updated, the script is automatically re-run, and the new results are shown:

Last updated

Was this helpful?