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

Method compute

xarray/core/variable.py:1058–1088  ·  view source on GitHub ↗

Trigger loading data into memory and return a new variable. Data will be computed and/or loaded from disk or a remote source. The original variable is left unaltered. Normally, it should not be necessary to call this method in user code, because all xarray function

(self, **kwargs)

Source from the content-addressed store, hash-verified

1056 return self
1057
1058 def compute(self, **kwargs) -> Self:
1059 """Trigger loading data into memory and return a new variable.
1060
1061 Data will be computed and/or loaded from disk or a remote source.
1062
1063 The original variable is left unaltered.
1064
1065 Normally, it should not be necessary to call this method in user code,
1066 because all xarray functions should either work on deferred data or
1067 load data automatically.
1068
1069 Parameters
1070 ----------
1071 **kwargs : dict
1072 Additional keyword arguments passed on to ``dask.array.compute``.
1073
1074 Returns
1075 -------
1076 object : Variable
1077 New object with the data as an in-memory array.
1078
1079 See Also
1080 --------
1081 dask.array.compute
1082 Variable.load
1083 Variable.load_async
1084 DataArray.compute
1085 Dataset.compute
1086 """
1087 new = self.copy(deep=False)
1088 return new.load(**kwargs)
1089
1090 def _shuffle(
1091 self, indices: list[list[int]], dim: Hashable, chunks: T_Chunks

Callers 3

test_pickleMethod · 0.95
test_getitem_fancyMethod · 0.95

Calls 2

copyMethod · 0.45
loadMethod · 0.45

Tested by 3

test_pickleMethod · 0.76
test_getitem_fancyMethod · 0.76