Desktops

Overview

A desktop on the davinci site represents a set of scripts and components that can be run to accomplish a given analysis. They are bundled together and accessible through either a copy button or a desktop button.

Example Code

Small example scripts may be presented in the following format.
print('hello world')
Right clicking on the code will open a context menu with the following options.

Example Runnable Code

For scripts or desktops that can be run in the browwser, you may see a code editor as in the following:


Clicking the run button will execute the code, which may take some time to run before anything is printed to the console. The clipboard underneath the editor, when clicked, will copy the code to your clipboard, where it can be pasted into a davinci page or imported into Visual Studio.

Example Code without Run

When code is presented without a run button or a console, it typically means that the code is not able to be run within the browser, but can still be copied and imported into Visual Studio.

Sample Data and Mapping Data Inputs

Most provided scripts or desktops include utilities for providing different types of analysis. The sample code is typically provided with a sample dataset (usually randomly generated) that the analysis is run on, to provide an example of the analysis.

To simplify the mapping process, most scripts are designed to use pydantic data classes as inputs. This allows users to easily see the definitions of the data inputs and to opitimize the use of IDE provided help such as Intellisense.

VSCode Setup

To run a desktop in VSCode, you install the VSCode davinci extension. Then run the davinci initialization command from the command menu (ctrl-shift-p). This will do the following.