-
Notifications
You must be signed in to change notification settings - Fork 33
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
Functions to plot networkx graphs of topology objects #492
Conversation
Codecov Report
@@ Coverage Diff @@
## master #492 +/- ##
==========================================
+ Coverage 89.77% 90.02% +0.25%
==========================================
Files 50 51 +1
Lines 3560 3910 +350
==========================================
+ Hits 3196 3520 +324
- Misses 364 390 +26
Continue to review full report at Codecov.
|
This pull request introduces 6 alerts when merging 905263e into 49217ca - view on LGTM.com new alerts:
|
…lects angles/dihedrals for a particular Site
This pull request introduces 6 alerts when merging 3d6e35b into 49217ca - view on LGTM.com new alerts:
|
…. Add _get_bonds_for method in topology.py
…is_atype "merge new methods to convert angles and dihedrals from the _get_angles,dihderals_for methods in topology.py"
This pull request introduces 6 alerts when merging c1ff20f into 49217ca - view on LGTM.com new alerts:
|
This pull request introduces 3 alerts when merging b573ebe into 49217ca - view on LGTM.com new alerts:
|
…r matplotlib and networkx to io.py
This pull request introduces 3 alerts when merging 9a4d40c into 49217ca - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging cc07db2 into cbb547d - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging b083f03 into 55e634d - view on LGTM.com new alerts:
|
…s_atype "Merge to changes made to master need to be merged"
Co-authored-by: Umesh Timalsina <umesh.timalsina@vanderbilt.edu>
Great work :) I feel like this PR could be adapted to also address these issues: |
I would say this PR covers this use case. Is there a way to close the issue by linking to this PR.
I can take a sample system and add the visualization to the README for Foyer or GMSO. Honestly, I think it might be useful to have a single image that goes on both README's, that shows the connection between the two packages.
This also addresses this issue! If you plot using networkx bonds, angles, or dihedrals and don't specify which atoms you're interested in getting a list of parameters for, the unparameterized connections will be shown.
Again, these needs should be addressed with this PR. |
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.
Umesh reviews addressed
… operations within a jupyter notebook
…o/utils/nx_utils.py for functions used by interactive visualization
This pull request introduces 1 alert when merging 813f605 into 893534b - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 494553d into 893534b - view on LGTM.com new alerts:
|
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.
Applied Umesh suggestions.
This PR builds off of the convert_networkx PR.
This uses the to_networkx(topology) to plot networkx graphs of the topology. It is broken down into the ability to plot by-
atomtype:
gmso.formats.interactive_networkx_atomtypes
bonds:
gmso.formats.interactive_networkx_bonds
angles:
gmso.formats.interactive_networkx_angles
dihedrals:
gmso.formats.interactive_networkx_dihedrals
See the attached help strings for how to change the inputs to see different aspects of a topology.
I considered making these functions a method of the gmso.core.topology.Topology class. However, there are import issues. The gmso/external/convert_networkx.py file imports the topology class so it can create a topology from a networkx object. Since these functions make use of the to_networkx function in this file, either the to_networkx and from_networkx functions need to be separated, or we use this a separate file with these plot_networkx functions. I though it acceptable that they were part of the gmso/formats folder, since networkx is another potential way to output information about these structures.
I'm hoping to continue to add some interactive functionality for working with these networkx objects. This will use
ipywidget.interact
.