MCPcopy
hub / github.com/pydata/xarray / _combine

Method _combine

xarray/core/groupby.py:1852–1870  ·  view source on GitHub ↗

Recombine the applied objects like the original.

(self, applied)

Source from the content-addressed store, hash-verified

1850 return self.map(func, shortcut=shortcut, args=args, **kwargs)
1851
1852 def _combine(self, applied):
1853 """Recombine the applied objects like the original."""
1854 applied_example, applied = peek_at(applied)
1855 dim, positions = self._infer_concat_args(applied_example)
1856 combined = concat(
1857 applied,
1858 dim,
1859 data_vars="all",
1860 coords="different",
1861 compat="equals",
1862 join="outer",
1863 )
1864 combined = _maybe_reorder(combined, dim, positions, N=self.group1d.size)
1865 # assign coord when the applied function does not return that coord
1866 if dim not in applied_example.dims:
1867 combined = combined.assign_coords(self.encoded.coords)
1868 combined = self._maybe_unstack(combined)
1869 combined = self._maybe_reindex(combined)
1870 return combined
1871
1872 def reduce(
1873 self,

Callers 2

mapMethod · 0.95
mapMethod · 0.45

Calls 7

peek_atFunction · 0.90
concatFunction · 0.90
_maybe_reorderFunction · 0.85
_infer_concat_argsMethod · 0.80
_maybe_unstackMethod · 0.80
_maybe_reindexMethod · 0.80
assign_coordsMethod · 0.45

Tested by

no test coverage detected