MCPcopy Index your code
hub / github.com/ray-project/ray / test_basic_dag_without_names_plot

Function test_basic_dag_without_names_plot

python/ray/dag/tests/test_plot.py:38–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36
37
38def test_basic_dag_without_names_plot():
39 @ray.remote
40 def a(*args, **kwargs):
41 pass
42
43 tmp1 = a.bind()
44 tmp2 = a.bind()
45 tmp3 = a.bind(tmp1, tmp2)
46 tmp4 = a.bind()
47 tmp5 = a.bind(tmp4)
48 tmp6 = a.bind()
49 dag = a.bind(tmp3, tmp5, tmp6)
50
51 with tempfile.TemporaryDirectory() as tmpdir:
52 to_file = os.path.join(tmpdir, "tmp.png")
53 ray.dag.plot(dag, to_file)
54 assert os.path.isfile(to_file)
55
56 graph = ray.dag.vis_utils._dag_to_dot(dag)
57 to_string = graph.to_string()
58 assert "a -> a_2" in to_string
59 assert "a_1 -> a_2" in to_string
60 assert "a_3 -> a_4" in to_string
61 assert "a_2 -> a_6" in to_string
62 assert "a_4 -> a_6" in to_string
63 assert "a_5 -> a_6" in to_string
64
65
66if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

bindMethod · 0.45
joinMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…