Skip to content
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

Improved performance of bond look up #1084

Closed
wants to merge 33 commits into from

Conversation

chrisiacovella
Copy link
Contributor

@chrisiacovella chrisiacovella commented Jan 31, 2023

PR Summary:

Related to issue #1082

This code uses the connected_components information in the bond graph to substantially speed up to accessing information on the bonds in Compounds.

PR Checklist


  • Includes appropriate unit test(s)
  • Appropriate docstring(s) are added/updated
  • Code is (approximately) PEP8 compliant
  • Issue(s) raised/addressed?

if self.root.bond_graph:
connected_subgraph = self.root.bond_graph.connected_components()
bonds = []
molecule_tags = {}

Check notice

Code scanning / CodeQL

Unused local variable

Variable molecule_tags is not used.
@codecov
Copy link

codecov bot commented Feb 1, 2023

Codecov Report

Base: 90.54% // Head: 90.58% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (1296b1d) compared to base (3d7c93d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1084      +/-   ##
==========================================
+ Coverage   90.54%   90.58%   +0.03%     
==========================================
  Files          61       61              
  Lines        6190     6216      +26     
==========================================
+ Hits         5605     5631      +26     
  Misses        585      585              
Impacted Files Coverage Δ
mbuild/compound.py 96.94% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Christopher Iacovella and others added 16 commits February 1, 2023 22:27
* Reorder bond, angle, and dihedral in write_lammpsdata

* Update ordering charm angles/dihedrals

* Bug fix tests

* Update bond/angle/dihedral sorting algorithm

---------

Co-authored-by: Co Quach <43968221+daico007@users.noreply.github.com>
updates:
- [github.com/pycqa/isort: 5.11.4 → 5.12.0](PyCQA/isort@5.11.4...5.12.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@chrisiacovella chrisiacovella marked this pull request as draft February 3, 2023 05:38
@chrisiacovella
Copy link
Contributor Author

While this works and provides a big improvement, it will be much more beneficial to simply swap out bond_graph for networkx, so I'm going to just remove this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants