Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

annoray

Annotated arrays: the xarray data model with first-class physical units, implemented in Rust (PyO3). I/O uses pure-Rust netCDF-3, netCDF-4, HDF5 and Zarr (v2/v3, open_zarr/to_zarr) backends; the runtime dependencies are NumPy and matplotlib. Wheels use the stable ABI: one per platform for CPython 3.11 and later.

  • Labelled indexing and alignment: isel, sel (exact, nearest, pad, backfill; pointwise with DataArray indexers), query, name-based broadcasting, groupby, resample, convert_calendar, rolling, rolling_exp, coarsen, weighted, interp, interpolate_na, stack/unstack, concat, merge, DataTree.
  • Computation: quantiles, corr/cov, differentiate/integrate/polyfit, numpy ufuncs and apply_ufunc, the .str accessor, all unit-aware.
  • Immutable values, checked updates: da[...] = v is refused; da.put(v, time=3) and da.put_sel(v, time="2001-07-01") return an updated copy, converting v into the array's unit and refusing values that do not fit its element type. Containers are assignable: ds["v"] = ..., ds.coords[...] = ..., and attrs/encoding are live dicts.
  • Units: binary operations check dimensional consistency and propagate units; .to(...) converts exactly; CF units attributes decode into units.
  • Out-of-core evaluation: lazy memory-mapped open; lazy elementwise composition and streaming reductions within a configurable memory budget (set_stream_bytes), including disk-to-disk pipelines.
  • Dimension annotations: Quantity[Velocity] / DataArray[Velocity] type hints, enforced at call time by @checked; derived dimensions are declared as Dim subclasses.
  • Zero-copy NumPy interop: .values exposes the Rust buffer as a read-only array; text is NumPy fixed-width <U{n}.
  • Performance: parallel kernels and chunk decoding; faster than xarray (with bottleneck, flox, numbagg and dask) in most operations on large files, with one copy of the data on load and streaming reductions in a few hundred MB (benchmarks).
  • astropy interop (annoray[astropy]): to_astropy() on units, quantities and arrays; from_astropy(...); astropy units accepted wherever units are. Units correspond through their SI-plus-radian decomposition (angle is a dimension in both); names are kept only where both systems define them identically (UDUNITS' yr is the tropical year, astropy's the Julian year); °C/°F map to deg_C/deg_F.
  • matplotlib plotting: da.plot() dispatching on rank, line, step, hist, scatter, pcolormesh, imshow (incl. RGB), contour, contourf, surface; ds.plot.scatter/quiver/streamplot; row/col faceting via FacetGrid with a shared colour scale. Semantics follow xarray.plot (CF-derived labels, robust/divergent colormap heuristics, discrete levels, interval inference); labels carry the array's unit.

Pre-1.0: the API is unstable.

pip install annoray            # extras: "annoray[xarray]", "annoray[astropy]"
import numpy as np
import annoray as ar

da = ar.DataArray(
    np.arange(6.0).reshape(2, 3),
    dims=("x", "y"),
    coords={"x": [10.0, 20.0], "y": [1.0, 2.0, 3.0]},
    units="m",
)
seconds = ar.DataArray(2.0, units="s")
print((da / seconds).units)  # m s-1
print(da.sel(y=2.4, method="nearest").mean("x").to("cm").values)
try:
    da + seconds
except ar.UnitError as e:  # dimensionally inconsistent
    print(e)

ds = ar.open_dataset("air_temperature.nc")  # lazy, memory-mapped
point = ds["air"].sel(lat=40.0, lon=260.0, method="nearest")
print(point.max("time").to("degC"))

xarray is optional. When present, annoray registers an xarray backend (engine="annoray") and provides to_xarray() / from_xarray() conversion (units map to the units attribute) and ar.to_netcdf(obj, path) for writing xarray objects with annoray's writers.

Most xarray code runs unchanged with import annoray as ar. The deliberate differences (unit-checked comparisons and fills, no unchecked casts, immutable values, single-coordinate indexes, eager computation instead of dask) are listed in differences from xarray.

Further examples: examples/ (each paired with a Rust twin of identical output).

License

Dual-licensed under Apache-2.0 or MIT, at the licensee's option.

Metadata

Release files for annoray 0.0.1rc1

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

Source distribution (sdist)

Source distribution for annoray 0.0.1rc1
File Size Uploaded Provenance
annoray-0.0.1rc1.tar.gz 889.6 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for annoray 0.0.1rc1
File
annoray-0.0.1rc1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
annoray-0.0.1rc1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
annoray-0.0.1rc1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 30.9 MB

Release files / annoray-0.0.1rc1.tar.gz

Download URL annoray-0.0.1rc1.tar.gz
Size 889.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9074f564846c09e22747a798fabef6ce82983ebe1bb1340a67441c03b5512f6d
BLAKE2b-256 checksum
How to use checksums
767697e6d2730de7652d860db7e9863214f83edfe266c422a98a87340756a5e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annoray-0.0.1rc1-cp311-abi3-win_amd64.whl

Download URL annoray-0.0.1rc1-cp311-abi3-win_amd64.whl
Size 5.9 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cf6673986ef43eb3287d10d2d5dc751d3add8bfbf5c8c9f1f794b8909379ef1d
BLAKE2b-256 checksum
How to use checksums
5c0e60d2f81760c11c3598e93a9db61009790d488cc4d43274d445211b9d5f33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b67430bf948b73c85a79b27e172f7b3d65e4fc911c95421da08d186e781a4d70
BLAKE2b-256 checksum
How to use checksums
52b0847c4ec3224f698f44e273f85e4ae2669474fa241ea3c95f22a39d36b612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL annoray-0.0.1rc1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.2 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cf8199b1780f42d6978d60bdd3b557f76186dbfb9fb24e2ffc1214c24ea65ad9
BLAKE2b-256 checksum
How to use checksums
a413d34c2ced1c2aa6bab462c59c3501d6808e7fe3772776fab0d2f8cef635eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annoray-0.0.1rc1-cp311-abi3-macosx_11_0_arm64.whl

Download URL annoray-0.0.1rc1-cp311-abi3-macosx_11_0_arm64.whl
Size 5.7 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
56fd06ebec62e908d54cde11d473470d4cc262799f3e6dd9f645f126ed82993d
BLAKE2b-256 checksum
How to use checksums
24d1760fc78471ab0b91ddf344013a5a8463ae4d997704a4480e931b277c20e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / annoray-0.0.1rc1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL annoray-0.0.1rc1-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.0 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
06470fe698e35908cdc2268ced063247bd0b74ca42fd80c3653b5992f0f7d7f4
BLAKE2b-256 checksum
How to use checksums
16d78b402583a3acad5786597cd890c01f853eafcf4ca0c597fb31bd549ee569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for annoray 0.0.1rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for annoray-0.0.1rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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