diff --git a/package/AUTHORS b/package/AUTHORS index 41bfd346411..52b6003b9cf 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -150,6 +150,7 @@ Chronological list of authors - Edis Jakupovic - Nicholas Craven - Mieczyslaw Torchala + - Haochuan Chen External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index c12b68350ce..bcc74b0a142 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -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 @@ -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 diff --git a/package/MDAnalysis/coordinates/ParmEd.py b/package/MDAnalysis/coordinates/ParmEd.py index 33ec782c48f..8b28bb47ca3 100644 --- a/package/MDAnalysis/coordinates/ParmEd.py +++ b/package/MDAnalysis/coordinates/ParmEd.py @@ -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`. @@ -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