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

Differentiating between edge types at the API level #26

Open
dhimmel opened this issue Aug 26, 2019 · 2 comments
Open

Differentiating between edge types at the API level #26

dhimmel opened this issue Aug 26, 2019 · 2 comments

Comments

@dhimmel
Copy link
Member

dhimmel commented Aug 26, 2019

I am thinking we want three user-facing functions to perform the permutation. They could be named like:

permute_undirected_edges
permute_directed_edges
permute_bipartite_edges

I think this would be clearest for the user. You could remove the confusing allow_self_loop from permute_bipartite_edges. allow_antiparallel would only be an option for permute_directed_edges. Also permute_undirected_edges could mix sources or targets when swapping to achieve greater potential permutations?

@zietzm, do you think this makes sense?

@dhimmel
Copy link
Member Author

dhimmel commented Aug 26, 2019

If we go with three different functions, it would be nice to avoid duplication of argument definitions and docstrings. Not sure the best way to do this.

One possible option is to use classes / subclasses. These could be helpful for tracking the stats as well.

@dhimmel
Copy link
Member Author

dhimmel commented Aug 26, 2019

Another option is that we could have a single function but take an argument like network_type that would have to be in {"undirected", "directed", "bipartite"}.

If we do have three different functions, possibly functools.wraps / functools.update_wrapper could help with avoiding duplicate documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant