| |
- collections.UserDict(collections.abc.MutableMapping)
-
- AbstractDiGraph(collections.UserDict, vcorelib.io.abc.Serializable)
- vcorelib.io.abc.Serializable(abc.ABC)
-
- AbstractDiGraph(collections.UserDict, vcorelib.io.abc.Serializable)
- AbstractDiGraphNode
class AbstractDiGraph(collections.UserDict, vcorelib.io.abc.Serializable) |
|
AbstractDiGraph(name: str, initialdata: Dict[str, ~T] = None, graph_attrs: Dict[str, str] = None, node_attrs: Dict[str, str] = None, edge_attrs: Dict[str, str] = None) -> None
A simple, directed-graph interface. |
|
- Method resolution order:
- AbstractDiGraph
- collections.UserDict
- collections.abc.MutableMapping
- collections.abc.Mapping
- collections.abc.Collection
- collections.abc.Sized
- collections.abc.Iterable
- collections.abc.Container
- vcorelib.io.abc.Serializable
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, name: str, initialdata: Dict[str, ~T] = None, graph_attrs: Dict[str, str] = None, node_attrs: Dict[str, str] = None, edge_attrs: Dict[str, str] = None) -> None
- Initialize this graph.
- add_edge(self, src: str, dst: str, src_port: str = None, dst_port: str = None, strict: bool = False, **attrs) -> None
- Add an edge between nodes in the graph.
- add_parallel(self, node1: str, node2: str, src_port1: str = None, dst_port1: str = None, src_port2: str = None, dst_port2: str = None, **kwargs) -> None
- Add an edge in each direction for two nodes.
- add_vertex(self, label: str, node: ~T) -> ~T
- Add a vertext to the graph.
- handle_node(self, label: str, node: ~T = None) -> ~T
- Handle either adding a node as a new vertex or obtaining an existing
one.
- is_parallel(self, node1: str, node2: str) -> bool
- Determine if parallel edges exist between two nodes.
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'to_stream'})
Methods inherited from collections.UserDict:
- __contains__(self, key)
- # Modify __contains__ and get() to work like dict
# does when __missing__ is present.
- __copy__(self)
- __delitem__(self, key)
- __getitem__(self, key)
- __ior__(self, other)
- __iter__(self)
- __len__(self)
- __or__(self, other)
- Return self|value.
- __repr__(self)
- Return repr(self).
- __ror__(self, other)
- Return value|self.
- __setitem__(self, key, item)
- copy(self)
- get(self, key, default=None)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
Class methods inherited from collections.UserDict:
- fromkeys(iterable, value=None) from abc.ABCMeta
Data descriptors inherited from collections.UserDict:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Methods inherited from collections.abc.MutableMapping:
- clear(self)
- D.clear() -> None. Remove all items from D.
- pop(self, key, default=<object object at 0x7f3fa7da81c0>)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem(self)
- D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(self, key, default=None)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(self, other=(), /, **kwds)
- D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v
Methods inherited from collections.abc.Mapping:
- __eq__(self, other)
- Return self==value.
- items(self)
- D.items() -> a set-like object providing a view on D's items
- keys(self)
- D.keys() -> a set-like object providing a view on D's keys
- values(self)
- D.values() -> an object providing a view on D's values
Data and other attributes inherited from collections.abc.Mapping:
- __hash__ = None
- __reversed__ = None
Class methods inherited from collections.abc.Collection:
- __subclasshook__(C) from abc.ABCMeta
- Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__().
It should return True, False or NotImplemented. If it returns
NotImplemented, the normal algorithm is used. Otherwise, it
overrides the normal algorithm (and the outcome is cached).
Class methods inherited from collections.abc.Iterable:
- __class_getitem__ = GenericAlias(...) from abc.ABCMeta
- Represent a PEP 585 generic type
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
Methods inherited from vcorelib.io.abc.Serializable:
- default_location(self) -> Union[pathlib.Path, str, NoneType]
- Get a default serialization destination for this instance.
- to_file(self, path: Union[pathlib.Path, str, NoneType] = None, encoding: str = 'utf-8', **kwargs) -> None
- Write this object to a file.
- to_stream(self, stream: <class 'TextIO'>, **kwargs) -> None
- Write this object to a text stream.
|
class AbstractDiGraphNode(vcorelib.io.abc.Serializable) |
|
AbstractDiGraphNode(graph: ~V = None, label: str = None, port: vcorelib.graph.port.Port = None, **attrs) -> None
A base interface for a directed-graph node. |
|
- Method resolution order:
- AbstractDiGraphNode
- vcorelib.io.abc.Serializable
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, graph: ~V = None, label: str = None, port: vcorelib.graph.port.Port = None, **attrs) -> None
- Initialize this graph node.
- add_port(self, label: str, **kwargs) -> vcorelib.graph.port.Port
- Add a port to this graph node.
- allocate_port(self, label: str) -> vcorelib.graph.port.Port
- Allocate a port on this node.
- graph(self, kind: Type[~V] = None) -> ~V
- Get the graph that this node belongs to.
- incoming(self, graph_kind: Type[~V] = None) -> Iterator[~T]
- Iterate over nodes that have incoming edges.
- join_graph(self, graph: ~V, label: str) -> None
- Attempt to join a graph.
- outgoing(self, graph_kind: Type[~V] = None) -> Iterator[~T]
- Iterate over nodes that we have outgoing edges to.
- parallel(self) -> Set[~T]
- Iterate over nodes that this instance shares parallel edges with.
Readonly properties defined here:
- label
- Get this node's label.
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'to_stream'})
Methods inherited from vcorelib.io.abc.Serializable:
- default_location(self) -> Union[pathlib.Path, str, NoneType]
- Get a default serialization destination for this instance.
- to_file(self, path: Union[pathlib.Path, str, NoneType] = None, encoding: str = 'utf-8', **kwargs) -> None
- Write this object to a file.
- to_stream(self, stream: <class 'TextIO'>, **kwargs) -> None
- Write this object to a text stream.
Data descriptors inherited from vcorelib.io.abc.Serializable:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
| |