check_data_units

function of dascore.utils.patch source

check_data_units(
    patch1 ,
    patch2 ,
    check_behavior: Literal[‘warn’, ‘raise’, ‘ignore’] = raise,
)-> ‘bool’

Return True unless the patches hold known, different data units.

Splicing or summing data demands one unit: a patch without units adopts the other’s, but metres beside kilometres are not converted for the caller — convert with Patch.convert_units first.

Parameters

Parameter Description
patch1 The first patch.
patch2 The second patch.
check_behavior What to do when the units differ: ‘raise’ (default) raises
IncompatiblePatchError,
‘warn’ warns and returns False, ‘ignore’ returns False quietly.