Configuration

Config handling for the Atom-HiFi CLI and Python API.

The commented YAML in _TEMPLATE below is the single source of truth for the public CLI configuration: it drives

  • atom-hifi init — written verbatim as the starter config.yaml,

  • the YAML defaults — parsed from it and merged under any user config, and

  • the allowed YAML keys — strict validation rejects keys absent from the template.

Some expert controls are intentionally Python-API-only. They are not accepted in YAML, but atom_hifi.runner.run() still receives stable hidden defaults via fill_defaults.

Note on the custom descriptor: a custom descriptor is a Python callable and cannot be expressed in YAML. descriptor.kind therefore accepts only eds or ace (MACE ACE) here; to use a custom descriptor, call atom_hifi.runner.run() from Python with config['descriptor']['custom_fn'] set to your callable.

The same applies to a custom cluster backend: cluster.backend accepts only the built-in names in YAML; to plug your own ClusterBackend, call atom_hifi.runner.run() with cluster.backend='custom' and cluster.custom_backend set to your instance.

atom_hifi.config.is_rnum(value)[source]

True iff value is an r<NUM> reference string, NUM in [1, 100].

Return type:

bool

atom_hifi.config.default_config_yaml()[source]

Return the canonical commented config template (verbatim init output).

Return type:

str

atom_hifi.config.fill_defaults(config)[source]

Return config deep-merged under runtime defaults (no YAML validation).

Used by atom_hifi.runner.run() so callers may pass a partial dict. Python API callers may use API-only controls such as grid and patient; those keys are deliberately rejected by load_config().

Parameters:

config (dict)

Return type:

dict

atom_hifi.config.load_config(path)[source]

Load a user YAML config, merge it under the template defaults, and validate.

Strict: any key not present in the template tree raises ValueError; a custom descriptor kind is rejected with a pointer to the Python API.

Parameters:

path (str)

Return type:

dict