Adding a new magic command: %degreeDistribution#749
Adding a new magic command: %degreeDistribution#749
Conversation
|
|
||
|
|
||
|
|
||
| # %degreeDistribution. Takes traversalDirection, vertexLabels, edgeLabels parameters, and visualizes |
There was a problem hiding this comment.
nit: Can you add a more comprehensive docstring here to explain its overall purpose and usage.
There was a problem hiding this comment.
something like
This magic analyzes and displays the distribution of vertex degrees in the graph,
allowing filtering by vertex and edge types. It provides an interactive visualization
with statistics including maximum degree, median degree, and mean degree.
There was a problem hiding this comment.
Also, any estimates on how long this query would take? If its going to be long running, it would be nice to have a progress indicator or something that indicates how much time this could take.
There was a problem hiding this comment.
Making the OC call only takes a couple seconds for com-Orkut, which is really large. But visualization takes some time, and I'm working on it. I'll keep the progress bar in mind in case. Thanks for pointing out.
| "we will default to using all the edge labels.") | ||
|
|
||
|
|
||
| # TODO: Additional parameter for saving the visualization? |
There was a problem hiding this comment.
any estimates on how much effort this would require to implement as well?
There was a problem hiding this comment.
It's trivial but not sure if needed, will confirm with Dave/Ozan.
| @needs_local_scope | ||
| @display_exceptions | ||
| @neptune_graph_only | ||
| def degreeDistribution(self, line, local_ns: dict = None): |
There was a problem hiding this comment.
From what i understand this would only work for Neptune Analytics, right? Please add error handling for when this magic is used with Neptune. Refer to the load magic for reference.
Reference Link: https://github.com/aws/graph-notebook/blob/main/src/graph_notebook/magics/graph_magic.py#L2056-L2061
There was a problem hiding this comment.
Yes, added but please check; I did not use try/catch.
adityaramesh12
left a comment
There was a problem hiding this comment.
Congratulations on your first contribution, @sariyuce! :)
Nice work on implementing the degree distribution visualization! This is a great addition implementing the degree distribution visualization functionality for Neptune Analytics.
The implementation is well-structured and the interactive widget approach will be very useful for users exploring graph degree distributions. Really nice work!
I've added a few suggestions to enhance the code further.
Additionally, Since there are multiple commits in this PR, please remember to squash them when merging to keep our commit history clean. Also ensure you modify the commit message.
Let me know if you need any clarification on the suggestions!
Looking forward to more contributions from you. 🚀
|
Thanks for the comments! I addressed the comments but will have some more changes before the next push. Will squash all. |
…heel for progress, plot is added as the first tab
.gitignore
Outdated
| blazegraph.jnl | ||
| rules.log | ||
| *.env | ||
| notebook/destination/dir/About-the-Neptune-Notebook.ipynb |
There was a problem hiding this comment.
why are we ignoring the sample notebooks? We do maintain and make changes to these sample notebooks too right?
There was a problem hiding this comment.
Must be left over, fixed now. New minor commits below.
Description of changes:
%degreeDistribution visualizes the degree distribution of the graph. It'll make use of a newly implemented
degreeDistributionalgorithm in NA (not GA yet).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.