Skip to main content

tidy3A

Tidy-style verbs for named multidimensional arrays: point clouds, images, sensor measurements, scientific and complex-valued arrays. Built on xarray and NumPy, in the spirit of tidy3.

Status: version 0.1.0 is prepared for the first release, not yet published. The design decisions are in docs/plan.md; the rules fit on one page in docs/decisions.md.

Requires Python 3.11 or newer. From a checkout, install the package:

python -m pip install -e .

Quick start

import numpy as np
from tidy3a import fields, filter, formula, infer, mutate, read_array

points = np.array([[3, 4, 0], [0, 0, 50], [60, 0, 0]], dtype="float32")
cloud = read_array(
    points,
    dims={"point": infer, "feature": 3},
    labels={"feature": ["x", "y", "z"]},
    field_axis="feature",
)
x, y, z, distance = fields("x", "y", "z", "distance")

nearby = (
    cloud
    >> mutate(distance = formula(r"\sqrt{x^2 + y^2 + z^2}"))
    >> filter(distance <= 50)
)
print(nearby.collect()["distance"].values)  # [ 5. 50.]

The implemented API includes read_array, read_binary, fixed_text, infer, tidy(), tidy-layer verbs (select, filter, slice, mutate, group_by, summarise, joins, pull, bind_cols), array helpers (dot, numeric functions, conj, rename_axes, pack), and formula() for plain mathematical text and a strict LaTeX dialect. Scripts declare names with fields() or write col("x"). collect() returns a computed xarray Dataset; to_xarray() returns a shallow copy sharing the underlying values.

Notebooks

Install IPython separately to use the notebook extension. In a notebook cell:

%load_ext tidy3a.jupyter
from tidy3a import *

The extension enables bare field names inside verbs, so the quick-start example can omit the fields() declaration. Multi-line pipes need parentheses. Sharing a notebook with tidy3 requires its ownership-aware transformer; the prerequisite is recorded in the plan.

Execution and first-release scope

The first release runs eagerly on NumPy. read_array accepts homogeneous raw numeric files, .npy files, and NumPy arrays. read_binary reads mixed fixed-width records into separate variables, preserving numeric types and strictly decoding UTF-8/ASCII text declared with fixed_text. Records can be packed or have explicit field offsets and padding; see the reader contract for supported options. tidy() wraps xarray DataArrays and Datasets; optional file readers stay in xarray's ecosystem.

read_array(..., lazy=True) memory-maps raw and .npy files. It does not make the verb pipeline lazy: arithmetic can allocate results, filtering evaluates its mask, and updating a field label copies its containing array into memory. tidy() preserves a lazy xarray input initially; collect() computes it. Dask execution guarantees remain planned.

Integer arithmetic follows NumPy, including unsigned subtraction wrapping around. Convert before subtracting when negative results are needed, for example nir * 1.0 - red for uint8 image bands. See first-release limitations for the supported subset.

Examples and development

The point-cloud example runs on real nuScenes Mini data and checks itself against plain NumPy:

python examples/nuscenes_sweep.py /path/to/nuscenes-mini

Three public sample datasets (gridded air temperature, ERA-Interim wind, and stars' Landsat scene) run against plain xarray; see examples/sample_data.py for the files, optional reader dependencies, and checks.

To run the local tests:

python -m pip install -e ".[dev]"
python -m pytest -q

Before pushing, run the CI checks in fresh environments with only declared dependencies (requires uv):

scripts/check.sh

The release procedure describes the GitHub Release workflow and the one-time GitHub/PyPI setup.

License

MIT

Metadata

Release files for tidy3a 0.1.0

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

Source distribution (sdist)

Source distribution for tidy3a 0.1.0
File Size Uploaded Provenance Actions
tidy3a-0.1.0.tar.gz 146.3 kB With provenance Details for tidy3a-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tidy3a 0.1.0
File Interpreter ABI Platform Actions
tidy3a-0.1.0-py3-none-any.whl Python 3 none any Details for tidy3a-0.1.0-py3-none-any.whl

Total release size: 202.3 kB

Release files / tidy3a-0.1.0.tar.gz

Download URL tidy3a-0.1.0.tar.gz
Size 146.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c8b9fde275f82ffb37178bd5210ba262bb4db478a80fb49fdafa37c25dc17285
BLAKE2b-256 checksum
How to use checksums
e9ac25d4fd34cb608721ac6ed803c8c0f978fac2ff9de8f0572b7f69f6e422d4
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 / tidy3a-0.1.0-py3-none-any.whl

Download URL tidy3a-0.1.0-py3-none-any.whl
Size 56.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c98b3562cace3840688ab3a1f0ea538c77d49d9aa7edcb68ffe7df707b45d52
BLAKE2b-256 checksum
How to use checksums
aa8f201a4975b31a3c515cfb716e59e18a9746ba280791222f387041734f29b7
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 tidy3a 0.1.0

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tidy3a-0.1.0.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