(path: Path, row_label: str, matrix: dict[str, Any])
| 229 | |
| 230 | |
| 231 | def _write_matrix_csv(path: Path, row_label: str, matrix: dict[str, Any]) -> None: |
| 232 | columns = [row_label] + list(matrix.get("cols", [])) |
| 233 | with path.open("w", newline="", encoding="utf-8") as stream: |
| 234 | writer = csv.DictWriter(stream, fieldnames=columns) |
| 235 | writer.writeheader() |
| 236 | for row_name in matrix.get("rows", []): |
| 237 | row = {row_label: row_name} |
| 238 | row.update(matrix.get("values", {}).get(row_name, {})) |
| 239 | writer.writerow(row) |
no outgoing calls
no test coverage detected