MCPcopy Create free account
hub / github.com/dask/dask / test_frompyfunc

Function test_frompyfunc

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

Source from the content-addressed store, hash-verified

359
360
361def test_frompyfunc():
362 myadd = da.frompyfunc(add, 2, 1)
363 np_myadd = np.frompyfunc(add, 2, 1)
364
365 x = np.random.normal(0, 10, size=(10, 10))
366 dx = da.from_array(x, chunks=(3, 4))
367 y = np.random.normal(0, 10, size=10)
368 dy = da.from_array(y, chunks=2)
369
370 assert_eq(myadd(dx, dy), np_myadd(x, y))
371 assert_eq(myadd.outer(dx, dy), np_myadd.outer(x, y))
372
373 with pytest.raises(NotImplementedError):
374 da.frompyfunc(lambda x, y: (x + y, x - y), 2, 2)
375
376
377def 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