-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update apply_forcefield and molecule forcefield #62
Merged
marjanalbooyeh
merged 41 commits into
cmelab:main
from
marjanalbooyeh:update-auto-scale
Sep 29, 2023
Merged
Update apply_forcefield and molecule forcefield #62
marjanalbooyeh
merged 41 commits into
cmelab:main
from
marjanalbooyeh:update-auto-scale
Sep 29, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
==========================================
+ Coverage 93.63% 93.70% +0.06%
==========================================
Files 18 19 +1
Lines 1383 1397 +14
==========================================
+ Hits 1295 1309 +14
Misses 88 88
|
marjanalbooyeh
changed the title
Update auto scale interface
Update apply_forcefield and molecule forcefield
Sep 28, 2023
chrisjonesBSU
approved these changes
Sep 29, 2023
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, Thanks!! I just left one comment about a doc string.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR applies following changes to the Molecule and System classes:
Move
force_field
andauto_scale
parameters fromSystem
init toapply_forcefield
method.Since applying forcefield is now done after system initialization, it makes sense to move all forcefield related parameters to
apply_forcefield
.The
apply_forcefield
method always sets thereference_values
dictionary. Whenauto_scale=True
the reference values will be set based on the maximum parameter value and when its false, the values are set to 1 with default gmso units. As a result, we should always usereference_values
as thebase_units
parameter when calling gmso hoomd functions.Added base classes for forcefield
Two new classes are added to the base module:
BaseXMLForcefield
andBaseHOOMDForcefield
. All the forcefield classes defined in the library now inherit from one of these two base classes. The base classes do not have any additional functionalities, they are defined to ensure all subclasses have similar attribute names. This consistency in attribute names is needed in forcefield validations done in System and Molecule classes.Allow forcefield to be specified in Molecule class
We can pass a valid forcefield to the Molecule class when initializing the molecules. In this case,
apply_forcefield
can be called without passing the forcefields and the system class uses the forcefields from the molecules.Note: Previously, the
Molecule
class had the forcefield parameter but the accepted types were either direct xml files or list of hoomd objects. With the changes in this PR, only valid forcefields, i.e. subclasses of the base forcefield classes, can be passed to the Molecule.