LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.utils.config Namespace Reference

Functions

dict[str, Any] load_yaml (str|Path path)
 
dict[str, Any] apply_overrides (dict[str, Any] data, Sequence[str] overrides)
 
T T (type[T] cls, Mapping[str, Any] data)
 
Any to_dict (Any obj)
 
T T (type[T] cls, str|Path path, Sequence[str] overrides=())
 
None save_config (Any obj, str|Path path)
 
Any _coerce (Any tp, Any value)
 
dict[str, Any] _deepcopy_dict (Mapping[str, Any] d)
 

Detailed Description

YAML configuration files loaded into frozen dataclasses.

Configs live in ``configs/`` as plain YAML. Each experiment declares a frozen
dataclass tree; :func:`load_config` validates the YAML against it, applies
``dotted.key=value`` overrides (e.g. from the command line or a SLURM script),
and returns the typed object. :func:`save_config` writes the *resolved* config
so every run directory records exactly what was executed.

Function Documentation

◆ _coerce()

Any rl_stl.utils.config._coerce ( Any  tp,
Any  value 
)
protected

◆ _deepcopy_dict()

dict[str, Any] rl_stl.utils.config._deepcopy_dict ( Mapping[str, Any]  d)
protected

◆ apply_overrides()

dict[str, Any] rl_stl.utils.config.apply_overrides ( dict[str, Any]  data,
Sequence[str]  overrides 
)
Apply ``a.b.c=value`` overrides; values are parsed as YAML scalars/lists.

◆ load_yaml()

dict[str, Any] rl_stl.utils.config.load_yaml ( str | Path  path)

◆ save_config()

None rl_stl.utils.config.save_config ( Any  obj,
str | Path  path 
)

◆ T() [1/2]

T rl_stl.utils.config.T ( type[T]  cls,
Mapping[str, Any]  data 
)
Recursively build dataclass ``cls`` from a mapping, rejecting unknown keys.

◆ T() [2/2]

T rl_stl.utils.config.T ( type[T]  cls,
str | Path  path,
Sequence[str]   overrides = () 
)

◆ to_dict()

Any rl_stl.utils.config.to_dict ( Any  obj)
Convert dataclasses/tuples/numpy scalars into YAML-safe builtins.