MCPcopy
hub / github.com/dask/dask / test_rewrite

Function test_rewrite

dask/array/tests/test_atop.py:379–399  ·  view source on GitHub ↗
(inputs, expected)

Source from the content-addressed store, hash-verified

377 ],
378)
379def test_rewrite(inputs, expected):
380 inputs = [
381 Blockwise(
382 *inp, numblocks={k: (1,) * len(v) for k, v in inp[-1] if v is not None}
383 )
384 for inp in inputs
385 ]
386 result = rewrite_blockwise(inputs)
387
388 result2 = (
389 result.output,
390 "".join(result.output_indices),
391 result.task,
392 [
393 (name, "".join(ind) if ind is not None else ind)
394 for name, ind in result.indices
395 ],
396 )
397 # Assert on the task first to get a more informative error message
398 assert result2[2] == expected[2]
399 assert result2 == expected
400
401
402def test_index_subs():

Callers

nothing calls this directly

Calls 3

BlockwiseClass · 0.90
rewrite_blockwiseFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…