(value, dtype=None)
| 615 | |
| 616 | |
| 617 | def normalize_label(value, dtype=None) -> np.ndarray: |
| 618 | if getattr(value, "ndim", 1) <= 1: |
| 619 | value = _asarray_tuplesafe(value) |
| 620 | if dtype is not None and dtype.kind == "f" and value.dtype.kind != "b": |
| 621 | # pd.Index built from coordinate with float precision != 64 |
| 622 | # see https://github.com/pydata/xarray/pull/3153 for details |
| 623 | # bypass coercing dtype for boolean indexers (ignore index) |
| 624 | # see https://github.com/pydata/xarray/issues/5727 |
| 625 | value = np.asarray(value, dtype=dtype) |
| 626 | return value |
| 627 | |
| 628 | |
| 629 | def as_scalar(value: np.ndarray): |
no test coverage detected
searching dependent graphs…