Load all result rows for a kernel. Returns empty list if no file.
(kernel_file: str)
| 225 | |
| 226 | |
| 227 | def _load_result_rows(kernel_file: str) -> list[dict]: |
| 228 | """Load all result rows for a kernel. Returns empty list if no file.""" |
| 229 | path = _kernel_results_path(kernel_file) |
| 230 | if not path.exists(): |
| 231 | return [] |
| 232 | rows: list[dict] = [] |
| 233 | with open(path, "r", encoding="utf-8") as f: |
| 234 | header_line = f.readline().strip() |
| 235 | if not header_line: |
| 236 | return [] |
| 237 | cols = header_line.split("\t") |
| 238 | for line in f: |
| 239 | line = line.strip() |
| 240 | if not line: |
| 241 | continue |
| 242 | parts = line.split("\t") |
| 243 | row = {} |
| 244 | for i, col in enumerate(cols): |
| 245 | row[col] = parts[i] if i < len(parts) else "" |
| 246 | rows.append(row) |
| 247 | return rows |
| 248 | |
| 249 | |
| 250 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected