55from pathlib import Path
66from typing import Any , Protocol , TypeVar , cast
77
8- import yaml
98import petname
9+ import yaml
1010
1111from bergson .utils .logger import get_logger
1212
13-
1413CONFIG_FILENAME = "config.yaml"
1514
1615
@@ -84,7 +83,7 @@ def save_pipeline_config(steps: list[tuple[str, Any]], run_path: str | Path | No
8483
8584 It can be run using ``bergson <run_path>/config.yaml``.
8685
87- The pipeline config uses the same format as one-step command configs, but is saved
86+ The pipeline config uses the same format as one-step command configs, but is saved
8887 to a ``run_path`` directory unique to the pipeline run. ``steps`` is the list of
8988 commands that ran.
9089 """
@@ -110,7 +109,7 @@ def read_config(path: str | Path) -> dict[str, Any]:
110109 path = _resolve (path )
111110 with path .open () as f :
112111 config = yaml .safe_load (f )
113-
112+
114113 if not isinstance (config , dict ) or not isinstance (config .get ("steps" ), list ):
115114 raise ValueError (
116115 f"{ path } must be a mapping with a `steps:` list of "
@@ -138,10 +137,10 @@ def load_subconfig(
138137 field : str ,
139138 config_cls : type [T ],
140139) -> T | None :
141- """Hydrate one configuration dataclass (e.g. ``field="index_cfg",
140+ """Hydrate one configuration dataclass (e.g. ``field="index_cfg",
142141 config_cls=IndexConfig``) from a ``config.yaml``.
143142
144- Searches every step for ``field`` and returns the first match
143+ Searches every step for ``field`` and returns the first match
145144 or ``None``.
146145 """
147146 if not _resolve (path ).exists ():
0 commit comments