2 Semantics 4 Runtime Evaluation Order
Target Parameters Reference  / 

3 Parameter Section

At the top level, the parameter section must be a YAML mapping. The script parameter framework define the following keys at the top level:

Typically one either has a params section and associated code, either inlined or in a separate file referenced by the script key, or one has an args section and reference another script via the target key.

Note that one can have a params section when the target key is specified, but those parameters cannot be used by the script since it has no code. However they can be used by scripts that include the current script. It is illegal to have a parameter in params that is also present in the script specified by target.

3.1 Parameter Tree Nodes

Each parameter definition must be a YAML mapping. It either defines an inner node (a namespace) in the parameter tree, or an actual parameter.

Parameters are defined by including the type key. In that case the following keys are defined:

An inner node may be an import node, defined by having the import key, or a blueprint import node, defined by having the blueprint key. In the import case the following keys are defined:

In the blueprint import case, the following keys are defined:

Every blueprint that is imported is put on the list of blueprints that is expanded between the pre-instantiation code and regular script code is run.

If neither the import, blueprint nor the type key are specified, then the parameter definition is a regular inner node in the parameter tree, and its keys are parameter names whose values must be parameter definitions, as defined above.

3.1.1 Array Parameters

Import nodes in the parameter tree may be of array type, whose size depends on another parameter, which must be a required parameter of integer type. An array node is specified by having a node name of the form <name>[<size>].

At run-time, assuming the <size> parameter is assigned <value>, the argument tree will contain nodes <name>[0], <name>[1], …, <name>[<value>-1].

3.2 Argument Specifications

The argument tree specified by args must match the tree of parameters: the keys are parameter names or names of inner nodes, and the values are the (default) values, or a mapping in the case of inner nodes.

At any node in the argument tree, one can import an argument tree from another script. This is specified by having the import, whose value must be the file name where arguments should be imported from. Additional arguments can be specified in the same mapping as the import.

3.3 Parameter References

Any parameter can be turned into a reference to another parameter, by specifying a parameter name prefixed with ^ as the parameter value. This is primarily useful when parameters in different sub-scripts should have the same value, and copying the values using params.setdefault is impractical.

Only parameters in the same script can be referenced, specified from the root of the script, using : as separator when referring to nested parameters. Reading from a reference has the same effect as reading from the referred parameter.

It is illegal to set a parameter default to be a reference to an unassigned parameter, unless this is done using params.setdefault, in which case it is illegal to read from the reference until the referred parameter is assigned.

2 Semantics 4 Runtime Evaluation Order