Read the whole regen/ tree below root.
Parameters
| root |
Path | str |
Repository root (the directory that holds regen/). |
required |
Returns
| RegenSpec |
RegenSpec |
Architecture, units and decisions. |
Raises
|
SpecError |
If any file is malformed, or two unit files name the same module. |
|
FileNotFoundError |
If regen/architecture.toml does not exist. |
Examples
from pathlib import Path
from tempfile import TemporaryDirectory
from spotregen import load_spec, make_sample_repo
with TemporaryDirectory() as tmp:
spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
print(len(spec.units), "unit,", len(spec.decisions), "decision")