finesse.utilities.graph

Functions to aid manipulation of networkx graphs as well as some graph related utilities.

Functions

class_graph(cls[, G])

Creates a directed graph from a class and all of its base classes.

class_graph_from_module_graph(module_graph)

Creates a directed graph for all the classes and base classes in the module graph.

copy_graph(G)

A trick I often see in networkx's codebase to copy a graph.

default_key(d, key[, default])

flip_dict(dd)

Swap kay-value in a dictionary.

get_orphan_nodes(G)

An orphan node is a node with no edges.

get_sink_nodes(G)

A sink node is a node with no outgoing edges.

get_source_nodes(G)

A source node is a node with no incoming edges.

module_graph(module[, G, external_modules, ...])

Creates a directed graph from a module and all of its submodules.

remove_orphans(G[, inplace])

Removes nodes with in and out degree 0 from graph G.

remove_sinks(G[, recursive, inplace])

Removes nodes with out degree 0 from graph G.

remove_sources(G[, recursive, inplace])

Removes nodes with in degree 0 from graph G.