MCPcopy Index your code
hub / github.com/pydata/xarray / get_array_namespace

Function get_array_namespace

xarray/ufuncs.py:32–42  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

30
31
32def get_array_namespace(*args):
33 xps = set()
34 for arg in args:
35 _walk_array_namespaces(arg, xps)
36
37 xps.discard(np)
38 if len(xps) > 1:
39 names = [module.__name__ for module in xps]
40 raise ValueError(f"Mixed array types {names} are not supported.")
41
42 return next(iter(xps)) if xps else np
43
44
45class _ufunc_wrapper(ABC):

Callers 2

__call__Method · 0.70
__call__Method · 0.70

Calls 2

_walk_array_namespacesFunction · 0.85
discardMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…