Skip to content
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

Speedup to_parmed conversion #768

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions gmso/external/convert_parmed.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _atom_types_from_pmd(structure):
"epsilon": atom_type.epsilon * u.Unit("kcal / mol"),
},
independent_variables={"r"},
mass=copy.deepcopy(atom_type.mass),
mass=atom_type.mass,
)
pmd_top_atomtypes[atom_type] = top_atomtype
return pmd_top_atomtypes
Expand Down Expand Up @@ -415,9 +415,6 @@ def to_parmed(top, refer_type=True):
msg = "Provided argument is not a topology.Topology."
assert isinstance(top, gmso.Topology)

# Copy structure to not overwrite object in memory
top = copy.deepcopy(top)

# Set up Parmed structure and define general properties
structure = pmd.Structure()
structure.title = top.name
Expand Down Expand Up @@ -555,7 +552,9 @@ def _atom_types_from_gmso(top, structure, atom_map):
"""
# Maps
atype_map = dict()
for atom_type in top.atom_types:
for atom_type in top.atom_types(
filter_by=PotentialFilters.UNIQUE_NAME_CLASS
):
msg = "Atom type {} expression does not match Parmed AtomType default expression".format(
atom_type.name
)
Expand Down
Loading