decide_fallback

function of dascore.utils.array_api source

decide_fallback(
    what: str ,
    how: str ,
    lazy: bool = True,
    refusal: Exception | None[<class ’Exception, None] = None,
    stacklevel: int | None[int, None] = None,
    name: str | None[str, None] = None,
)-> ‘None’

Apply the numpy_fallback setting: refuse, warn, or say nothing.

Every conversion through NumPy made because an operation has no implementation for the data’s library, and every read of lazy data the caller did not ask for, is decided here.

Parameters

Parameter Description
what What cannot be done as asked, which starts either message.
how What is done instead, which the warning adds.
lazy Whether the data are lazy: the setting, left unset, refuses for those
and warns for any other.
refusal The error to raise, in place of the one made from what.
stacklevel The stack level of the caller, as warnings.warn understands it.
None points the warning at the first frame outside dascore.
name The operation which converts, if this is a conversion: one whose
conversion was decided already, inside fallbacks_decided, is not
asked again.