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.1rc2

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.1rc2
File Size Uploaded Provenance
annoray-0.0.1rc2.tar.gz 911.6 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for annoray 0.0.1rc2
File
annoray-0.0.1rc2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
annoray-0.0.1rc2-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.1rc2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
annoray-0.0.1rc2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
annoray-0.0.1rc2-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 32.8 MB

Release files / annoray-0.0.1rc2.tar.gz

Download URL annoray-0.0.1rc2.tar.gz
Size 911.6 kB
Tags Source
SHA-256 checksum
How to use checksums
02987a608a14aa794501e39821ab3c708dbb454c76fce4bc2758820fe45c22d3
BLAKE2b-256 checksum
How to use checksums
ed674d64e04770005a8d8dad3e908e27e6bd152c8390157be5d231ec49265988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL annoray-0.0.1rc2-cp311-abi3-win_amd64.whl
Size 6.3 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3bcf6fb5cd3f37304d54c41711bf4c40093fabf96ef9c1b84df7bbb091c98020
BLAKE2b-256 checksum
How to use checksums
2ae5d78fb425b52597e4f401a98f216ed1d0826a5c3933ca283f3a3261eb7bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL annoray-0.0.1rc2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3c590d048a85d059ef54456be5d1232f7fb0ce08a17d6d66289f192466a2e82b
BLAKE2b-256 checksum
How to use checksums
516813d7c334c7f94bff3a394463a44df1f97e0cb21cd35246d8e622f36256b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL annoray-0.0.1rc2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.6 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
680e7027b91834f51bf2c885d6d24327e85ed362d4ae115d89860ec1d62a77ed
BLAKE2b-256 checksum
How to use checksums
510972bf7c2c946212b15dfc1f8f69198fc894f942144676e74334b08920dfc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL annoray-0.0.1rc2-cp311-abi3-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c994a65ededae5c112d3da78d1d03de0178980ae9321c1e7a74191cf9dc9de64
BLAKE2b-256 checksum
How to use checksums
9cf090121211c583b1f82d6ad9d63a6c10ca81f0a670d573de56880d1a1e9d05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL annoray-0.0.1rc2-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fff534832111eddeeafa963717583f378cf68b639433fe51e5228307ddd7798f
BLAKE2b-256 checksum
How to use checksums
0eceeaada06dd596e119c4949da01ebaaf7236fb267c4194689d82ead13a7c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

Security for annoray 0.0.1rc2

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.1rc2.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 24, 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