-
Notifications
You must be signed in to change notification settings - Fork 148
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
Improving parameterized inferrence #1162
Conversation
parmed/structure.py
Outdated
# everything else... we don't want __repr__ to be super expensive | ||
if len(self.bonds) > 0 and self.bonds[0].type is not None: | ||
retstr.append('; parametrized>') | ||
if self.atoms[0].type: |
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.
if self.atoms[0].type: | |
if self.atoms[0].atom_type is not UnassignedAtomType and self.atoms[0]._epsilon is None: |
This is probably a better heuristic to use. It's possible to provide parameters without defining an explicit type string, but you really can't provide parameters and have the atoms have an UnassignedAtomType and the nonbonded L-J terms be not set.
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.
Even better, but shouldn't the condition be the following?
if self.atoms[0].atom_type is not UnassignedAtomType and self.atoms[0]._epsilon is not None:
Co-authored-by: Jason Swails <jason@entos.ai>
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.
Bump
I went with the most logical criterion based on your suggestion: if self.atoms[0].atom_type is UnassignedAtomType and self.atoms[0]._epsilon is None:
retstr.append('; NOT parameterized>')
else:
retstr.append('; parameterized>') |
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.
Thanks!
In parmed.structure.Structure._ repr _, parameterization is inferred from bonds/bond types. However, for a system of non-bonded parameterized atoms, Structure appears unparameterized. An improvement is suggested here based on atom types.