Optional pandas conversion for downstream tooling.
(df: pl.DataFrame)
| 153 | if len(ind_mat) == 0: |
| 154 | return pl.DataFrame({"bar_index": []}) |
| 155 | width = len(ind_mat[0]) |
| 156 | if any(len(row) != width for row in ind_mat): |
| 157 | raise ValueError("ind_mat must be rectangular") |
| 158 | if label_names is None: |
| 159 | label_names = [f"label_{i}" for i in range(width)] |
| 160 | if len(label_names) != width: |
| 161 | raise ValueError(f"label_names length mismatch: expected {width}, got {len(label_names)}") |
| 162 | if len(set(label_names)) != width or "bar_index" in label_names: |
| 163 | raise ValueError("label_names must be unique and must not contain 'bar_index'") |
| 164 | if bar_index is None: |
| 165 | bar_index = list(range(len(ind_mat))) |
| 166 | _validate_equal_length("bar_index", bar_index, "ind_mat_rows", ind_mat) |
nothing calls this directly
no outgoing calls
no test coverage detected