You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
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):
The text was updated successfully, but these errors were encountered: