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

Function test_split_every

dask/tests/test_graph_manipulation.py:317–332  ·  view source on GitHub ↗
(split_every, nkeys)

Source from the content-addressed store, hash-verified

315 ],
316)
317def test_split_every(split_every, nkeys):
318 dsk = {("a", i): i for i in range(100)}
319 t1 = Tuple(dsk, list(dsk))
320 c = checkpoint(t1, split_every=split_every)
321 assert len(c.__dask_graph__()) == nkeys
322 assert c.compute(scheduler="sync") is None
323
324 t2 = wait_on(t1, split_every=split_every)
325 assert len(t2.__dask_graph__()) == nkeys + 100
326 assert t2.compute(scheduler="sync") == tuple(range(100))
327
328 dsk3 = {"b": 1, "c": 2}
329 t3 = Tuple(dsk3, list(dsk3))
330 t4 = bind(t3, t1, split_every=split_every, assume_layers=False)
331 assert len(t4.__dask_graph__()) == nkeys + 2
332 assert t4.compute(scheduler="sync") == (1, 2)
333
334
335def test_split_every_invalid():

Callers

nothing calls this directly

Calls 6

TupleClass · 0.90
checkpointFunction · 0.90
wait_onFunction · 0.90
bindFunction · 0.90
__dask_graph__Method · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…