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

Function _check_get_task_eq

dask/array/tests/test_optimization.py:20–40  ·  view source on GitHub ↗

Check that two tasks (possibly containing nested tasks) are equal, where equality is lax by allowing the callable in a SubgraphCallable to be the same as a non-wrapped task.

(a, b)

Source from the content-addressed store, hash-verified

18
19
20def _check_get_task_eq(a, b) -> bool:
21 """
22 Check that two tasks (possibly containing nested tasks) are equal, where
23 equality is lax by allowing the callable in a SubgraphCallable to be the same
24 as a non-wrapped task.
25 """
26 if len(a) < 1 or len(a) != len(b):
27 return False
28
29 a_callable = a[0]
30 b_callable = b[0]
31 if a_callable != b_callable:
32 return False
33
34 for ae, be in zip(a[1:], b[1:]):
35 if dask.core.istask(ae):
36 if not _check_get_task_eq(ae, be):
37 return False
38 elif ae != be:
39 return False
40 return True
41
42
43def test_optimize_with_getitem_fusion():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected