Skip to main content

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

Project description

rustytree — Rust-backed xarray DataTree backend

CI PyPI version Python versions License

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.

Compatibility

Surface Supported Not supported
Zarr format v3 only v2 — passing zarr_format=2 or consolidated=True raises NotImplementedError; use stock engine="zarr" for v2 stores
icechunk icechunk>=2.0 (the current major) older icechunk releases
Python 3.12, 3.13 older versions
Platforms manylinux x86_64, manylinux aarch64, macOS arm64 (wheels); other platforms via sdist Windows / macOS Intel / linux musl wheels (build from source via sdist)

Install

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_filter="/*/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.3.0.tar.gz (1.2 MB 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.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rustytree_xarray-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

rustytree_xarray-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (10.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustytree_xarray-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rustytree_xarray-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

rustytree_xarray-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (10.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for rustytree_xarray-0.3.0.tar.gz
Algorithm Hash digest
SHA256 113b66efd62461a4faab009e3a166a6bd95a8b012d1d839b8122858db49f7418
MD5 ccc112c929b2dd9458e35f4f1025c8e8
BLAKE2b-256 0e911c5ca2ba9685ab4521d6ce5b3bd0b22ba3f15eaac2a7f171c93777018525

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdc81461649cb549d24ccead3d86c3e72618a5057f75a3bb49a836e554e40ca4
MD5 36d75afcb389c6864e1681bce0660b0d
BLAKE2b-256 f0cf839a6a41e3e64e4b2c2c1a14aea498e7abb64e78a4fa6dc7c10131c180a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2b18e3a1d224f85654ca913f5751711f5c651d0ddb452c1b5e7c4259b772eb89
MD5 eb3c496683794ef555d3afc494f55f42
BLAKE2b-256 e1ed71b394ec0edea9a4324a975d4ccaf18d9dd67853bdbb7e58af21565abba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af11e1de30ed667a40bbede2ffb2c732581238f6a96ecd313f31840737e27675
MD5 e3b5b1d5a51675564068639597b9e837
BLAKE2b-256 d3d50d9895211faf560dd8261e370c7329e3685d0c779aa1a5ad9998641541d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdea8a4e8d4fd6b11f32367c72782ace400788bd08d71e6d107d960d9538cf4b
MD5 bf80e3097339ad9cd7faae029ea41f09
BLAKE2b-256 0f042bd25b5b087775ee984e34473504d535be761601c1ab255b44fac648e9f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 854be6cc6c225ec87aa2a848683019100e2e17b560bd0d7cfd07bc86a1e800d7
MD5 ed2be4264978f43a00cd77b16bcd835d
BLAKE2b-256 ad0d99595111d35e75157c5c07328605e225ef58047921081c8364e33392ffd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustytree_xarray-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e9803e04b4e0c3b12ab441ca70c1997098be03301926940b1f2b266a2952fb9
MD5 72d4e53d8abeed7f2279312725db56c6
BLAKE2b-256 d74e08a5d761d9ef7455097422e8f93ecb97a94db01b1523975ab484ad519e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustytree_xarray-0.3.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