The duqtools
config file
UQ run settings are configured using a yaml configuration file in the project directory. By default it is named duqtools.yaml
. You can specify another path for it using the -c/--config option (see duqtools help
or the cli).
As a minimum, this configuration file must define the root workspace and the system to use (see below). All other settings are (in principle) optional.
Starting from scratch
To help initialize a starting config to modify, you can run duqtools init
.
Check out the different subpages of this section that explain the different parts of the config.
Example config file
Below is an example config file generated by duqtools init
.
# Check out the documentation for more info:
# https://duqtools.readthedocs.io/en/latest/config/
tag: duqtools
create:
runs_dir: ./runs_dir # change to output directory
template: ./template # change to directory with template
dimensions:
- variable: t_e
operator: multiply
values: [0.9, 1.0, 1.1]
scale_to_error: false
- variable: zeff
operator: multiply
values: [0.9, 1.0, 1.1]
scale_to_error: false
sampler:
method: latin-hypercube
n_samples: 3
system:
name: jetto
Defining the system
Currently there are multiple systems available. They are distinguished by specifying the system
field.
system:
name: jetto
jetto-v210921
System that can be used to create runs for jetto.
The backend that is assumed is jetto-v210921.
This system can submit to various backends like docker, prominence and the gateway.
system:
name: jetto-v210921
submit_system: prominence
jetto-v220922, jetto
System that can be used to create runs for jetto.
The backend that is assumed is jetto-v220922. The most important
difference with v210921 is that the IMAS data is handled locally
instead of via a public imasdb
This system can submit to various backends like docker, prominence and the gateway.
system:
name: jetto-v220922
submit_system: docker
ets6
System that can be used to create runs for ets.
dummy
This is a dummy system that implements the basic interfaces.
It exists for testing purposes in absence of actual modelling software.
Extra variables
Duqtools comes with a list of default variables. You can update or add your own variables via the extra_variables
key in the duqtools.yaml
file.
IDS variables
Variable for describing data within a IMAS database.
The variable can be given a name, which will be used in the rest of the config to reference the variable. It will also be used as the column labels or on plots.
The dimensions for each variable must be specified. This ensures the
the data will be self-consistent. For example for 1D data, you can
use [x]
and for 2D data, [x, y]
.
The IDS path may contain indices. You can point to a single index,
by simply giving the complete path (i.e. profiles_1d/0/t_i_ave
for
the 0th time slice). To retrieve all time slices, you can use
profiles_1d/*/t_i_ave
.
ids
- Root IDS name.
path
- Path to the data within the IDS. The fields are separated by forward slashes (
/
). type
- discriminator for the variable type
name
- Name of the variable. This will be used to reference this variable.
dims
- Give the dimensions of the data, i.e. [x] for 1D, or [x, y] for 2D data.
Example:
extra_variables:
- name: rho_tor_norm
ids: core_profiles
path: profiles_1d/*/grid/rho_tor_norm
dims: [time, x]
type: IDS-variable
- name: t_i_ave
ids: core_profiles
path: profiles_1d/*/t_i_ave
dims: [time, x]
type: IDS-variable
Jetto variables
Variable for describing variables specific to Jetto, The lookup table can be defined as a JettoVar under the lookup key.
type
- Discriminator for the variable type.
name
- Name of the variable. Used for the lookup table to find actual fields.
lookup
- Description of the fields that have to be updated for a Jetto Variable
The lookup key is defined by a so-called jetto variable, which maps to one or more locations in the jetto system configs (e.g., jetto.jset
, or jetti.in
).
These describe the jetto variables.
doc
- Docstring for the variable.
name
- Name of the variable.
type
- Type of the variable (str, int, float)
keys
- Jetto keys to update when this jetto variable is requested
The exact fields to write to are defined under the keys
section, which takes the file
to write to, the section
(if applicable) and field
the variable is mapped to.
Example:
extra_variables:
- name: major_radius
type: jetto-variable
lookup:
name: major_radius
doc: Reference major radius (R0)
type: float
keys:
- field: EquilEscoRefPanel.refMajorRadius
file: jetto.jset
- field: RMJ
file: jetto.in
section: NLIST1
Top level
These are the top level keywords in the config. See the specific sections for more information.
tag
- Create a tag for the runs to identify them in slurm or
data.csv
create
- Configuration for the create subcommand. See model for more info.
extra_variables
- Specify extra variables for this run.
system
- Options specific to the system used
quiet
- If true, do not output to stdout, except for mandatory prompts.