jraph icon indicating copy to clipboard operation
jraph copied to clipboard

Added from_scipy_sparse_matrix function

Open salfaris opened this issue 2 years ago • 2 comments

I've added a simple function (together with tests) to convert a scipy sparse matrix into a jraph GraphsTuple as per mentioned in issue #36. Let me know if anything need changes :)

Some future work I'm considering includes making a to_scipy_sparse_matrix function and intermediate functions for NetworkX.

salfaris avatar Jun 14 '22 16:06 salfaris

So I've updated sparse_matrix_to_graphs_tuple to be independent of scipy. Plus, I've implemented it using np.repeat as you suggested making it not only faster but cleaner as well. Let me know what you think about this @jg8610 :)

salfaris avatar Jul 03 '22 18:07 salfaris

So I've updated sparse_matrix_to_graphs_tuple to be independent of scipy. Plus, I've implemented it using np.repeat as you suggested making it not only faster but cleaner as well. Let me know what you think about this @jg8610 :)

Hey @jg8610, would be great if you can check this out thanks 😄

salfaris avatar Jul 27 '22 12:07 salfaris

Thanks for bearing with me! I think this looks good, if you could resolve the final conflict I'll accept it :)

jg8610 avatar Aug 15 '22 11:08 jg8610

No worries at all @jg8610 :)

And conflict is resolved!

salfaris avatar Aug 15 '22 12:08 salfaris

I've fixed the merge linting errors you mentioned @jg8610. I was a bit surprised that autopep8 did not remove the trailing white spaces in long comments. Probably it is a feature and not a bug.

Let me know if there are any more linting errors :)

salfaris avatar Aug 18 '22 15:08 salfaris