Skip to main content

Rust-backed xarray DataTree backend for fast Zarr access from object storage

Project description

rustytree

Rust-backed xarray DataTree backend for fast Zarr (incl. icechunk) access from object storage.

rustytree registers as xr.open_datatree(engine="rustytree") and walks Zarr v3 hierarchies — both icechunk-backed and vanilla — concurrently in async across one FFI crossing. The goal is a drop-in faster replacement for xr.open_datatree(engine="zarr"), especially on icechunk repos served from object storage where xarray's current per-group sequential decoding is the dominant cost.

Status

Alpha. xr.open_datatree(..., engine="rustytree") works end-to-end against both icechunk repositories (pass session.store) and vanilla Zarr v3 stores (path or s3:// URL). Lazy chunk reads via RustyBackendArray, CF decoding (incl. metadata-only datetime dtype inference), the recursive multi-node walk, glob group= filtering, and non-recursive single-Dataset opens are all in. See CHANGELOG.md for the per-PR breakdown.

Install from PyPI (the import name stays rustytree; the distribution name on PyPI is rustytree-xarray because rustytree collides with an unrelated dormant package):

pip install rustytree-xarray

Or install from source per Quick start below.

Example

Open the public anonymous NEXRAD KLOT icechunk repo on S3:

import icechunk
import xarray as xr

storage = icechunk.s3_storage(
    bucket="nexrad-arco", prefix="KLOT",
    region="us-east-1", anonymous=True,
)
session = icechunk.Repository.open(storage).readonly_session("main")

# Open the full DataTree (107 nodes — every VCP × sweep combination).
dt = xr.open_datatree(session.store, engine="rustytree")

# Or grab one specific sweep as a flat Dataset (skips walking siblings):
ds = xr.open_dataset(session.store, engine="rustytree",
                     group="/VCP-12/sweep_0")

# Or apply a glob pattern. "Give me sweep_0 from every VCP" is the
# canonical radar workflow — returns a tree filtered to those matches,
# with the VCP container groups auto-included as ancestors.
sweeps_0 = xr.open_datatree(session.store, engine="rustytree",
                            group="/*/sweep_0")

engine="rustytree" is a drop-in replacement for engine="zarr" — same xr.open_datatree / xr.open_dataset entry points, same storage_options / decode_* kwargs. The full demo (with side-by-side timings against engine="zarr") is in notebooks/klot_demo.ipynb.

Quick start

rustytree is a Rust extension built via maturin; uv sync handles the venv, Python deps, and the Rust build (via maturin's PEP 517 hook) in one command.

# Clone + enter the repo
git clone https://github.com/aladinor/rustytree.git
cd rustytree

# Install everything: venv, deps, and the compiled Rust extension.
uv sync --extra dev

# Confirm the install
.venv/bin/pytest tests/

# Launch Jupyter and open the demo notebook
.venv/bin/jupyter lab notebooks/klot_demo.ipynb

The notebooks and tests don't require AWS credentials — KLOT is read anonymously via icechunk's anonymous S3 path. Network speed determines cold-cache timings (expect ~1–3 s for engine="rustytree" on KLOT from a home connection; ~50 s for engine="zarr" on the same).

Documentation

License

Apache License 2.0 (Apache-2.0).

Acknowledgements

Built on zarrs + zarrs_icechunk + icechunk. Sibling project radish proved the PyO3 + xarray-backend pattern. The bottlenecks this project sets out to collapse are tracked in xarray PRs #10742, #11304, and #11302.

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

rustytree_xarray-0.1.0.tar.gz (137.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

rustytree_xarray-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (10.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

rustytree_xarray-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (10.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file rustytree_xarray-0.1.0.tar.gz.

File metadata

  • Download URL: rustytree_xarray-0.1.0.tar.gz
  • Upload date:
  • Size: 137.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rustytree_xarray-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b5b44dc39d8131bc5fc9e4e0bec994224d5e39eb20d6c474e7bf174eb85a79e
MD5 d28f50ae840faea2eb1d8c72fbe9e231
BLAKE2b-256 c05b67eacc96aabd690f3727ee1df9104f303468defd10cfb8b66fa721d90493

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0.tar.gz:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a0e42c0e7da29f17173d088df2400ef6c9c253a2fa05e8b699a26d3c9407a14
MD5 1977f902a26adba374c7e7013ff858d1
BLAKE2b-256 fbd72f427da527f37e3d51ae8b2a1141f92844eed685c2d783d6355663deb3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c2183882d0b58b2cc369ef0bdd248cc01708deaba81999042b38c11a3a770b09
MD5 306f8c40cb4df1b3a7f1b75d8ae9ca4e
BLAKE2b-256 04697d951b1b209f0745cdbacee9db027c686e6ab27cf57691fd337a9364776e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b379b1e2f0e235fdeea657f1f963b1f3907abe15dec65cfdc9659ebeef5bf0bd
MD5 ef27d99fce380a1e9de2bd3daa80f236
BLAKE2b-256 6a0bc4b930064893bd000d04b8d4d357dab88f37295bdda6d76ff387c2f5c9de

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 690866eb4e090d8eb0eafdb944de483fb2509bd52be6968034ef180752502ccd
MD5 6ffa3be5a778e7503b784ebd78f7cd96
BLAKE2b-256 5313d0c5aadb7a81e1817abd8a837e73cdfad527bdfadfae925294ca04721759

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3e9c9b81b8945ffaa024720927ec2f19d06363b16938e3cce1039bf1b40d4d4d
MD5 a3fa8e5e6e4a705b87ad15582a79675a
BLAKE2b-256 18fdc7f3f136c4d4eba405268075d334fe63be9a8ee36b1070fed94c7ea9d835

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustytree_xarray-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08cd584ed0b99ea385de0dbe38ca4fda3d8551f18af224bf3568f3e4340b45f9
MD5 40575d4de82976a2170eb33d9ee56181
BLAKE2b-256 9d54d4b454eec5b1b8bcb2d6f875432772d2c2807548d3181286d0322160e12c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on aladinor/rustytree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page