MCPcopy Create free account
hub / github.com/pydata/xarray / check_reduce_dims

Function check_reduce_dims

xarray/core/groupby.py:79–88  ·  view source on GitHub ↗
(reduce_dims, dimensions)

Source from the content-addressed store, hash-verified

77
78
79def check_reduce_dims(reduce_dims, dimensions):
80 if reduce_dims is not ...:
81 if is_scalar(reduce_dims):
82 reduce_dims = [reduce_dims]
83 if any(dim not in dimensions for dim in reduce_dims):
84 raise ValueError(
85 f"cannot reduce over dimensions {reduce_dims!r}. expected either '...' "
86 f"to reduce over all dimensions or one or more of {dimensions!r}. "
87 f"Alternatively, install the `flox` package. "
88 )
89
90
91def _codes_to_group_indices(codes: np.ndarray, N: int) -> GroupIndices:

Callers 2

reduceMethod · 0.85
reduceMethod · 0.85

Calls 1

is_scalarFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…