Saqr/core/paths.py

29 lines
893 B
Python

"""Canonical project paths, resolved dynamically at import time.
By default the project root is the parent of the ``core/`` package —
whatever filesystem location ``Saqr/`` currently lives at. Override by
setting the ``SAQR_ROOT`` environment variable.
"""
from __future__ import annotations
import os
from pathlib import Path
_DEFAULT_ROOT = Path(__file__).resolve().parents[1]
PROJECT_ROOT = Path(os.environ.get("SAQR_ROOT", _DEFAULT_ROOT)).resolve()
CONFIG_DIR = PROJECT_ROOT / "config"
DATA_DIR = PROJECT_ROOT / "data"
DATASET_DIR = DATA_DIR / "dataset"
MODELS_DIR = DATA_DIR / "models"
RUNTIME_DIR = PROJECT_ROOT / "runtime"
CAPTURES_DIR = RUNTIME_DIR / "captures"
SNAPSHOTS_DIR = RUNTIME_DIR / "snapshots"
RUNS_DIR = RUNTIME_DIR / "runs"
LOGS_DIR = PROJECT_ROOT / "logs"
RESULT_CSV = CAPTURES_DIR / "result.csv"
EVENTS_CSV = CAPTURES_DIR / "events.csv"