is_foreign

function of dascore.utils.array_api source

is_foreign(
    array: Any ,
)-> ‘bool’

Return True if the array belongs to a non-numpy array API backend.

These are the arrays which have to cross the numpy boundary explicitly.

Parameters

Parameter Description
array Any object.

Examples

import numpy as np
from dascore.utils.array_api import is_foreign

assert not is_foreign(np.array([1, 2]))
assert not is_foreign(10)
assert not is_foreign(np.float32)  # a dtype, not an array