kinextract.load_config_from_toml
- kinextract.load_config_from_toml(path: str | Path) FitConfig[source]
Build a
FitConfigfrom a TOML configuration file.TOML tables are optional and purely organizational: any top-level scalar key, or any key nested one level inside a
[section]table, is treated as aFitConfigfield. Keys that are not recognizedFitConfigfields are dropped with a warning (logged vialog()), except for a small set of wrapper-level keys (run_errors_default,run_bootstrap_default,n_bootstrap,n_jobs) consumed by higher-level scripts rather thanFitConfigitself. TOML arrays become tuples, matching the tuple-typedFitConfigfields (e.g.xlam_auto_grid,extra_absorption_lines).- Parameters:
path (str or pathlib.Path) – Path to the TOML config file.
- Returns:
A validated configuration object (
__post_init__runs as usual).- Return type:
- Raises:
ImportError – If neither the standard-library
tomllib(Python >= 3.11) nor thetomlibackport is available.
Examples
>>> from kinextract import load_config_from_toml >>> cfg = load_config_from_toml("kinextract.config")
See also
FitConfigThe configuration object this function constructs.
FitConfig.describePrint all tunable fields, e.g. after loading.