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 different data units.

Splicing or summing data demands one unit, and none is converted for the caller: metres beside kilometres, or beside a patch with no units at all, must be reconciled first with Patch.convert_units or Patch.set_units.

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.