From a28c4fe6bafdd3e016dab753e806011b2728d956 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 21 Jan 2025 19:03:08 +1100 Subject: [PATCH] Simplify _add_to_molecules signature --- openff/pablo/_pdb.py | 4 +--- openff/pablo/_tests/test_pdb.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openff/pablo/_pdb.py b/openff/pablo/_pdb.py index b5f23ed..c3a53fd 100644 --- a/openff/pablo/_pdb.py +++ b/openff/pablo/_pdb.py @@ -291,7 +291,6 @@ def topology_from_pdb( this_molecule = _add_to_molecule( molecules, this_molecule, - res_atom_idcs, chemical_data, data, use_canonical_names, @@ -382,7 +381,6 @@ def _set_box_vectors(topology: Topology, data: PdbData): def _add_to_molecule( molecules: MutableSequence[Molecule], this_molecule: Molecule, - res_atom_idcs: tuple[int, ...], residue_match: ResidueMatch, data: PdbData, use_canonical_names: bool, @@ -406,7 +404,7 @@ def _add_to_molecule( "pdb_idx_to_mol_atom_idx", {}, ) - for pdb_index in res_atom_idcs: + for pdb_index in sorted(residue_match.res_atom_idcs): atom_def = residue_match.atom(pdb_index) if data.alt_loc[pdb_index] != "": diff --git a/openff/pablo/_tests/test_pdb.py b/openff/pablo/_tests/test_pdb.py index 9c7eda7..acc5e3b 100644 --- a/openff/pablo/_tests/test_pdb.py +++ b/openff/pablo/_tests/test_pdb.py @@ -115,7 +115,6 @@ def test_add_to_molecule_when_empty(cys_data: PdbData, cys_match: ResidueMatch): molecules=molecules, this_molecule=this_molecule, residue_match=cys_match, - res_atom_idcs=tuple(cys_match.res_atom_idcs), use_canonical_names=False, ) assert mol_out is this_molecule