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.

Operator catalogue

One table per group. The columns are:

Conventions shared by every new operator

Dict plumbing

Graph and Fanout return dicts (packages/pipekit-ops/src/pipekit_ops/_base/graph.py, packages/pipekit-ops/src/pipekit_ops/combine.py), and STAC items are nested dicts. Before P1, only Lambda reshaped them.

OperatorSignatureSemanticsStatus
Get(key, default=MISSING)Mapping | Sequence → Any; Nonex[key]; a tuple of keys returns a tuple; default replaces a missing keytoday (dicts.py)
GetIn(keys, default=MISSING)Mapping → Any; Nonex[k0][k1]…; default replaces a missing pathtoday (dicts.py)
Pick(keys)Mapping → dict; Nonekeep only keys, in the order given; a missing key raises KeyErrortoday (dicts.py)
Dissoc(keys)Mapping → dict; Nonedrop keys; missing keys are ignoredtoday (dicts.py)
Rename(mapping)Mapping → dict; Nonerename keys by mapping; unlisted keys pass through; a rename onto an existing key raises ValueErrortoday (dicts.py)
Merge()*Mapping → dict; Noneunion, later inputs win (toolz merge)today (dicts.py)
Assoc(key, op)Mapping → dict; Noneadd key: op(x) computed from the whole dicttoday (dicts.py)
UpdateIn(keys, op, default=MISSING)Mapping → dict; Nonereplace the value at a key path by op(value); replaces the planned OnKeytoday (dicts.py)
ValMap(op)Mapping → dict; Noneop on every value, keys kept (toolz valmap)today (dicts.py)

Iterables

OperatorSignatureSemanticsStatus
Map(op, executor="serial", …)Iterable → list; Noneop on every item; the execution engine, see Executiontoday (execution.py)
Filter(pred)Iterable → list; Nonekeep items where pred(item) is truthytoday (seq.py)
Not(pred)Any → bool; Nonenot pred(x); the operator form of complementtoday (seq.py)
Remove(pred)Iterable → list; Nonedrop items where pred(item) is truthy (toolz remove)today (seq.py)
Reduce(op, initial=MISSING)Iterable → Any; Noneleft fold; op is called on the tuple (acc, item); empty input with no initial raises TypeError like functools.reducetoday (seq.py)
Fold(op, initial, chunksize=128, combine=None, executor="scope")Iterable → Any; Noneassociative tree fold over chunks, parallel through Map (toolz sandbox.fold)today (execution.py)
PartitionAll(n)Iterable → list[tuple]; Noneconsecutive tuples of length n, the last may be shorter; replaces the planned Chunktoday (seq.py)
Concat()Iterable[Iterable] → list; Noneflatten one level (toolz concat); replaces the planned Flattentoday (seq.py)
Zip(strict=True)*Iterable → list[tuple]; Nonebuiltin zip, strict by defaulttoday (seq.py)
GroupBy(key)Iterable → dict[Any, list]; Nonegroup items by key, first-seen key order (toolz groupby)today (seq.py)
CountBy(key)Iterable → dict[Any, int]; Nonecount items per key (toolz countby; CountBy(Identity()) is toolz frequencies)today (seq.py)
Count()Iterable → int; Nonenumber of items, lazy iterables included (toolz count)today (seq.py)
Unique(key=None)Iterable → list; Nonefirst occurrence of each item, or of each key(item) (toolz unique)today (seq.py)
Take(n)Iterable → list; Nonethe first n items (toolz take), for dry runstoday (seq.py)
SortBy(key, reverse=False)Iterable → list; Nonestable sort by keytoday (seq.py)

Flow

OperatorSignatureSemanticsStatus
Retry(op, attempts, base_delay, on)Any → Any; op’sexponential back-off, base_delay * 2 ** (i - 1) before attempt i+1i+1today (control.py)
Try(primary, fallback, on)Any → Any; common of bothtoolz exceptstoday (control.py)
Timeout(op, seconds, max_abandoned=8)Any → Any; op’sraise TimeoutError if op has not returned after seconds; a daemon thread per call, abandoned, not killed; warns when more than max_abandoned are still runningtoday (flow.py)
RateLimit(op, calls, period)Any → Any; op’sat most calls starts of op in any half-open window of period seconds, per processtoday (flow.py)
Until(op, pred, max_iter, on_max="raise")Any → Any; Noneapply op until pred(x) is truthy; stateless sibling of pipekit_cycle.Recurrencetoday (flow.py)

Execution

OperatorSignatureSemanticsStatus
Map(op, executor="serial", n_workers=None, max_in_flight=None, on_error="raise", chunksize=1, start_method=None, progress=None)Iterable → list; Noneone engine over serial, thread, process, async and any concurrent.futures.Executor; progress logs counts every progress itemstoday (execution.py)
Map.iter(items, ordered=True), await Map.run(items)lazy iterator; awaitable liststreaming and running-event-loop entry points; ordered lives here, not in the configtoday (execution.py)
MapError, Failed(index, exception)exception; recordthe ExceptionGroup that on_error="collect" raises, and the record in each failed slot of MapError.resultstoday (execution.py)
Prefetch(op, depth=2, executor="thread")Iterable → Iterator; Noneread depth items ahead of the consumer, in input ordertoday (execution.py)
executor_scope(executor)context managersets the executor that Map(executor="scope") uses (serial when none is set); not stored in any configtoday (execution.py)
ThreadMap(op, n_workers=8)Iterable → list; Nonepreset: Map(op, executor="thread", …); config and hash unchangedtoday (parallel.py), rebuilt on Map
ProcessMap(op, n_workers=8, on_error="raise")Iterable → list; Nonepreset: Map(op, executor="process", …); fails fast on "raise"; keeps the platform start method for one minor release, with a FutureWarning when it is not spawntoday (parallel.py), rebuilt on Map
AsyncMap(op, semaphore=8)Iterable → list; Nonepreset: Map(op, executor="async", max_in_flight=semaphore)today (parallel.py), rebuilt on Map
BatchedMap(op, batch_size=8, flatten=True)Iterable → list; Nonepreset: serial Map(op) over lists of batch_size items, then an optional flatten; PartitionAll and the executor argument are still proposedtoday (parallel.py), rebuilt on Map
check_pickleable(op)Operator → list[Operator]flagged operators in the treetoday (parallel.py); Map calls it, see Execution

Cache and store

OperatorSignatureSemanticsStatus
Cache(inner, store=None, key=None)Any → Any; inner’smemoise by input and the inner pipeline’s hash; store names a Store in scope, None keeps today’s private in-memory dict; key is an operator that computes the input key (toolz memoize(key=…))today (cache.py)
MemoizealiasMemoize is Cachetoday (cache.py)
Storeprotocol__contains__(key), load(key), save(key, value)today (store.py)
MemoryStore()Storedict plus a lock; one processtoday (store.py)
DirectoryStore(root, codec="pickle")Storeone file per key, atomic rename, safe across processes on one file system; writes a pipekit-store.json format markertoday (store.py)
store_scope(**stores)context managerbinds store names to Store instances; not stored in any configtoday (store.py)
Checkpoint(store)nonenot added: it is Cache(op, store=…), and pipekit_train.Checkpoint already owns the namedropped

Observe and QC

OperatorSignatureSemanticsStatus
Tap, Snapshot, ShapeTrace, Profile, Histogrampass-throughclosure-holding observerstoday (observe.py)
Log(message="call {n}: {type} {signature}", level="INFO", logger="pipekit_ops")Any → Any; passthroughpass-through; logs one line per call with the call count and the input’s Signature if an adapter is registeredtoday (observe.py)
Map(…, progress=every)argumentlog done / failed / in-flight counts and items per second every every itemstoday (execution.py)
AssertThat(pred, message="predicate returned False")Any → Any; passthroughQCError if pred(x) is falsy; the serialisable AssertCallabletoday (qc.py)
AssertSignature(pattern, dtype=None, missing="raise")Any → Any; passthroughQCError unless signature_of(x).matches(pattern) (and the dtype agrees)today (qc.py)
Quarantine, AssertShape, AssertDType, AssertHasAttribute, AssertCallable, QCErrorpass-throughexisting guardstoday (qc.py)
Progress, observer Countnonenot added: Map(progress=…) and Log’s call count cover them, and Count keeps toolz’s meaningdropped

Name clash: two BatchedMaps

pipekit_ops.BatchedMap takes an iterable of items and calls the inner operator on lists of them (packages/pipekit-ops/src/pipekit_ops/parallel.py). The pipekit-array design plans a BatchedMap(inner, batch_size, axis) that splits one array along an axis (packages/pipekit-array/docs/design/api/operators.md, ADR A5 in packages/pipekit-array/docs/design/decisions.md). ADR A5 says the import path disambiguates. This design disagrees (decision O14): code that imports both packages, or a Hydra YAML that names both, meets one name with two meanings. The core name has shipped since v0.1, so the array operator should take the sibling proposal’s name, BatchAlong(inner, batch_size, dim).