xarray_einstats.linalg._einsum_parent#

xarray_einstats.linalg._einsum_parent(dims, *operands, keep_dims=frozenset({}))[source]#

Preprocess inputs to call numpy.einsum or numpy.einsum_path.

Parameters
dimslist of list of str

List of lists of dimension names. It must have the same length or be only one item longer than operands. If both have the same length, the generated pattern passed to {func}`numpy.einsum` won’t have -> nor right hand side. Otherwise, the last item is assumed to be the dimension specification of the output DataArray, and it can be an empty list to add -> but no subscripts.

operandsxarray.DataArray

DataArrays for the operation. Multiple DataArrays are accepted.

keep_dimsset, optional

Dimensions to exclude from summation unless specifically specified in dims