YAML Config
Jump to navigation
Jump to search
This block represents a yaml config file that is read in as a dictionary.
The values can be used directly when instantiating blocks. For example,
Sample Rate: yaml_config["samp_rate"]
Optionally, a json schema can be specified to validate the configuration. It may sound odd to use a json schema for a yaml file, but it works and jsonschema is a rich specification.
For example, you could have a YAML file that contains:
{ "samp_rate": 1e6, }
And a schema that contains
{ "type": "object", "properties": { "samp_rate": {"type": "number", "exclusiveMinimum": 0} } }
If the id of this block is yaml_config_0
, then you can access the samp rate
in other blocks as yaml_config_0["samp_rate"]
.
Parameters
- Config File
- File name of the YAML config file
- Config Schema
- (Optional) File name of the JSON schema file
Example Flowgraph
The example.yaml
file contains:
{ "amplitude": 0.1, "frequency": 1000 }
Example Output
Source Files
- Block definition
- yaml_config.block.yml