Function
write_rows
(path: Path, rows: Iterable[dict])
Source from the content-addressed store, hash-verified
| 257 | |
| 258 | |
| 259 | def write_rows(path: Path, rows: Iterable[dict]) -> None: |
| 260 | fieldnames = [ |
| 261 | "frames", |
| 262 | "status", |
| 263 | "requested_height", |
| 264 | "requested_width", |
| 265 | "effective_height", |
| 266 | "effective_width", |
| 267 | "backend", |
| 268 | "dtype", |
| 269 | "seconds", |
| 270 | "peak_allocated_gib", |
| 271 | "peak_reserved_gib", |
| 272 | "error", |
| 273 | ] |
| 274 | path.parent.mkdir(parents=True, exist_ok=True) |
| 275 | with path.open("w", newline="") as f: |
| 276 | writer = csv.DictWriter(f, fieldnames=fieldnames) |
| 277 | writer.writeheader() |
| 278 | writer.writerows(rows) |
| 279 | |
| 280 | |
| 281 | def main() -> None: |
Tested by
no test coverage detected