MCPcopy Index your code
hub / github.com/dask/dask / modf

Function modf

dask/array/ufunc.py:321–342  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

319
320@derived_from(np)
321def modf(x):
322 # Not actually object dtype, just need to specify something
323 tmp = elemwise(np.modf, x, dtype=object)
324 left = f"modf1-{tmp.name}"
325 right = f"modf2-{tmp.name}"
326 ldsk = {
327 (left,) + key[1:]: (getitem, key, 0)
328 for key in core.flatten(tmp.__dask_keys__())
329 }
330 rdsk = {
331 (right,) + key[1:]: (getitem, key, 1)
332 for key in core.flatten(tmp.__dask_keys__())
333 }
334
335 a = np.ones_like(getattr(x, "_meta", x), shape=(1,) * x.ndim, dtype=x.dtype)
336 l, r = np.modf(a)
337
338 graph = HighLevelGraph.from_collections(left, ldsk, dependencies=[tmp])
339 L = Array(graph, left, chunks=tmp.chunks, meta=l)
340 graph = HighLevelGraph.from_collections(right, rdsk, dependencies=[tmp])
341 R = Array(graph, right, chunks=tmp.chunks, meta=r)
342 return L, R
343
344
345@derived_from(np)

Callers

nothing calls this directly

Calls 5

elemwiseFunction · 0.90
ArrayClass · 0.90
flattenMethod · 0.80
from_collectionsMethod · 0.80
__dask_keys__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…