parse_backend

function of dascore.utils.array_api source

parse_backend(
    backend: str ,
)-> ‘tuple[bool, str]’

Return whether a backend name is lazy, and the array library it names.

Parameters

Parameter Description
backend An array library by the name
backend_name reports,
such as "numpy" or "jax", or a lazy backend: "LazyArray"
or its alias "lazy", with the library each chunk is computed on
in brackets, NumPy when none is given.

Examples

from dascore.utils.array_api import parse_backend

assert parse_backend("numpy") == (False, "numpy")
assert parse_backend("lazy") == (True, "numpy")
assert parse_backend("LazyArray[jax]") == (True, "jax")