[API] Duplicated functionality of graph
Created by: PhilipVinc
From AbstractGraph:
@property
@abc.abstractmethod
def n_nodes(self):
r"""int: The number of vertices in the graph"""
raise NotImplementedError
@property
def n_sites(self):
r"""int: The number of vertices in the graph"""
return self.n_nodes
@property
def n_vertices(self):
r"""int: The number of vertices in the graph"""
return self.n_nodes
I'd argye to keep only n_vertices, because it's the same terminology of networkx.
-
We are missing a function returning an iterator over vertices (they are not necessarily ordered, though usually so...)
-
The networkX api has edges as a property. For us it's a function. The only reason for this is because we want to be able to call edges(color=True), but that is only supported on some graphs. I'd therefore argue to make all fields in graph properties, and graphs that support colors should just define a new method (colored_edges) that is an additional property.