Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

API: operator catalogue

The v0.1 plan is 12 operators across 7 modules. The grouping mirrored pipekit-ops where it made sense: combinators with Fanout, qc with the QC operators, observe with pipekit_ops.observe, and batching with pipekit_ops.execution. The package did not keep these modules: since ADR A30 it is six areas, and every built operator below is in pipekit_array.operators (architecture.md §3). Six of the 12 are built or replaced today; the QC family, Histogram and ModelOp are not built yet.

At a glance

ModuleOperatorOne-linerStatus
dim_operatorsApplyAlonginner per item along a dim, stacked back; serialises (A15).today
combinatorsStackAlongxp.stack of a list along a new axis (axis=), or stack of named carriers (dim=).today
combinatorsConcatenateAlongxp.concat along an existing axis (axis=), or concat of named carriers (dim=).today
geomSubsampleStride-decimate along given axes.retired: isel with a stepped slice (A15)
observeHistogramController; .at(key) captures per-tap distributions.not built
reductionsMeanScalarxp.mean reduction; optional axis, keepdims.today
batchingBatchAlongSplit along a dim into chunks, apply inner, concatenate (A19).today
qcAssertCloseCompare to a stored reference; raise on numeric drift (A21).not built
qcAssertValueRangePass-through; raise or warn on out-of-range values.not built
qcAssertNoNaNPass-through; raise on any NaN.not built
qcAssertValidFractionPass-through; raise if the non-NaN fraction is < min_valid.not built
inferenceModelOpFramework-agnostic inference wrapper.not built

Beyond the catalogue, the package ships batch and Padded (A10), to_rows / from_rows and Estimator (OP-O3), the einx bridge pipekit_array.bridges.einx (OP-O2), KernelSpec / KernelOp, the xarray adapter and the test kit pipekit_array.testing.

Named carriers: dim-level functions

These run on any carrier with a registered pipekit_ops.NamedArrayAdapter (a DimArray, an xr.DataArray, a geoarray carrier), by dim name rather than axis. Each is a function in pipekit_array.named and, where it serialises, an operator in pipekit_array.operators (GA-Q3; geostack docs/design/pipekit_kernels.md). Every row ships today.

FunctionOperatorDoes
iselISelposition lookup; an int drops the dim
selSelexact label lookup; no ranges, no nearest
transposeTransposereorder dims by name
reduceReducereduce over named dims (the operator takes a name)
argreduceArgReduceindex of a reduction along a dim
take_alongTakeAlonggather along a dim with an index carrier
map_overMapOvera function per item along a dim (forbid_in_yaml)
stackStackAlong(dim=)a new leading dim
concatConcatenateAlong(dim=)join along an existing dim
combineCombineelement-wise function of same-dim carriers (forbid_in_yaml)
renameRenamenew dim names; labels follow (dim_shapes)
expand_dimsExpandDimsinsert length-1 dims
squeezeSqueezedrop named length-1 dims
broadcast_likeBroadcastLikeadd another carrier’s missing dims, in front
merge_dimsMergeDimsy x into pixel, placed last; tuple labels
split_dimsSplitDimspixel back into y x; tuple labels split back
padPadwiden named dims; four modes (dim_shifts)
rollRollcyclic shift; labels stay
shiftShiftshift with a fill; labels stay
diffDiffn-th forward difference along a dim
cumreduceCumReducecumulative function along a dim (the operator takes a name)
whereWherekeep where a mask is True, aligned by dim name
windowWindowsliding full windows as a new last dim (dim_windows)
coarsenCoarsenreduce non-overlapping blocks; the dim loses its labels
map_overApplyAlongan operator per item along a dim; serialises
quantileQuantilequantiles over named dims; a list q adds a quantile dim (dim_algebra)
dotDotsum of a product over named dims; shared dims not summed are batch dims

All sixteen functions of Dim-level functions: the missing ones ship today, in pipekit_array.named. They landed in four phases (#204 to #207), first in modules of their own (dim_shapes, dim_shifts, dim_windows, dim_algebra) that ADR A30 folded into the areas. The design page has the xarray parity table and the as-built notes.

An adapter may override any of them with a method of the same name (xarray’s reduce stays lazy on dask; geoarray’s map_over is one jax.vmap). The test kit proves the override equals the generic path.

Reading order

  1. Operators: data flow: the data-flow operators (the combinators, the reducer, the carrier-shaped BatchAlong, the Histogram controller, Subsample). This is the “what does the pipeline do” surface.

  2. QC: numeric assertions: the numeric QC family. This is the “what does the pipeline guard against” surface.

  3. Inference: ModelOp: ModelOp, the generic trained-model wrapper for models that no pipekit-train backend trains.

  4. Dim-level functions: the missing ones: the dim-level functions, their xarray parity and their testing gates.

Each operator spec covers the constructor signature, the _apply contract, the get_config() shape, the compute_output_signature behaviour (if non-trivial), per-backend caveats, and a one- or two-line example.