-
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
Improve performance of from_mbuild #470
Conversation
Codecov Report
@@ Coverage Diff @@
## master #470 +/- ##
=======================================
Coverage 88.96% 88.96%
=======================================
Files 46 46
Lines 3027 3028 +1
=======================================
+ Hits 2693 2694 +1
Misses 334 334
Continue to review full report at Codecov.
|
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.
LGTM! Only some nitpicking with the docstring.
is an gmso.AtomType associated with the site and | ||
it to the sub-topology's AtomTypes collection. |
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.
I think you miss a word here. Is it supposed to be ... the site and add it to the sub-...
|
||
Parameters | ||
---------- | ||
site : gmso.Atom | ||
The site to be added to this sub-topology | ||
update_types : (bool), default=True |
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.
This is just nitpicking, but can you remove the parentheses (so just update_types : bool, default=True
) just so we are consistent with other method.
The
from_mbuild
conversion is very costly. As per previous discussions, we hypothesized that this was because we are repeatedly and unnecessarily runningupdate_types
/update_connections
/etc. commands which loop through every atom (O(N^2) complexity). Here I'm trying to reduce the number of calls to cut down the time it takes to convert from mbuild by applying theupdate_types=False
flag when adding sites and connections. As of this first commit, here are the performance gains forfrom_mbuild
conversions for boxes of tip3p water.