Added more folders and restructured classes inside them.
This commit is contained in:
22
src/ptdiag/artifacts.py
Normal file
22
src/ptdiag/artifacts.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Generated diagnostic output paths for checkout-only experiments."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Mapping
|
||||
|
||||
from .config import repository_root
|
||||
|
||||
|
||||
RESULTS_ROOT_ENVIRONMENT_VARIABLE = "PTDIAG_RESULTS_ROOT"
|
||||
|
||||
|
||||
def default_results_root(environment: Mapping[str, str] | None = None) -> Path:
|
||||
"""Return the configurable root for generated diagnostic evidence."""
|
||||
|
||||
values = os.environ if environment is None else environment
|
||||
explicit = values.get(RESULTS_ROOT_ENVIRONMENT_VARIABLE, "").strip()
|
||||
if explicit:
|
||||
return Path(explicit).expanduser().absolute()
|
||||
return repository_root() / ".artifacts/diagnostics/results"
|
||||
Reference in New Issue
Block a user