get_patch_kind

function of dascore.utils.patch source

get_patch_kind(
    patch: Patch | PatchAttrs ,
)-> ‘FrozenDict’

Return the attribute values which decide what kind of patch this is.

The attribute names come from the config option patch_kind_attrs. A name the patch lacks, or holds a null or empty string for, maps to None, which conflicts with nothing: an attribute left at its empty default is the same as no attribute, which is also how spool metadata records it.

Parameters

Parameter Description
patch A patch or its attrs.

Examples

import dascore as dc
from dascore.utils.patch import get_patch_kind
patch = dc.get_example_patch()
kind = get_patch_kind(patch)
assert kind["tag"] == patch.attrs.tag
assert kind["acquisition_key"] is None  # not set, so matches any