Note: this is a proof-of-concept, and many things are incomplete, untested, or don't work.
Interface for using cubed with xarray.
Install via pip
pip install cubed-xarray
or conda
conda install -c conda-forge cubed-xarray
You don't need to import this package in user code. Once poperly installed, xarray should automatically become aware of this package via the magic of entrypoints.
Xarray objects backed by cubed arrays can be created either by:
cubed.Array
objects to the data
argument of xarray constructors,.chunk
on xarray objects,chunks
argument to xarray.open_dataset
.In (2) and (3) the choice to use cubed.Array
instead of dask.array.Array
is made by passing the keyword argument chunked_array_type='cubed'
. To pass arguments to the constructor of cubed.Array
you should pass them via the dictionary from_array_kwargs
, e.g. from_array_kwargs={'spec': cubed.Spec(allowed_mem='2GB')}
.
If cubed and cubed-xarray are installed but dask is not, then specifying chunked_array_type
is not necessary, as the entrypoints system will then default to the only chunked parallel backend available (i.e. cubed).
Some things almost certainly won't work yet:
pad
(see cubed-dev/cubed#193)skipna=True
to avoid eager loading (see pydata/xarray#7243)parallel=True
with xr.open_mfdataset
won't work because cubed doesn't implement a version of dask.Delayed
(see pydata/xarray#7810)xarray.map_blocks
does not actually dispatch to cubed.map_blocks
yet, and will always use Dask.cumreduction
(e.g. ffill
and bfill
) are not hooked up to the ChunkManager
yet, so will attempt to call dask.and some other things might work but have not yet been tried:
In general a bug could take the form of an error, or of a silent attempt to coerce the array type to numpy by immediately computing the underlying array.
Integration tests for wrapping cubed with xarray also live in this repository.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4