analyze.py 973 B

1234567891011121314151617181920212223242526272829303132
  1. """Pipeline task wrapper for the analysis stage (step 7).
  2. The analysis logic lives in the top-level :mod:`analysis` package (mirroring
  3. :mod:`evaluation`); this module is only the thin pipeline-task adapter. It is
  4. named ``analyze`` rather than ``analysis`` so it does not shadow that package.
  5. """
  6. import pathlib as pl
  7. from typing import Any, Dict
  8. import analysis
  9. from util.progress import ProgressTracker
  10. from util.ui_logger import PipelineLogger
  11. # Re-exported so the task registry can describe the artifacts this stage writes.
  12. ANALYSIS_SUBDIR = analysis.ANALYSIS_SUBDIR
  13. EVAL_SUBDIR = analysis.EVAL_SUBDIR
  14. def run_analysis_task(
  15. track: ProgressTracker,
  16. log: PipelineLogger,
  17. config: Dict[str, Any],
  18. state: Dict[str, Any],
  19. ) -> None:
  20. """Run every registered analysis over the working directory's evaluations."""
  21. analysis.run_all(
  22. work_dir=pl.Path(config["work_dir"]),
  23. log=log,
  24. config=config,
  25. progress=track,
  26. )