Return (definition.json, workload.jsonl, config.json?, solution.json?) inside a problem directory.
(
problem_dir: Path,
)
| 81 | |
| 82 | |
| 83 | def _resolve_problem_dir( |
| 84 | problem_dir: Path, |
| 85 | ) -> tuple[Path, Path, Optional[Path], Optional[Path]]: |
| 86 | """Return (definition.json, workload.jsonl, config.json?, solution.json?) inside a problem directory.""" |
| 87 | def_path = problem_dir / "definition.json" |
| 88 | wkl_path = problem_dir / "workload.jsonl" |
| 89 | cfg_path = problem_dir / "config.json" |
| 90 | sol_path = problem_dir / "solution.json" |
| 91 | if not def_path.exists(): |
| 92 | raise click.ClickException(f"definition.json not found in {problem_dir}") |
| 93 | if not wkl_path.exists(): |
| 94 | raise click.ClickException(f"workload.jsonl not found in {problem_dir}") |
| 95 | return ( |
| 96 | def_path, |
| 97 | wkl_path, |
| 98 | cfg_path if cfg_path.exists() else None, |
| 99 | sol_path if sol_path.exists() else None, |
| 100 | ) |
| 101 | |
| 102 | |
| 103 | def _print_traces_table(traces: list[Trace]) -> None: |