rez.utils.graph_utils¶
Functions for manipulating dot-based resolve graphs.
- rez.utils.graph_utils.read_graph_from_string(txt)¶
Read a graph from a string, either in dot format, or our own compressed format.
- Returns:
Graph object.
- Return type:
pygraph.digraph
- rez.utils.graph_utils.write_compacted(g)¶
Write a graph in our own compacted format.
- Returns:
str.
- rez.utils.graph_utils.write_dot(g)¶
Replacement for pygraph.readwrite.dot.write, which is dog slow.
Note
This isn’t a general replacement. It will work for the graphs that Rez generates, but there are no guarantees beyond that.
- Parameters:
g (pygraph.digraph) – Input graph.
- Returns:
Graph in dot format.
- Return type:
- rez.utils.graph_utils.prune_graph(graph_str, package_name)¶
Prune a package graph so it only contains nodes accessible from the given package.
- rez.utils.graph_utils.save_graph(graph_str, dest_file, fmt=None, image_ratio=None)¶
Render a graph to an image file.
- rez.utils.graph_utils.save_graph_object(g, dest_file, fmt=None, image_ratio=None)¶
Like save_graph, but takes a pydot Dot object.
- rez.utils.graph_utils.view_graph(graph_str, dest_file=None)¶
View a dot graph in an image viewer.