(variant_dir: Path)
| 53 | |
| 54 | |
| 55 | def resolve_model_dirs(results_dir: Path, model: str) -> list[Path]: |
| 56 | """Find all model directories matching the model name, including -trialN suffixes.""" |
| 57 | pattern = re.compile(rf"^{re.escape(model)}(-trial\d+)?$") |
| 58 | return sorted(d for d in results_dir.iterdir() if d.is_dir() and pattern.match(d.name)) |
| 59 | |
| 60 | |
| 61 | def latest_timestamp(variant_dir: Path) -> Path: |
| 62 | dirs = sorted(d for d in variant_dir.iterdir() if d.is_dir() and (d / "summary.csv").exists()) |