-
Notifications
You must be signed in to change notification settings - Fork 43
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 non-backtracking spectral distance #134
Conversation
|
#133 is included in this PR..... Edit: Looks like you changed it back, thx |
@sdmccabe do we want to add |
A bit concerned that it seems like the |
I see two approaches:
|
@tlarock I see what you're saying but (i) Fall 2018 is not too bad (and I got response from them as early as Jan 10 here, and (ii) I don't think this is an immediate problem. The scenario where our code breaks because this one dependency is outdated seems very far away, maybe years? And even in that case, the only part of our code that breaks is this one distance (which is not even a good one imho...) @sdmccabe Agreed. I don't think it's too hard to make sure that we are always testing more than what we are using, precisely because |
No one's objected, so I think we can just add |
|
This looks related to this issue. I'll try installing Cython beforehand. |
requirements.txt
Outdated
@@ -2,4 +2,5 @@ networkx>=2.2.0 | |||
numpy>=1.10.0 | |||
scipy>=1.0.0 | |||
scikit-learn>=0.18.2 | |||
Cython==0.29.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why ==
instead of >=
? I just want to get this merged already so we can play with it, so don't change it, but just wondering.
Yikes. |
Because I copy pasted the output of `pip freeze`. It should probably be
`>=`.
…On Mon, Mar 11, 2019 at 3:37 PM Stefan McCabe ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In requirements.txt
<#134 (comment)>:
> @@ -2,4 +2,5 @@ networkx>=2.2.0
numpy>=1.10.0
scipy>=1.0.0
scikit-learn>=0.18.2
+Cython==0.29.6
Out of curiosity, why == instead of >=? I just want to get this merged
already so we can play with it, so don't change it, but just wondering.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#134 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABC8AODPpTa2fWGAUKU1murji41XYFqLks5vVrB7gaJpZM4bfsE4>
.
--
www.leotrs.com | [email protected]
PhD student at the Network Science Institute, Northeastern University
|
I'll note that the |
def test_same_graph():
"""The distance between two equal graphs must be zero."""
G = nx.karate_club_graph()
for obj in distance.__dict__.values():
if isinstance(obj, type) and BaseDistance in obj.__bases__:
dist = obj().dist(G, G)
> assert dist == 0.0
E assert 0.02209708691208376 == 0.0
test_distance.py:22: AssertionError |
The stochasticity is going to keep that test from passing. For now let's except it from the test (and note it in the docstring). The test can be modified to something like the following: def test_same_graph():
"""The distance between two equal graphs must be zero."""
G = nx.karate_club_graph()
for label, obj in distance.__dict__.items():
if label in [
'NBD'
]:
continue
if isinstance(obj, type) and BaseDistance in obj.__bases__:
dist = obj().dist(G, G)
assert dist == 0.0 We'll probably need to do the same for the symmetry test. |
We'll need to update the docs, but let's get this merged. |
I'll leave this here for posterity. POT depends on Cython which depends on |
Pioneered by one Leonardo Torres linky.
Apologies for the mess of commits...