Skip to content

Commit

Permalink
Add explicit number of nodes/edges calls to dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
j6k4m8 committed Apr 17, 2024
1 parent 8acbd7d commit c688855
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grand/dialects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def is_directed(self):
def __len__(self):
return self.parent.backend.get_node_count()

def number_of_nodes(self):
return self.parent.backend.get_node_count()

def number_of_edges(self):
return self.parent.backend.get_edge_count()


class IGraphDialect(nx.Graph):
"""
Expand Down

0 comments on commit c688855

Please sign in to comment.