MCPcopy Index your code
hub / github.com/pydata/xarray / _unified_dims

Function _unified_dims

xarray/core/variable.py:3012–3027  ·  view source on GitHub ↗
(variables)

Source from the content-addressed store, hash-verified

3010
3011
3012def _unified_dims(variables):
3013 # validate dimensions
3014 all_dims = {}
3015 for var in variables:
3016 var_dims = var.dims
3017 _raise_if_any_duplicate_dimensions(var_dims, err_context="Broadcasting")
3018
3019 for d, s in zip(var_dims, var.shape, strict=True):
3020 if d not in all_dims:
3021 all_dims[d] = s
3022 elif all_dims[d] != s:
3023 raise ValueError(
3024 "operands cannot be broadcast together "
3025 f"with mismatched lengths for dimension {d!r}: {(all_dims[d], s)}"
3026 )
3027 return all_dims
3028
3029
3030def _broadcast_compat_variables(*variables):

Callers 2

broadcast_variablesFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…