Improving parameterized inferrence#1162
Merged
Merged
Conversation
swails
reviewed
Mar 29, 2021
| # 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: |
Contributor
There was a problem hiding this comment.
Suggested change
| 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.
Contributor
Author
There was a problem hiding this comment.
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>
Contributor
Author
|
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>') |
This file contains hidden or 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
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.
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.