Skip to content

mamut_routing_tools.workspace

Workspace directory resolution for the local tools.

One self-contained workspace directory holds everything a session produces (OSM extracts under osmdata/, generated instances under instances/, GUI state under state/). Resolution order:

  1. An explicit --output-dir / output_dir argument.
  2. $MAMUT_TOOLS_WORKSPACE when set.
  3. <repo>/.cache/mamut-tools when the current directory is inside a checkout of the tools repo (the gitignored dev-loop workspace).
  4. ~/.cache/mamut-tools otherwise.

jobs_dir

jobs_dir(workspace: Path, *, create: bool = True) -> Path

Persistent GUI job records.

Jobs are state rather than generated benchmark artefacts: retaining them across GUI restarts makes long-running work auditable without changing the existing instances/ layout.

Source code in MAMUT-routing-tools/src/mamut_routing_tools/workspace.py
def jobs_dir(workspace: Path, *, create: bool = True) -> Path:
    """Persistent GUI job records.

    Jobs are state rather than generated benchmark artefacts: retaining them
    across GUI restarts makes long-running work auditable without changing the
    existing ``instances/`` layout.
    """

    path = state_dir(workspace, create=create) / "jobs"
    if create:
        path.mkdir(parents=True, exist_ok=True)
    return path

logs_dir

logs_dir(workspace: Path, *, create: bool = True) -> Path

Per-job text logs, kept next to the persistent job records.

Source code in MAMUT-routing-tools/src/mamut_routing_tools/workspace.py
def logs_dir(workspace: Path, *, create: bool = True) -> Path:
    """Per-job text logs, kept next to the persistent job records."""

    path = state_dir(workspace, create=create) / "logs"
    if create:
        path.mkdir(parents=True, exist_ok=True)
    return path

solutions_dir

solutions_dir(workspace: Path, *, create: bool = True) -> Path

Validated solution runs produced by the local workbench.

Source code in MAMUT-routing-tools/src/mamut_routing_tools/workspace.py
def solutions_dir(workspace: Path, *, create: bool = True) -> Path:
    """Validated solution runs produced by the local workbench."""

    path = workspace / "solutions"
    if create:
        path.mkdir(parents=True, exist_ok=True)
    return path