gui.model.run_directory

gui.model.run_directory(root, unit, label, today=None)

The directory a job writes to: regen/runs/<date>-<unit>-<label>.

An existing directory gets the suffix -2, -3 and so on. The directory is not created.

Parameters

Name Type Description Default
root Path | str The repository root. required
unit str The unit name. required
label str What ran, for example "mutate". required
today date | None The date. Defaults to today. None

Returns

Name Type Description
Path Path A directory that does not exist yet.

Examples

from datetime import date
from pathlib import Path
from tempfile import TemporaryDirectory

from spotregen.gui.model import run_directory

with TemporaryDirectory() as tmp:
    first = run_directory(tmp, "core.calc", "mutate", date(2026, 10, 11))
    first.mkdir(parents=True)
    print(first.name, run_directory(tmp, "core.calc", "mutate", date(2026, 10, 11)).name)
2026-10-11-core.calc-mutate 2026-10-11-core.calc-mutate-2