JSON#
This expdef plugin can be selected via --expdef=expdef.json. This plugin
supports flattening/nested configuration files.
Important
If multiple matches for a given JSONpath string are found, ALL are modified accordingly.
Experimental inputs are defined using JSON. See the section on JSON in Special Tokens for restrictions on the contents of JSON input files.
Reserved Tokens#
__CONTROLLER__- Placeholder used to select which controller present in an input file (if there are multiple) a user wants to use for a specific Experiment. Can appear in JSON attributes. This makes auto-population of the controller name based on the--controllerargument and the contents ofcontrollers.yaml(see Project YAML Configuration for details) in template input files possible.
Attributes vs. elements#
While this format treats keys mapping to subtrees and keys mapping to literal attributes equivalently, SIERRA does not, in order to provide uniformity across the different input file types it can handle. Two consequences follow, both of which result in a warning being logged and nothing being modified (SIERRA does not raise an error, and does not fall back to a "valid for this format" change):
If you ask SIERRA to change an attribute, but the target key actually maps to a sub-tree (an element), the modification is refused.
If you ask SIERRA to set an attribute value onto a key that is an element, the modification is likewise refused (an element is not clobbered by an attribute value).
An array value is treated as an attribute only when all of its members are
primitives (for example [80, 443]). An array whose members are themselves
maps or lists is an element, and is subject to the element rules above. See
Experiment Definition (--expdef) for the full cross-format definition of attributes and
elements.
The JSON plugin supports array-valued attributes: a key whose value is a flat
list of scalars (e.g. "ports": [80, 443]) is a valid attribute and can be
read and modified as one.
Added in version 1.3.19.
Changed in version 1.5.10: Flat arrays of scalars are now recognized as attributes (array-valued attributes), and setting an attribute value onto a key that maps to an element is now explicitly refused.