-
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
Add LayeredDihedral and LayeredImproper support #569
base: old_main
Are you sure you want to change the base?
Add LayeredDihedral and LayeredImproper support #569
Conversation
Codecov Report
@@ Coverage Diff @@
## main #569 +/- ##
==========================================
- Coverage 90.79% 90.72% -0.07%
==========================================
Files 56 56
Lines 4626 4699 +73
==========================================
+ Hits 4200 4263 +63
- Misses 426 436 +10
Continue to review full report at Codecov.
|
…layered-dihedrals
for more information, see https://pre-commit.ci
Perhaps something to watch out for:
|
@rsdefever Thanks for the catch. cfd9125 adds the check while updating connection types. |
This pull request introduces 2 alerts when merging fa751fa into 00f329c - view on LGTM.com new alerts:
|
Can we add a test where there are dihedrals of different functional forms in the layered dihedral? The actual handling of that will be writer-dependent, but we can support that as we develop the writers. |
…layered-dihedrals
for more information, see https://pre-commit.ci
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.
Co-reviewed by @umesh-timalsina @daico007
Aside from some changes with adding a dihedral with the same hash to an indexed set, this should be g2g.
gmso/core/improper.py
Outdated
super().__setattr__(key, value) | ||
|
||
@validator("improper_types_", pre=True, always=True) | ||
def validate_dihedral_types(cls, improper_types): |
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.
def validate_dihedral_types(cls, improper_types): | |
def validate_improper_types(cls, improper_types): |
759c727
to
802185d
Compare
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.
One small docstring change and then this is g2g for me.
Co-authored-by: Justin Gilmer <[email protected]>
for more information, see https://pre-commit.ci
Closes #561.
Checklist
CC:
@bc118 additional comments (10-24-2023):
Multiple Dihedral types (equations) not accepted (Example: CHARMM style with Periodic and Harmonic dihedrals)
Multiple dihedral types should be accepted for both the proper and improper dihedrals. This is the standard input in the CHARMM format. However, in CHARMM, the harmonic dihedrals (proper and improper) are listed as periodic with n=0 (yes, this can be confusing.
We should allow different dihedral types, entering correctly the periodic and harmonic forms as the equations define (see the attached XML). In MoSDeF-GOMC, we will read the proper and improper harmonic dihedrals and write them as the proper and improper periodic dihedrals with n=0 for the CHARMM FF style (required for CHARMM style format - yes, it is confusing). Each writer should handle this separately for their suited engines, where this specific formatted example is for NAMD and the future GOMC once harmonic dihedrals are added.
This is critical if we ever want to be able to use the CHARMM FF in MoSDeF force fields/simulations.
I have provided an example of a proper periodic and harmonic dihedral that fails due to the different dihedral styles.
gmso_ff_with_periodic_and_harmonic_dihedrals.zip