Returns a EasyGraph graph from a dot file on path. Parameters ---------- path : file or string File name or file handle to read.
(path)
| 161 | |
| 162 | |
| 163 | def read_dot(path): |
| 164 | """Returns a EasyGraph graph from a dot file on path. |
| 165 | |
| 166 | Parameters |
| 167 | ---------- |
| 168 | path : file or string |
| 169 | File name or file handle to read. |
| 170 | """ |
| 171 | try: |
| 172 | import pygraphviz |
| 173 | except ImportError as err: |
| 174 | raise ImportError( |
| 175 | "read_dot() requires pygraphviz http://pygraphviz.github.io/" |
| 176 | ) from err |
| 177 | A = pygraphviz.AGraph(file=path) |
| 178 | gr = from_agraph(A) |
| 179 | A.clear() |
| 180 | return gr |
nothing calls this directly
no test coverage detected