class documentation

class InheritanceGraph: (source)

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_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
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.
def __init__(self, class_names, currmodule, show_builtins=False, private_bases=False, parts=0, aliases=None, top_classes=[]): (source)

*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]|NoneUndocumented
top_classes:list[Any]Undocumented
def class_name(self, cls, parts=0, aliases=None): (source)

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]|NoneUndocumented
Returns
strUndocumented
def generate_dot(self, name, urls={}, env=None, graph_attrs={}, node_attrs={}, edge_attrs={}): (source)

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:dict[str, str]Undocumented
env:BuildEnvironment|NoneUndocumented
graph_attrs:dictUndocumented
node_attrs:dictUndocumented
edge_attrs:dictUndocumented
Returns
strUndocumented
def get_all_class_names(self): (source)

Get all of the class names involved in the graph.

Returns
list[str]Undocumented
default_edge_attrs: dict = (source)

Undocumented

default_graph_attrs: dict[str, str] = (source)

Undocumented

default_node_attrs: dict = (source)

Undocumented

class_info = (source)

Undocumented

class_names = (source)

Undocumented

def _class_info(self, classes, show_builtins, private_bases, parts, aliases, top_classes): (source)

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): (source)

Undocumented

Parameters
attrs:dict[str, Any]Undocumented
Returns
strUndocumented
def _format_node_attrs(self, attrs): (source)

Undocumented

Parameters
attrs:dict[str, Any]Undocumented
Returns
strUndocumented
def _import_classes(self, class_names, currmodule): (source)

Import a list of classes.

Parameters
class_names:list[str]Undocumented
currmodule:strUndocumented
Returns
list[Any]Undocumented