Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default dialect #13

Closed
Raphtor opened this issue Dec 16, 2020 · 2 comments
Closed

Add default dialect #13

Raphtor opened this issue Dec 16, 2020 · 2 comments
Labels
dialects enhancement New feature or request

Comments

@Raphtor
Copy link
Contributor

Raphtor commented Dec 16, 2020

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.

@Raphtor Raphtor added dialects enhancement New feature or request labels Dec 16, 2020
@j6k4m8
Copy link
Member

j6k4m8 commented Dec 18, 2020

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?

@Raphtor
Copy link
Contributor Author

Raphtor commented Jan 4, 2021

Yeah that makes sense.

@Raphtor Raphtor closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants