Comparison Functions¶

pybel_tools.comparison.
graph_entities_equal
(g, h)[source]¶ Tests that two graphs have the same nodes
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: Do the two graphs share the same set of nodes?
Return type:

pybel_tools.comparison.
graph_topologically_equal
(g, h)[source]¶ Tests that two graphs are topologically equal, defined by having the same nodes, and same connectivity
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: Do the graphs share the same set of nodes, and the same connectivity?
Return type:

pybel_tools.comparison.
graph_relations_equal
(g, h)[source]¶ Tests that two graphs are equal, defined by having the same nodes, same connections, and existence of same connection types
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: Do the two graphs share the same set of nodes, same connectivity, and types of connections?
Return type:

pybel_tools.comparison.
graph_provenance_equal
(g, h)[source]¶ Tests that two graphs are equal, defined by having the same nodes, same connections with same types, and same attributes exactly.
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: Do the two graphs share the same set of nodes, same connectivity, types of connections, evidences, and annotations?
Return type:

pybel_tools.comparison.
graph_edges_intersection
(g, h)[source]¶ Returns the set of node pairs that appear in both graphs
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: The set of edges shared between the two graphs
Return type:

pybel_tools.comparison.
graph_edges_difference
(g, h)[source]¶ Returns the set of node pairs that appear in g but not h
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: The asymmetric difference between the edges in g and h
Return type:

pybel_tools.comparison.
graph_edges_symmetric_difference
(g, h)[source]¶ Returns the set of edges that appear in only one of g or h
Parameters:  g (pybel.BELGraph) – A BEL Graph
 h (pybel.BELGraph) – Another BEL Graph
Returns: The symmetric difference between the edges in g and h
Return type: