Run Scripts

Given the extensive and varied nature of the algorithms employed in the development of the experimental design, it is impracticable to address the full range of potential requirements of a scientist working with Chemotion. One potential solution to this challenge is the incorporation of user-defined scripts as execution scripts within the ChemDoE framework. However, it is imperative to ensure the seamless integration and collaboration between these custom scripts and ChemDoE. To this end, it is essential that the scripts adhere to certain criteria to facilitate effective cooperation. The subsequent sections will delve into these criteria in greater detail.

General Requirements

It is important to note that ChemDoE is only compatible with Python and R scripts. Therefore, it is necessary to have a Python and R interpreter installed on the device. Ideally, users should ensure that they have the most recent version of these interpreters installed. Specifically, for Python, the minimum version required is 3.12.

How to develop your on Script

A number of design options must be made in advance. Specifically, a programming language, an input file format and an output file format must be selected.

Script Design options

Language

Input File

Output File

Python

CSV

CSV

R

JSON

JSON

ChemDoE provides a comprehensive list of assistance positions that facilitate the creation of a script. For a more detailed exposition of the requirements and these assistance items, please refer to the chapters Write a Python Run Script and Write a R Run Script.

Input and output file format

Prior to delving into the intricacies of the assistance and prerequisites of the script, it is imperative to elucidate the corresponding file format of the input and output files. The input and output files are structured according to the example shown in Figure 2.

DoE Table

Figure 2: An example of a DoE table.

Input JSON

{
    "S:11": [
        "mol",
        1.0,
        2.0,
        3.0
    ],
    "R:12": [
        "mol",
        0.1,
        0.2,
        0.3
    ],
    "P:13": [
        "mol",
        4.0,
        5.0,
        6.0
    ],
    "Temperature": [
        "\u00b0C",
        100.0,
        200.0,
        300.0
    ],
    "Duration": [
        "Second(s)",
        0.03,
        0.04,
        0.05
    ],
    "c5576381-4e86-4abb-b587-e4effefdf60a__clean__duration": [
        "min",
        10.0,
        20.0,
        30.0
    ]
}

Input CSV

Input CSV file

S:11

mol

1.0

2.0

3.0

R:12

mol

0.1

0.2

0.3

P:13

mol

4.0

5.0

6.0

Temperature

°C

100.0

200.0

300.0

Duration

Second(s)

0.03

0.04

0.05

c5576381-4e86-4abb-b587-e4effefdf60a__clean__duration

min

10.0

20.0

30.0

Output JSON

{
    "VARIABLE": [
        "S:11",
        "R:12",
        "P:13",
        "Temperature",
        "Duration",
        "c5576381-4e86-4abb-b587-e4effefdf60a__clean__duration"
    ],
    "UNIT": [
        "mol",
        "mol",
        "mol",
        "\u00b0C",
        "Second(s)",
        "min"
    ],
    "Variation.0": [
        3.0,
        0.3,
        5.0,
        300.0,
        0.03,
        10.0
    ],
    "Variation.1": [
        3.0,
        0.1,
        4.0,
        300.0,
        0.04,
        10.0
    ],
    "Variation.2": [
        3.0,
        0.2,
        5.0,
        200.0,
        0.05,
        10.0
    ],
    "Variation.3": [
        3.0,
        0.3,
        6.0,
        100.0,
        0.03,
        20.0
    ],
    "Variation.4": [
        3.0,
        0.1,
        5.0,
        100.0,
        0.04,
        20.0
    ],
    "Variation.5": [
        3.0,
        0.2,
        6.0,
        300.0,
        0.04,
        20.0
    ],
    "Variation.6": [
        3.0,
        0.3,
        4.0,
        300.0,
        0.05,
        20.0
    ],
    "Variation.7": [
        3.0,
        0.1,
        6.0,
        200.0,
        0.03,
        30.0
    ],
    "Variation.8": [
        3.0,
        0.2,
        4.0,
        200.0,
        0.04,
        30.0
    ],
    "Variation.9": [
        3.0,
        0.3,
        5.0,
        100.0,
        0.05,
        30.0
    ],
    "Variation.10": [
        3.0,
        0.1,
        4.0,
        100.0,
        0.03,
        10.0
    ]
}

Output CSV

Input CSV file

VARIABLE

UNIT

Variation.0

Variation.1

Variation.2

Variation.3

Variation.4

Variation.5

Variation.6

Variation.7

Variation.8

Variation.9

Variation.10

S:11

mol

3.0

3.0

3.0

3.0

3.0

3.0

3.0

3.0

3.0

3.0

3.0

R:12

mol

0.3

0.1

0.2

0.3

0.1

0.2

0.3

0.1

0.2

0.3

0.1

P:13

mol

5.0

4.0

5.0

6.0

5.0

6.0

4.0

6.0

4.0

5.0

4.0

Temperature

°C

300.0

300.0

200.0

100.0

100.0

300.0

300.0

200.0

200.0

100.0

100.0

Duration

Second(s)

0.03

0.04

0.05

0.03

0.04

0.04

0.05

0.03

0.04

0.05

0.03

c5576381-4e86-4abb-b587-e4effefdf60a__clean__duration

min

10.0

10.0

10.0

20.0

20.0

20.0

20.0

30.0

30.0

30.0

10.0