Interface for using cubed with xarray for parallel computation.
Project description
Note: this is a proof-of-concept, and many things are incomplete, untested, or don't work.
cubed-xarray
Interface for using cubed with xarray.
Requirements
- Cubed version >=0.6.3
- Xarray version >=2023.05.0
Installation
Install via pip.
Importing
You don't need to import this package in user code. Once pip install
-ed, xarray should automatically become aware of this package via the magic of entrypoints.
Usage
Xarray objects backed by cubed arrays can be created either by:
- Passing existing
cubed.Array
objects to thedata
argument of xarray constructors, - Calling
.chunk
on xarray objects, - Passing a
chunks
argument toxarray.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
then pass them via the dictionary from_array_kwargs
, e.g. from_array_kwargs={'spec': cubed.Spec(max_mem=2_000_000)}
.
If cubed and cubed-xarray are installed but dask is not, then specifying the parallel array type to use is not necessary, as the entrypoints system will then default to the only chunked parallel backend available (i.e. cubed).
Tests
Integration tests for wrapping cubed with xarray also live in this repository.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cubed-xarray-0.0.4.tar.gz
.
File metadata
- Download URL: cubed-xarray-0.0.4.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0844fd0425077ce65c2300926283357c551f4a4b5e5dc6fd8f96fe28254adc94 |
|
MD5 | 7e757adcb18ff197789af33c6b06a38a |
|
BLAKE2b-256 | 4140b530ccf51f80a40b119fdb2200392dcdb00a5f174ff0e631071120636d4e |
File details
Details for the file cubed_xarray-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: cubed_xarray-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80627769dfe2dc5e0c4555febad28467ed777c47413b797b30c5026e919098d0 |
|
MD5 | 5eea4251a243143ba717cd8cba42d805 |
|
BLAKE2b-256 | 7fb9247e881fdfc1d36cfa6ee4a860e4d0636d934455bf5fd34175cc8bc65451 |