class documentation

class InheritanceGraph:

View In Hierarchy

Given a list of classes, determines the set of classes that they inherit from all the way to the root "object", and then is able to generate a graphviz dot graph from them.
Method __init__ class_names is a list of child classes to show bases from.
Method ​_class​_info Return name and bases for all classes that are ancestors of classes.
Method ​_format​_graph​_attrs Undocumented
Method ​_format​_node​_attrs Undocumented
Method ​_import​_classes Import a list of classes.
Method class​_name Given a class object, return a fully-qualified name.
Method generate​_dot Generate a graphviz dot graph from the classes that were passed in to __init__.
Method get​_all​_class​_names Get all of the class names involved in the graph.
Class Variable default​_edge​_attrs Undocumented
Class Variable default​_graph​_attrs Undocumented
Class Variable default​_node​_attrs Undocumented
Instance Variable class​_info Undocumented
Instance Variable class​_names Undocumented
def __init__(self, class_names, currmodule, show_builtins=False, private_bases=False, parts=0, aliases=None, top_classes=[]):

class_names is a list of child classes to show bases from.

If show_builtins is True, then Python builtins will be shown in the graph.

Parameters
class​_names:List[str]Undocumented
currmodule:strUndocumented
show​_builtins:boolUndocumented
private​_bases:boolUndocumented
parts:intUndocumented
aliases:Dict[str, str]Undocumented
top​_classes:List[Any]Undocumented
def _class_info(self, classes, show_builtins, private_bases, parts, aliases, top_classes):

Return name and bases for all classes that are ancestors of classes.

parts gives the number of dotted name parts to include in the displayed node names, from right to left. If given as a negative, the number of parts to drop from the left. A value of 0 displays the full dotted name. E.g. sphinx.ext.inheritance_diagram.InheritanceGraph with parts=2 or parts=-2 gets displayed as inheritance_diagram.InheritanceGraph, and as ext.inheritance_diagram.InheritanceGraph with parts=3 or parts=-1.

top_classes gives the name(s) of the top most ancestor class to traverse to. Multiple names can be specified separated by comma.

Parameters
classes:List[Any]Undocumented
show​_builtins:boolUndocumented
private​_bases:boolUndocumented
parts:intUndocumented
aliases:Dict[str, str]Undocumented
top​_classes:List[Any]Undocumented
Returns
List[Tuple[str, str, List[str], str]]Undocumented
def _format_graph_attrs(self, attrs):

Undocumented

Parameters
attrs:DictUndocumented
Returns
strUndocumented
def _format_node_attrs(self, attrs):

Undocumented

Parameters
attrs:DictUndocumented
Returns
strUndocumented
def _import_classes(self, class_names, currmodule):
Import a list of classes.
Parameters
class​_names:List[str]Undocumented
currmodule:strUndocumented
Returns
List[Any]Undocumented
def class_name(self, cls, parts=0, aliases=None):

Given a class object, return a fully-qualified name.

This works for things I've tested in matplotlib so far, but may not be completely general.

Parameters
cls:AnyUndocumented
parts:intUndocumented
aliases:Dict[str, str]Undocumented
Returns
strUndocumented
def generate_dot(self, name, urls={}, env=None, graph_attrs={}, node_attrs={}, edge_attrs={}):

Generate a graphviz dot graph from the classes that were passed in to __init__.

name is the name of the graph.

urls is a dictionary mapping class names to HTTP URLs.

graph_attrs, node_attrs, edge_attrs are dictionaries containing key/value pairs to pass on as graphviz properties.

Parameters
name:strUndocumented
urls:DictUndocumented
env:BuildEnvironmentUndocumented
graph​_attrs:DictUndocumented
node​_attrs:DictUndocumented
edge​_attrs:DictUndocumented
Returns
strUndocumented
def get_all_class_names(self):
Get all of the class names involved in the graph.
Returns
List[str]Undocumented
default_edge_attrs: dict =

Undocumented

default_graph_attrs: dict[str, str] =

Undocumented

default_node_attrs: dict =

Undocumented

class_info =

Undocumented

class_names =

Undocumented