processor

module of dascore.core source

Split a patch operation into its metadata and its array kernel.

A PatchProcessor derives the result’s metadata separately from running its array kernel, so a chain of operations can be planned without loading data. A class is registered for a patch function’s name with register_implementation, and backend packages add kernels with register_kernel.

Examples

import dascore as dc
from dascore.proc.basic import Normalize

patch = dc.get_example_patch()
assert Normalize(dim="time")(patch).equals(patch.normalize(dim="time"))

Functions

Name Description
register_implementation Say that a hand-written class is what a patch function’s name means.
register_kernel Say that a function is how an operation runs on one array backend.

Classes

Name Description
PatchMeta Everything a patch carries except its data.
PatchProcessor An operation on a patch, written out by hand.