A thin layer of duck-typed array operators on top of pipekit-ops, written against the Python Array API standard, so a single operator runs on NumPy, JAX, CuPy, PyTorch or dask without a rewrite.
Status¶
pipekit-array 0.3.1 ships most of this design.
Since ADR A30 the package is six areas (arrays, named, kernels, operators, bridges, testing), described in Architecture §3; the module names of the v0.1 catalogue below are the plan’s, not the package’s.
| Part | Status |
|---|---|
Namespace dispatch (array_namespace), MeanScalar, StackAlong, ConcatenateAlong | today (phase A) |
Named carriers (DimArray) and every dim-level function of Dim-level functions: the missing ones, with operator twins | today (#204 to #207) |
ApplyAlong (replaces ApplyToBands) and BatchAlong (replaces the array-shaped BatchedMap) | today (#206) |
batch / Padded, to_rows / from_rows, Estimator, the einx bridge, KernelOp, the xarray adapter, the test kit | today |
Subsample | retired: it is isel with a stepped slice (A15) |
Histogram (array-aware), AssertClose, AssertValueRange, AssertNoNaN, AssertValidFraction, ModelOp | not built |
| The weight-blob model wrappers of ADR A8 | today, outside pipekit-array: pipekit_jax.JaxModelOp, and EquinoxModelOp and KerasModelOp in pipekit-train |
Structure¶
docs/design/
├── README.md # This file: index and reading order.
├── vision.md # Motivation, scope, the Array API bet.
├── architecture.md # The dispatch pattern and how operators
│ # delegate to array_namespace(x).
├── decisions.md # ADRs A1 to A30 (dispatch, scope vs core,
│ # backend extras, named carriers, the
│ # dim-level functions).
├── boundaries.md # Non-goals, open questions, v0.1 DoD.
└── api/
├── README.md # Operator catalogue: at-a-glance table.
├── operators.md # Layer 1: data-flow ops (ApplyAlong,
│ # StackAlong, ConcatenateAlong, Subsample,
│ # MeanScalar, BatchAlong, Histogram).
├── qc.md # Layer 2: numeric QC (AssertClose,
│ # AssertValueRange, AssertNoNaN,
│ # AssertValidFraction).
├── inference.md # Layer 3: ModelOp (framework-agnostic
│ # inference; numpy / JAX / torch / Keras).
└── dim_functions.md # The dim-level functions (rename,
# merge_dims, shift, window, quantile, dot, …)
# and their xarray parity table.Reading order¶
Vision: why a dedicated array layer at all, and what the Array API gives us for free.
Architecture: the
array_namespacedispatch pattern, the four shape rules every operator follows, and howpipekit-arrayslots betweenpipekit-opsand the domain libraries (geotoolz,xr_toolz).Decisions (ADRs): the ADRs that lock the shape in.
API: operator catalogue, then operators, qc, inference and dim_functions.
Boundaries: what is deferred and why.
Sources¶
The design brings together two upstream sources:
The master plan,
research_journal_v2/notes/geotoolz/master_plan/toolz_3_pipekit_array.md(Report 3, “Sister libraries on top of pipekit”). It sets the three-library carrier story (pipekit-arrayfor arrays,geotoolzforGeoTensor,xr_toolzfor xarray) and the operator catalogue (about 12 operators, about 400 LOC) that pipekit-array v0.1 ships.The
pipekit-opscore surface, in particular:the QC operators of
pipekit_ops.operators, whose module docstring defers numeric checks topipekit-array;pipekit_ops.observe.Histogram, the controller pattern this design extends with a carrier-awareto_array=...default;pipekit_ops.execution.BatchedMap, the iterable-shaped variant; pipekit-array’s array-shaped operator is namedBatchAlongso it does not shadow it (ADR A19).
Where the two sources diverge, this design resolves the tension explicitly in Decisions (ADRs).