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

Function test_basic_dag_with_names_plot

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

Source from the content-addressed store, hash-verified

8
9
10def test_basic_dag_with_names_plot():
11 @ray.remote
12 def a(*args, **kwargs):
13 pass
14
15 tmp1 = a.options(name="tmp1").bind()
16 tmp2 = a.options(name="tmp2").bind()
17 tmp3 = a.options(name="tmp3").bind(tmp1, tmp2)
18 tmp4 = a.options(name="tmp4").bind()
19 tmp5 = a.options(name="tmp5").bind(tmp4)
20 tmp6 = a.options(name="tmp6").bind()
21 dag = a.bind(tmp3, tmp5, tmp6)
22
23 with tempfile.TemporaryDirectory() as tmpdir:
24 to_file = os.path.join(tmpdir, "tmp.png")
25 ray.dag.plot(dag, to_file)
26 assert os.path.isfile(to_file)
27
28 graph = ray.dag.vis_utils._dag_to_dot(dag)
29 to_string = graph.to_string()
30 assert "tmp1 -> tmp3" in to_string
31 assert "tmp2 -> tmp3" in to_string
32 assert "tmp4 -> tmp5" in to_string
33 assert "tmp3 -> a" in to_string
34 assert "tmp5 -> a" in to_string
35 assert "tmp6 -> a" in to_string
36
37
38def test_basic_dag_without_names_plot():

Callers

nothing calls this directly

Calls 4

bindMethod · 0.45
optionsMethod · 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…