cupy-xarray
[!IMPORTANT] ⚠️ This project is looking for maintainers and contributors. Come help out!
Interface for using cupy in xarray, providing convenience accessors.
Installation
cupy-xarraywill use an existing cupy installation, hence cupy needs to be installed manually! Please follow cupy's install instructions at https://docs.cupy.dev/en/stable/install.html.
From anaconda:
conda install cupy-xarray -c conda-forge
From PyPI:
pip install cupy-xarray
The latest version from Github:
pip install git+https://github.com/xarray-contrib/cupy-xarray.git
Usage
import xarray as xr
import cupy_xarray # This registers the `DataSet.cupy` and `DataArray.cupy` namespaces but is not used directly
ds = xr.tutorial.load_dataset("air_temperature.nc")
type(ds.air.data) # numpy.ndarray
%timeit ds.air.mean() # 8.56 ms ± 15.6 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
ds = ds.cupy.as_cupy() # Also available via convenience method ds.as_cupy()
type(ds.air.data) # cupy.core.core.ndarray
%timeit ds.air.mean() # 2.14 ms ± 21.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
ds = ds.as_numpy()
type(ds.air.data) # numpy.ndarray
Metadata
Release files for cupy-xarray 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cupy_xarray-0.1.5.tar.gz | 26.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cupy_xarray-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.2 kB
Release files / cupy_xarray-0.1.5.tar.gz
| Download URL | cupy_xarray-0.1.5.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87ed31c49fb538f793c6ded8ecb6bd056bafe02e17dc686551b945e26f64c2e4
|
|
BLAKE2b-256 checksum How to use checksums |
ab4c54e83a5f0fb4c3e42a6578fe98f16d03928c99ab5f5626dc030b94f88927
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / cupy_xarray-0.1.5-py3-none-any.whl
| Download URL | cupy_xarray-0.1.5-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96772b88070d81e602ddead747cfe41ecb8bcbc9d4939cef43e67571748397e1
|
|
BLAKE2b-256 checksum How to use checksums |
ceccd0f2a4908769578ddf352a266f6e1cd03e85c9ed55daac3c0d74a854452e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|