(self, key)
| 731 | ) |
| 732 | |
| 733 | def _broadcast_indexes_outer(self, key): |
| 734 | # drop dim if k is integer or if k is a 0d dask array |
| 735 | dims = tuple( |
| 736 | k.dims[0] if isinstance(k, Variable) else dim |
| 737 | for k, dim in zip(key, self.dims, strict=True) |
| 738 | if (not isinstance(k, integer_types) and not is_0d_dask_array(k)) |
| 739 | ) |
| 740 | |
| 741 | new_key = [] |
| 742 | for k in key: |
| 743 | if isinstance(k, Variable): |
| 744 | k = k.data |
| 745 | if not isinstance(k, BASIC_INDEXING_TYPES): |
| 746 | if not is_duck_array(k): |
| 747 | k = np.asarray(k) |
| 748 | if k.size == 0: |
| 749 | # Slice by empty list; numpy could not infer the dtype |
| 750 | k = k.astype(int) |
| 751 | elif k.dtype.kind == "b": |
| 752 | (k,) = np.nonzero(k) |
| 753 | new_key.append(k) |
| 754 | |
| 755 | return dims, OuterIndexer(tuple(new_key)), None |
| 756 | |
| 757 | def _broadcast_indexes_vectorized(self, key): |
| 758 | variables = [] |
no test coverage detected