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

Function _maybe_transpose_dims

xarray/testing/assertions.py:93–100  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

91 __tracebackhide__ = True
92
93 def _maybe_transpose_dims(a, b):
94 if not isinstance(a, Variable | DataArray | Dataset):
95 return b
96 if set(a.dims) == set(b.dims):
97 # Ensure transpose won't fail if a dimension is missing
98 # If this is the case, the difference will be caught by the caller
99 return b.transpose(*a.dims)
100 return b
101
102 if check_dim_order:
103 return b

Callers 1

maybe_transpose_dimsFunction · 0.85

Calls 1

transposeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…