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

Method _shuffle

xarray/core/variable.py:1090–1106  ·  view source on GitHub ↗
(
        self, indices: list[list[int]], dim: Hashable, chunks: T_Chunks
    )

Source from the content-addressed store, hash-verified

1088 return new.load(**kwargs)
1089
1090 def _shuffle(
1091 self, indices: list[list[int]], dim: Hashable, chunks: T_Chunks
1092 ) -> Self:
1093 # TODO (dcherian): consider making this public API
1094 array = self._data
1095 if is_chunked_array(array):
1096 chunkmanager = get_chunked_array_type(array)
1097 return self._replace(
1098 data=chunkmanager.shuffle(
1099 array,
1100 indexer=indices,
1101 axis=self.get_axis_num(dim),
1102 chunks=chunks,
1103 )
1104 )
1105 else:
1106 return self.isel({dim: np.concatenate(indices)})
1107
1108 def isel(
1109 self,

Callers

nothing calls this directly

Calls 6

_replaceMethod · 0.95
iselMethod · 0.95
is_chunked_arrayFunction · 0.90
get_chunked_array_typeFunction · 0.90
shuffleMethod · 0.45
get_axis_numMethod · 0.45

Tested by

no test coverage detected