allisbns.merge

Functions to merge datasets.

class allisbns.merge.MergeInPlaceFunction(*args, **kwargs)

Bases: Protocol

Typing protocol for merge functions with in-place evaluation support.

The protocol is compatible with NumPy’s logical operation functions that take the out argument.

class allisbns.merge.MergePureFunction(*args, **kwargs)

Bases: Protocol

Typing protocol for merge out-of-place functions.

allisbns.merge.merge(datasets: Iterable[CodeDataset], function: MergeInPlaceFunction | MergePureFunction) CodeDataset

Merges datasets using a merge function.

The bounds of all datasets should be the same.

Parameters:
  • datasets – Datasets to merge.

  • function – A merge function.

Returns:

A merged dataset.

allisbns.merge.union(x: Iterable[CodeDataset]) CodeDataset
allisbns.merge.intersection(x: Iterable[CodeDataset]) CodeDataset
allisbns.merge.difference(x: Iterable[CodeDataset]) CodeDataset
allisbns.merge.symmetric_difference(x: CodeDataset, y: CodeDataset) CodeDataset