MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / read_dot

Function read_dot

easygraph/readwrite/graphviz.py:163–180  ·  view source on GitHub ↗

Returns a EasyGraph graph from a dot file on path. Parameters ---------- path : file or string File name or file handle to read.

(path)

Source from the content-addressed store, hash-verified

161
162
163def 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

Callers

nothing calls this directly

Calls 2

from_agraphFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected