Closed Raphtor closed 3 years ago
Ah, I think I see what you're saying. I think this is just syntax preference, right?
I usually do something like this:
my_grand_graph = grand.Graph(...)
G = my_grand_graph.nx
G
now has all the networkx-flavored bells and whistles as your graph
var above:
G.add_edge(1, 2)
len(G)
I've hesitated to add any API dialect at the "top level" like you illustrate above because it imposes some restrictions on how the user can use the package: (Why require a networkx install?) Does the graph = grand.Graph(...).nx
solution solve this need?
Yeah that makes sense.
In order to have drop-in compatibility with networkx, we could make the default dialect to be nx, such that
graph.nx.{method} == graph.{method}
. Duck test with nx digraph.