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

Function _raise_if_any_duplicate_dimensions

xarray/namedarray/core.py:1165–1172  ·  view source on GitHub ↗
(
    dims: _Dims, err_context: str = "This function"
)

Source from the content-addressed store, hash-verified

1163
1164
1165def _raise_if_any_duplicate_dimensions(
1166 dims: _Dims, err_context: str = "This function"
1167) -> None:
1168 if len(set(dims)) < len(dims):
1169 repeated_dims = {d for d in dims if dims.count(d) > 1}
1170 raise ValueError(
1171 f"{err_context} cannot handle duplicate dimensions, but dimensions {repeated_dims} appear more than once on this object's dims: {dims}"
1172 )

Callers 3

_get_axis_numMethod · 0.90
_unified_dimsFunction · 0.90
_get_axis_numMethod · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…