(path: Path, rows: list[dict[str, Any]])
| 215 | |
| 216 | |
| 217 | def _write_csv(path: Path, rows: list[dict[str, Any]]) -> None: |
| 218 | fieldnames: list[str] = [] |
| 219 | for row in rows: |
| 220 | for key in row: |
| 221 | if key not in fieldnames: |
| 222 | fieldnames.append(key) |
| 223 | |
| 224 | with path.open("w", newline="", encoding="utf-8") as stream: |
| 225 | writer = csv.DictWriter(stream, fieldnames=fieldnames) |
| 226 | writer.writeheader() |
| 227 | for row in rows: |
| 228 | writer.writerow(row) |
| 229 | |
| 230 | |
| 231 | def _write_matrix_csv(path: Path, row_label: str, matrix: dict[str, Any]) -> None: |
no outgoing calls
no test coverage detected