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 withDataArrayindexers),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 andapply_ufunc, the.straccessor, all unit-aware. - Immutable values, checked updates:
da[...] = vis refused;da.put(v, time=3)andda.put_sel(v, time="2001-07-01")return an updated copy, convertingvinto the array's unit and refusing values that do not fit its element type. Containers are assignable:ds["v"] = ...,ds.coords[...] = ..., andattrs/encodingare live dicts. - Units: binary operations check dimensional consistency and propagate units;
.to(...)converts exactly; CFunitsattributes 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 asDimsubclasses. - Zero-copy NumPy interop:
.valuesexposes 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'yris the tropical year, astropy's the Julian year); °C/°F map todeg_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/colfaceting viaFacetGridwith a shared colour scale. Semantics followxarray.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.1rc0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| annoray-0.0.1rc0.tar.gz | 754.3 kB | Without provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| annoray-0.0.1rc0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| annoray-0.0.1rc0-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.1rc0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| annoray-0.0.1rc0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details |
| annoray-0.0.1rc0-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 27.9 MB
Release files / annoray-0.0.1rc0.tar.gz
| Download URL | annoray-0.0.1rc0.tar.gz |
|---|---|
| Size | 754.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
700c21ca53e99fd0d8e7fdd00e0dc9ab4c845ffe295c9bc3e2c3efbea2114f28
|
|
BLAKE2b-256 checksum How to use checksums |
c66c1bc6c5e99b5f778f71670b429ba0dc4e46d9ca070636a2e64ae97bfd1a99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / annoray-0.0.1rc0-cp311-abi3-win_amd64.whl
| Download URL | annoray-0.0.1rc0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
37d268d490819b4cbe7f0ad9556b148d999c5ef2a2189376bd0d3729ea557173
|
|
BLAKE2b-256 checksum How to use checksums |
74e194273f2f0ca67b52c1781636a46cd69dc434915d6e7dea0e9f5b5faebe57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / annoray-0.0.1rc0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | annoray-0.0.1rc0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ebbfdf52d1c870f45138a58974e6d353beb27bb2adc79a68233e2f743ad99322
|
|
BLAKE2b-256 checksum How to use checksums |
1aaf0bb3e9a6e00c11027edf0f9293cdffb4f70bcfb6da9ba46889879bd5c59e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / annoray-0.0.1rc0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | annoray-0.0.1rc0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
224f0f9c26fe6f0cfdfd0974e570a9cf25df3ca241651dbbb39db4671dc64547
|
|
BLAKE2b-256 checksum How to use checksums |
5c9127ebf2a969f059737e26edfb4902146a170c15b525b958376e5bff500de0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / annoray-0.0.1rc0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | annoray-0.0.1rc0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d9907b8caf7f87ad67feccdc437ca270a50b974ef7e0df9411a5f533e417999b
|
|
BLAKE2b-256 checksum How to use checksums |
9c683f614ce0afb3c1a09fbcc8b7e30f81dd053b8ec117a32df5e4d1b7bd397b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / annoray-0.0.1rc0-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | annoray-0.0.1rc0-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
239840803b98d61ca1c658ececcb7b65ed24bc1948b54e71c00414dfaf8d50e0
|
|
BLAKE2b-256 checksum How to use checksums |
8734ec3a4e8771f5dbe469a35987ec152668e59002eacee124ecc0574dbf5590
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Security for annoray 0.0.1rc0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.