(
self,
data: DataArray | None,
width: tuple[float, float, float] | None = None,
_is_facetgrid: bool = False,
)
| 1397 | ) |
| 1398 | |
| 1399 | def __init__( |
| 1400 | self, |
| 1401 | data: DataArray | None, |
| 1402 | width: tuple[float, float, float] | None = None, |
| 1403 | _is_facetgrid: bool = False, |
| 1404 | ) -> None: |
| 1405 | self._data = data |
| 1406 | self._width = width if not _is_facetgrid else None |
| 1407 | |
| 1408 | pint_array_type = DuckArrayModule("pint").type |
| 1409 | to_unique = ( |
| 1410 | data.to_numpy() # type: ignore[union-attr] |
| 1411 | if isinstance(data if data is None else data.data, pint_array_type) |
| 1412 | else data |
| 1413 | ) |
| 1414 | data_unique, data_unique_inverse = np.unique(to_unique, return_inverse=True) # type: ignore[call-overload] |
| 1415 | self._data_unique = data_unique |
| 1416 | self._data_unique_index = np.arange(0, data_unique.size) |
| 1417 | self._data_unique_inverse = data_unique_inverse |
| 1418 | self._data_is_numeric = False if data is None else _is_numeric(data) |
| 1419 | |
| 1420 | def __repr__(self) -> str: |
| 1421 | with np.printoptions(precision=4, suppress=True, threshold=5): |
nothing calls this directly
no test coverage detected