MCPcopy
hub / github.com/dask/dask / test_frompyfunc

Function test_frompyfunc

dask/array/tests/test_ufunc.py:375–388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373
374
375def test_frompyfunc():
376 myadd = da.frompyfunc(add, 2, 1)
377 np_myadd = np.frompyfunc(add, 2, 1)
378
379 x = np.random.normal(0, 10, size=(10, 10))
380 dx = da.from_array(x, chunks=(3, 4))
381 y = np.random.normal(0, 10, size=10)
382 dy = da.from_array(y, chunks=2)
383
384 assert_eq(myadd(dx, dy), np_myadd(x, y))
385 assert_eq(myadd.outer(dx, dy), np_myadd.outer(x, y))
386
387 with pytest.raises(NotImplementedError):
388 da.frompyfunc(lambda x, y: (x + y, x - y), 2, 2)
389
390
391def test_frompyfunc_wrapper():

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
myaddFunction · 0.85
normalMethod · 0.45
outerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…