Skip to main content

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.23.0
  • Xarray version >=2024.09.0

Installation

Install via pip

pip install cubed-xarray

or conda

conda install -c conda-forge cubed-xarray

Importing

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.

Usage

Xarray objects backed by cubed arrays can be created either by:

  1. Passing existing cubed.Array objects to the data argument of xarray constructors,
  2. Calling .chunk on xarray objects,
  3. Passing a 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).

Sharp Edges 🔪

Some things almost certainly won't work yet:

and some other things might work but have not yet been tried:

  • Saving to formats other than zarr

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.

Tests

Integration tests for wrapping cubed with xarray also live in this repository.

Metadata

Release files for cubed-xarray 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubed-xarray 0.0.9
File Size Uploaded
cubed_xarray-0.0.9.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cubed-xarray 0.0.9
File Interpreter ABI Platform
cubed_xarray-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 37.1 kB

Release files / cubed_xarray-0.0.9.tar.gz

Download URL cubed_xarray-0.0.9.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ff1064199c248f78e1a79ca91f5effc8e6854ad47ba45d2d32a5d4f5c26f5482
BLAKE2b-256 checksum
How to use checksums
20d940381f32f73fccc9ab26a642ab49dfa328748db096447edd13e86597e753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / cubed_xarray-0.0.9-py3-none-any.whl

Download URL cubed_xarray-0.0.9-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5c90feb6ff3194991a8f7c14059dd01eb7c3222b8b259a071830a7f9a5c9127
BLAKE2b-256 checksum
How to use checksums
eb3fc33fbb5349a202320b4e1b28ce4eeb0560f8823052a00cdd80ff39729c6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page