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

Method _concat_shortcut

xarray/core/groupby.py:1586–1595  ·  view source on GitHub ↗
(self, applied, dim, positions=None)

Source from the content-addressed store, hash-verified

1584 yield var[{self._group_dim: indices}]
1585
1586 def _concat_shortcut(self, applied, dim, positions=None):
1587 # nb. don't worry too much about maintaining this method -- it does
1588 # speed things up, but it's not very interpretable and there are much
1589 # faster alternatives (e.g., doing the grouped aggregation in a
1590 # compiled language)
1591 # TODO: benbovy - explicit indexes: this fast implementation doesn't
1592 # create an explicit index for the stacked dim coordinate
1593 stacked = Variable.concat(applied, dim, shortcut=True)
1594 reordered = _maybe_reorder(stacked, dim, positions, N=self.group1d.size)
1595 return self._obj._replace_maybe_drop_dims(reordered)
1596
1597 def _restore_dim_order(self, stacked: DataArray) -> DataArray:
1598 def lookup_order(dimension):

Callers 1

_combineMethod · 0.95

Calls 3

_maybe_reorderFunction · 0.85
concatMethod · 0.45

Tested by

no test coverage detected