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_distance_threshold does not return a graph #237

Closed
davidfstein opened this issue Nov 22, 2022 · 3 comments
Closed

add_distance_threshold does not return a graph #237

davidfstein opened this issue Nov 22, 2022 · 3 comments

Comments

@davidfstein
Copy link
Contributor

davidfstein commented Nov 22, 2022

Describe the bug
add_distance_threshold claims to return a graph with distance edges added. However, the function appears to add edges directly to the passed graph and returns nothing.

To Reproduce
Steps to reproduce the behavior:
G = add_distance_threshold(G, 2, 5)
# G is now None

Expected behavior
add_distance_threshold should return a graph with the requisite edges added or the documentation should be modified. The first option seems preferable.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Python Version 3.8.13
  • Graphein Version 1.5.2
@a-r-j
Copy link
Owner

a-r-j commented Nov 22, 2022

Hi @davidfstein , thanks for raising this! The function is supposed to be used in place e.g.

add_distance_edges(G)

I can appreciate how this is confusing from the documentation. Wrt returning the graph, that does seem like it would be smart. I'd need to look at whether or not this would break things downstream. I suppose an inplace argument would be a sensible addition.

@davidfstein
Copy link
Contributor Author

Got it! In the doc string for this function it says ":return: Graph with distance-based edges added" which I think makes it seem like a graph will be returned. Maybe removing that or changing the language would help clear it up.

Thanks for the great package!

@a-r-j
Copy link
Owner

a-r-j commented Nov 22, 2022

Linking to #207

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

2 participants