Trigger loading data into memory and return a new dataset. Data will be computed and/or loaded from disk or a remote source. Unlike ``.load``, the original dataset is left unaltered. Normally, it should not be necessary to call this method in user code, because all
(self, **kwargs)
| 770 | ) |
| 771 | |
| 772 | def compute(self, **kwargs) -> Self: |
| 773 | """Trigger loading data into memory and return a new dataset. |
| 774 | |
| 775 | Data will be computed and/or loaded from disk or a remote source. |
| 776 | |
| 777 | Unlike ``.load``, the original dataset is left unaltered. |
| 778 | |
| 779 | Normally, it should not be necessary to call this method in user code, |
| 780 | because all xarray functions should either work on deferred data or |
| 781 | load data automatically. However, this method can be necessary when |
| 782 | working with many file objects on disk. |
| 783 | |
| 784 | Parameters |
| 785 | ---------- |
| 786 | **kwargs : dict |
| 787 | Additional keyword arguments passed on to ``dask.compute``. |
| 788 | |
| 789 | Returns |
| 790 | ------- |
| 791 | object : Dataset |
| 792 | New object with lazy data variables and coordinates as in-memory arrays. |
| 793 | |
| 794 | See Also |
| 795 | -------- |
| 796 | dask.compute |
| 797 | Dataset.load |
| 798 | Dataset.load_async |
| 799 | DataArray.compute |
| 800 | Variable.compute |
| 801 | """ |
| 802 | new = self.copy(deep=False) |
| 803 | return new.load(**kwargs) |
| 804 | |
| 805 | def _persist_inplace(self, **kwargs) -> Self: |
| 806 | """Persist all chunked arrays in memory.""" |