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.
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
Lammps Writer Changes For Updated Topology Class #701
Lammps Writer Changes For Updated Topology Class #701
Changes from 30 commits
8f9fe12
6fd6ecc
2f16b6d
6119f1b
fe88d6b
ff69064
5c15c84
fd65d8e
723cad4
85763c1
120ecff
80f4f35
6134376
511615a
408ef1b
5b1b8bc
fb1dae5
53e67d6
4fc3008
8eb5d65
bfea4f8
444a6d5
c9a977e
8ba6f17
85fbe99
ec56db6
f9c9c60
ca4e227
b500cdf
3df21b0
be63e33
5e9229b
01471a7
c2cfb16
007a288
8f4645f
a676a57
47185f7
a666e99
93ba838
b43d9b8
83faf4b
855fa32
27df258
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 a little confusing and only made sense after looking at the example. Maybe:
Map where the keys represent the current potential type and the corresponding values represent the desired potential 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.
Why make a method for
convert_potential_styles
instead of just usingconvert_topology_expressions
. Regardless of whether this method remains, the import should be at the top of the module considering that it is an in-package import and not an optional external dependency.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.
After discussing with @daico007, all of this will get refactored so that the 3 engine writers are using similar methods. This method is analagous to what HOOMD and GROMACS Top writers are currently using locally, so that code will end up being extracted to this topology method.
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.
Consider adding a link to the unyt package for context:
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.
Should be at the top of the module
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.
It seems like this method only convert all the potentials. Should we also convert the atoms' position too?
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 the initial goal for this method was just to be used on the parameters of the potential expressions, which is why it's missing things. Pairpotentials come to mind as an example of that. However, I ended up converting the expressions on writing out, instead of upfront in the lammpswriter, and mostly relying on methods that are living in lammpsdata.py because of that. I still think the best way to do the conversion would be:
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.
To summarize, I think this function is not used currently at all. I can either delete it, or leave it as a starting place for the next PR that looks to normalize and standardize all of the unit handling in GMSO.
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.
Why make this a separate if statement and not the following
elif
s? It seems like it shouldn't matter either way but it's good to be consistent.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.
unique_atom_types = [atom.atom_type for atom in structure.atoms if isinstance(atom.atom_type, pmd.AtomType)]
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 isinstance(atom.atom_type, pmd.AtomType) and not [1 for atype in unique_atom_types if id(atype) == id(atom.atom_type)]: '
The existing code would collect all atom types I think. There must be a faster way of achieving this though, but the parmed docs don't seem to have this list natively.
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.
use parmed copy method as described in Foyer PR#530
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 creating a copy of the gmso.Topology, not the parmed structure which is what I think you linked to, so this wouldn't apply here.