Recombine the applied objects like the original.
(self, applied, shortcut=False)
| 1679 | return self.map(func, shortcut=shortcut, args=args, **kwargs) |
| 1680 | |
| 1681 | def _combine(self, applied, shortcut=False): |
| 1682 | """Recombine the applied objects like the original.""" |
| 1683 | applied_example, applied = peek_at(applied) |
| 1684 | dim, positions = self._infer_concat_args(applied_example) |
| 1685 | if shortcut: |
| 1686 | combined = self._concat_shortcut(applied, dim, positions) |
| 1687 | else: |
| 1688 | combined = concat( |
| 1689 | applied, |
| 1690 | dim, |
| 1691 | data_vars="all", |
| 1692 | coords="different", |
| 1693 | compat="equals", |
| 1694 | join="outer", |
| 1695 | ) |
| 1696 | combined = _maybe_reorder(combined, dim, positions, N=self.group1d.size) |
| 1697 | |
| 1698 | if isinstance(combined, type(self._obj)): |
| 1699 | # only restore dimension order for arrays |
| 1700 | combined = self._restore_dim_order(combined) |
| 1701 | # assign coord and index when the applied function does not return that coord |
| 1702 | if dim not in applied_example.dims: |
| 1703 | combined = combined.assign_coords(self.encoded.coords) |
| 1704 | combined = self._maybe_unstack(combined) |
| 1705 | combined = self._maybe_reindex(combined) |
| 1706 | return combined |
| 1707 | |
| 1708 | def reduce( |
| 1709 | self, |
no test coverage detected