(
entries: List[Dict[str, Any]], meta_path: Path, eval_field: str
)
| 116 | |
| 117 | |
| 118 | def list_motion_samples( |
| 119 | entries: List[Dict[str, Any]], meta_path: Path, eval_field: str |
| 120 | ) -> List[Tuple[int, Path]]: |
| 121 | samples: List[Tuple[int, Path]] = [] |
| 122 | for entry in entries: |
| 123 | eval_path = entry.get(eval_field) |
| 124 | if eval_path is None: |
| 125 | raise KeyError(f"Missing '{eval_field}' in meta entry id={entry.get('id')}") |
| 126 | path = resolve_repo_path(meta_path, str(eval_path)) |
| 127 | if not path.exists(): |
| 128 | raise FileNotFoundError(f"Missing eval cache: {path}") |
| 129 | # Prefer unique global_id; fall back to id if absent |
| 130 | motion_id_raw = entry.get("global_id", entry.get("id")) |
| 131 | if motion_id_raw is None: |
| 132 | raise KeyError("Entry missing both 'global_id' and 'id'") |
| 133 | try: |
| 134 | motion_id = int(motion_id_raw) |
| 135 | except Exception: |
| 136 | motion_id = motion_id_raw |
| 137 | samples.append((motion_id, path)) |
| 138 | return samples |
| 139 | |
| 140 | |
| 141 | def compute_metrics_for_dimension( |
no test coverage detected