coleman.spec.io¶
YAML config loading and resolved spec persistence.
coleman.spec.io ¶
Spec I/O — load from YAML, save resolved canonical JSON.
Functions:
| Name | Description |
|---|---|
load_spec |
Load and validate a |
load_sweep_spec |
Load and validate an optional top-level |
save_resolved |
Write the resolved spec as deterministic JSON. |
load_spec ¶
Load a :class:RunSpec from a YAML config file.
Pack references (packs: key) are resolved and deep-merged
before validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the YAML config file. |
required |
packs_dir
|
str | Path | None
|
Root directory for config packs. When |
None
|
Returns:
| Type | Description |
|---|---|
RunSpec
|
Validated run specification. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If path or a referenced pack does not exist. |
ValidationError
|
If the resolved dict fails schema validation. |
load_sweep_spec ¶
Load an optional top-level sweep section from a YAML config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the YAML config file. |
required |
packs_dir
|
str | Path | None
|
Root directory for config packs. When |
None
|
Returns:
| Type | Description |
|---|---|
SweepSpec | None
|
Validated sweep configuration, or |
save_resolved ¶
Persist spec as canonical JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
RunSpec
|
Resolved run specification. |
required |
path
|
str | Path
|
Destination file path. |
required |
redact_sensitive
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
Path
|
The written file path. |