Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Chronological list of authors
- Edis Jakupovic
- Nicholas Craven
- Mieczyslaw Torchala
- Haochuan Chen

External code
-------------
Expand Down
4 changes: 3 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The rules for this file:
------------------------------------------------------------------------------
??/??/?? tylerjereddy, richardjgowers, IAlibay, hmacdope, orbeckst, cbouy,
lilyminium, daveminh, jbarnoud, yuxuanzhuang, VOD555, ianmkenney,
calcraven,xiki-tempula, mieczyslaw, manuel.nuno.melo, PicoCentauri
calcraven,xiki-tempula, mieczyslaw, manuel.nuno.melo, PicoCentauri,
hanatok

* 2.0.0

Expand Down Expand Up @@ -73,6 +74,7 @@ Fixes
would create a test artifact (Issue #2979, PR #2981)

Enhancements
* Improved performance of the ParmEd converter (Issue #3028, PR #3029)
* Improved analysis class docstrings, and added missing classes to the
`__all__` list (PR #2998)
* The PDB writer gives more control over how to write the atom ids
Expand Down
6 changes: 4 additions & 2 deletions package/MDAnalysis/coordinates/ParmEd.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _read_first_frame(self):
}

def get_indices_from_subset(i, atomgroup=None, universe=None):
return atomgroup.index(universe.atoms[i])
return atomgroup[universe.atoms[i]]

class ParmEdConverter(base.ConverterBase):
"""Convert MDAnalysis AtomGroup or Universe to ParmEd :class:`~parmed.structure.Structure`.
Expand Down Expand Up @@ -262,8 +262,10 @@ def convert(self, obj):
struct.box = None

if hasattr(ag_or_ts, 'universe'):
atomgroup = {atom: index for index,
atom in enumerate(list(ag_or_ts))}
get_atom_indices = functools.partial(get_indices_from_subset,
atomgroup=list(ag_or_ts),
atomgroup=atomgroup,
universe=ag_or_ts.universe)
else:
get_atom_indices = lambda x: x
Expand Down