This PR refactors some of the internals to improve readability, remove duplication, and generally clean up the code.
Internal changes:
Add and use KeyTransformDict and ElementTransformSet classes to abstract away the business of extracting object identities for lookups and vertex sets. This allows us to express the graph algorithms more directly, without the distractions of moving between an object and its id.
Make IDirectedGraph an abstract base class (type abc.ABCMeta), and mark the required abstract properties and methods.
Remove ObjectGraph.to_dot implementation; delegate to AnnotatedGraph.to_dot instead to avoid duplication. Remove caches of annotation information on the ObjectGraph itself.
There are a couple of minor API changes:
IDirectedGraph instances now always have an edges attribute, returning a collection of the edges.
The complete_subgraph_on_vertices method has been renamed to the more correct (and shorter) full_subgraph.
This PR refactors some of the internals to improve readability, remove duplication, and generally clean up the code.
Internal changes:
KeyTransformDict
andElementTransformSet
classes to abstract away the business of extracting object identities for lookups and vertex sets. This allows us to express the graph algorithms more directly, without the distractions of moving between an object and itsid
.IDirectedGraph
an abstract base class (typeabc.ABCMeta
), and mark the required abstract properties and methods.ObjectGraph.to_dot
implementation; delegate toAnnotatedGraph.to_dot
instead to avoid duplication. Remove caches of annotation information on theObjectGraph
itself.There are a couple of minor API changes:
IDirectedGraph
instances now always have anedges
attribute, returning a collection of the edges.complete_subgraph_on_vertices
method has been renamed to the more correct (and shorter)full_subgraph
.