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

Function test_unregistered_func

dask/array/tests/test_array_function.py:162–181  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

160 ],
161)
162def test_unregistered_func(func):
163 # Wrap a protocol-based encapsulated ndarray
164 x = EncapsulateNDArray(np.random.default_rng().random((100, 100)))
165
166 # See if Dask holds the array fine
167 y = da.from_array(x, chunks=(50, 50))
168
169 # Check if it's an equivalent array
170 assert_eq(x, y, check_meta=False, check_type=False)
171
172 # Perform two NumPy functions, one on the
173 # Encapsulated array
174 xx = func(x)
175
176 # And one on the Dask array holding these
177 # encapsulated arrays
178 yy = func(y)
179
180 # Check that they are equivalent arrays.
181 assert_eq(xx, yy, check_meta=False, check_type=False)
182
183
184def test_non_existent_func():

Callers

nothing calls this directly

Calls 4

EncapsulateNDArrayClass · 0.90
assert_eqFunction · 0.90
funcFunction · 0.70
randomMethod · 0.45

Tested by

no test coverage detected