diff --git a/package/AUTHORS b/package/AUTHORS index e28256e0ba1..0b0a4b3e9d8 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -201,6 +201,7 @@ Chronological list of authors - Jake Fennick - Utsav Khatu - Patricio Barletta + - Mikhail Glagolev External code diff --git a/package/CHANGELOG b/package/CHANGELOG index 0dea541bdde..96c49fb08b4 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -13,11 +13,13 @@ The rules for this file: * release numbers follow "Semantic Versioning" http://semver.org ------------------------------------------------------------------------------ -??/??/?? IAlibay, pgbarletta +??/??/?? IAlibay, pgbarletta, mglagolev * 2.5.0 Fixes + * Add 'PairIJ Coeffs' to the list of sections in LAMMPSParser.py + (Issue #3336) Enhancements diff --git a/package/MDAnalysis/topology/LAMMPSParser.py b/package/MDAnalysis/topology/LAMMPSParser.py index e89760f8b87..85bf2dec8f6 100644 --- a/package/MDAnalysis/topology/LAMMPSParser.py +++ b/package/MDAnalysis/topology/LAMMPSParser.py @@ -119,6 +119,7 @@ 'Impropers', 'Pair', 'Pair LJCoeffs', + 'PairIJ Coeffs', 'Bond Coeffs', 'Angle Coeffs', 'Dihedral Coeffs', diff --git a/testsuite/MDAnalysisTests/data/lammps/pairij_coeffs.data.bz2 b/testsuite/MDAnalysisTests/data/lammps/pairij_coeffs.data.bz2 new file mode 100644 index 00000000000..df5c8f4564c Binary files /dev/null and b/testsuite/MDAnalysisTests/data/lammps/pairij_coeffs.data.bz2 differ diff --git a/testsuite/MDAnalysisTests/datafiles.py b/testsuite/MDAnalysisTests/datafiles.py index 2eb9ad06950..1bc0b93a8ba 100644 --- a/testsuite/MDAnalysisTests/datafiles.py +++ b/testsuite/MDAnalysisTests/datafiles.py @@ -142,6 +142,7 @@ "LAMMPShyd", "LAMMPShyd2", "LAMMPSdata_deletedatoms", # with deleted atoms "LAMMPSdata_triclinic", # lammpsdata file to test triclinic dimension parsing, albite with most atoms deleted + "LAMMPSdata_PairIJ", # lammps datafile with a PairIJ Coeffs section "LAMMPSDUMP", "LAMMPSDUMP_long", # lammpsdump file with a few zeros sprinkled in the first column first frame "LAMMPSDUMP_allcoords", # lammpsdump file with all coordinate conventions (x,xs,xu,xsu) present, from LAMMPS rdf example @@ -513,6 +514,7 @@ LAMMPShyd2 = resource_filename(__name__, "data/lammps/hydrogen-class1.data2") LAMMPSdata_deletedatoms = resource_filename(__name__, 'data/lammps/deletedatoms.data') LAMMPSdata_triclinic = resource_filename(__name__, "data/lammps/albite_triclinic.data") +LAMMPSdata_PairIJ = resource_filename(__name__, "data/lammps/pairij_coeffs.data.bz2") LAMMPSDUMP = resource_filename(__name__, "data/lammps/wat.lammpstrj.bz2") LAMMPSDUMP_long = resource_filename(__name__, "data/lammps/wat.lammpstrj_long.bz2") LAMMPSDUMP_allcoords = resource_filename(__name__, "data/lammps/spce_all_coords.lammpstrj.bz2") diff --git a/testsuite/MDAnalysisTests/topology/test_lammpsdata.py b/testsuite/MDAnalysisTests/topology/test_lammpsdata.py index b53edd42feb..44a8af7236d 100644 --- a/testsuite/MDAnalysisTests/topology/test_lammpsdata.py +++ b/testsuite/MDAnalysisTests/topology/test_lammpsdata.py @@ -36,6 +36,7 @@ LAMMPSdata_deletedatoms, LAMMPSDUMP, LAMMPSDUMP_long, + LAMMPSdata_PairIJ, ) @@ -179,6 +180,26 @@ def test_traj(self, filename): dtype=np.float32)) +class TestLammpsDataPairIJ(LammpsBase): + """Tests the reading of lammps .data topology file with a + PairIJ Coeffs section + """ + + expected_attrs = ['types', 'resids', 'masses', + 'bonds', 'angles', 'dihedrals', 'impropers'] + ref_filename = LAMMPSdata_PairIJ + expected_n_atoms = 800 + expected_n_atom_types = 2 + expected_n_residues = 1 + ref_n_bonds = 799 + ref_bond = (397, 398) + ref_n_angles = 390 + ref_angle = (722, 723, 724) + ref_n_dihedrals = 385 + ref_dihedral = (722, 723, 724, 725) + ref_n_impropers = 0 + + LAMMPS_NORESID = """\ LAMMPS data file via write_data, version 11 Aug 2017, timestep = 0