patch_registry

module of dascore.utils source

Name, resolve and fingerprint patch functions.

Every patch function is registered under a tag as it is decorated: bare for DASCore’s own (normalize), package:name for a plugin’s. fingerprint_call digests one call’s bound arguments; it is what advances a patch’s processing_id.

Examples

import dascore as dc
from dascore.utils.patch_registry import fingerprint_call

first = fingerprint_call(dc.proc.normalize, (), {"dim": "time"})
assert first == fingerprint_call(dc.proc.normalize, ("time",))

Functions

Name Description
fingerprint_call Return the digest which identifies one call to a patch function.
patch_function_tag Return the tag which names a patch function.
register_patch_function Add a patch function to the registry under its derived tag.
resolve_patch_function Return the patch function a tag names, else say what is missing.