rez.utils.graph_utils
Functions for manipulating dot-based resolve graphs.
- rez.utils.graph_utils.prune_graph(graph_str, package_name)[source]
Prune a package graph so it only contains nodes accessible from the given package.
- rez.utils.graph_utils.read_graph_from_string(txt)[source]
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.save_graph(graph_str, dest_file, fmt=None, image_ratio=None)[source]
Render a graph to an image file.
- rez.utils.graph_utils.save_graph_object(g, dest_file, fmt=None, image_ratio=None)[source]
Like save_graph, but takes a pydot Dot object.
- rez.utils.graph_utils.view_graph(graph_str, dest_file=None)[source]
View a dot graph in an image viewer.
- rez.utils.graph_utils.write_compacted(g)[source]
Write a graph in our own compacted format.
- Returns
str.
- rez.utils.graph_utils.write_dot(g)[source]
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