diff --git a/package/CHANGELOG b/package/CHANGELOG index 909020a8661..a3af49d794b 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -14,11 +14,13 @@ The rules for this file: ------------------------------------------------------------------------------- -??/??/?? IAlibay, ChiahsinChu, RMeli, tanishy7777, talagayev +??/??/?? IAlibay, ChiahsinChu, RMeli, tanishy7777, talagayev, + tyler.je.reddy * 2.9.0 Fixes + * Add support for TPR files produced by GROMACS 2024.4 * Fixes invalid default unit from Angstrom to Angstrom^{-3} for convert_density() function. (Issue #4829) * Fixes deprecation warning Array to scalar convertion. Replaced atan2() with np.arctan2() (Issue #4339) * Replaced mutable defaults with None and initialized them within diff --git a/package/MDAnalysis/topology/TPRParser.py b/package/MDAnalysis/topology/TPRParser.py index 022af574a28..5c648016e87 100644 --- a/package/MDAnalysis/topology/TPRParser.py +++ b/package/MDAnalysis/topology/TPRParser.py @@ -67,6 +67,7 @@ 127 28 2022 yes 129 28 2023 yes 133 28 2024.1 yes + 134 28 2024.4 yes ========== ============== ==================== ===== .. [*] Files generated by the beta versions of Gromacs 2020 are NOT supported. diff --git a/package/MDAnalysis/topology/tpr/setting.py b/package/MDAnalysis/topology/tpr/setting.py index 89f8ffa09aa..ebb749d588d 100644 --- a/package/MDAnalysis/topology/tpr/setting.py +++ b/package/MDAnalysis/topology/tpr/setting.py @@ -38,7 +38,8 @@ """ #: Gromacs TPR file format versions that can be read by the TPRParser. -SUPPORTED_VERSIONS = (58, 73, 83, 100, 103, 110, 112, 116, 119, 122, 127, 129, 133) +SUPPORTED_VERSIONS = (58, 73, 83, 100, 103, 110, 112, + 116, 119, 122, 127, 129, 133, 134) # Some constants STRLEN = 4096 diff --git a/package/MDAnalysis/topology/tpr/utils.py b/package/MDAnalysis/topology/tpr/utils.py index 9ba7d8e63ab..98b4a4bb845 100644 --- a/package/MDAnalysis/topology/tpr/utils.py +++ b/package/MDAnalysis/topology/tpr/utils.py @@ -481,6 +481,10 @@ def do_iparams(data, functypes, fver): elif i in [setting.F_RESTRANGLES]: data.unpack_real() # harmonic.rA data.unpack_real() # harmonic.krA + if fver >= 134: + data.unpack_real() # harmonic.rB + data.unpack_real() # harmonic.krB + elif i in [setting.F_LINEAR_ANGLES]: data.unpack_real() # linangle.klinA data.unpack_real() # linangle.aA @@ -598,6 +602,9 @@ def do_iparams(data, functypes, fver): elif i in [setting.F_RESTRDIHS]: data.unpack_real() # pdihs.phiA data.unpack_real() # pdihs.cpA + if fver >= 134: + data.unpack_real() # pdihs.phiB + data.unpack_real() # pdihs.cpB elif i in [setting.F_DISRES]: data.unpack_int() # disres.label data.unpack_int() # disres.type @@ -640,6 +647,8 @@ def do_iparams(data, functypes, fver): elif i in [setting.F_CBTDIHS]: ndo_real(data, setting.NR_CBTDIHS) # cbtdihs.cbtcA + if fver >= 134: + ndo_real(data, setting.NR_CBTDIHS) # cbtdihs.cbtcB elif i in [setting.F_RBDIHS]: ndo_real(data, setting.NR_RBDIHS) # iparams_rbdihs_rbcA diff --git a/testsuite/MDAnalysisTests/data/tprs/2lyz_gmx_2024_4.tpr b/testsuite/MDAnalysisTests/data/tprs/2lyz_gmx_2024_4.tpr new file mode 100644 index 00000000000..9fd71ce8fa6 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/tprs/2lyz_gmx_2024_4.tpr differ diff --git a/testsuite/MDAnalysisTests/data/tprs/all_bonded/dummy_2024_4.tpr b/testsuite/MDAnalysisTests/data/tprs/all_bonded/dummy_2024_4.tpr new file mode 100644 index 00000000000..03b95c151b8 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/tprs/all_bonded/dummy_2024_4.tpr differ diff --git a/testsuite/MDAnalysisTests/data/tprs/virtual_sites/extra-interactions-2024_4.tpr b/testsuite/MDAnalysisTests/data/tprs/virtual_sites/extra-interactions-2024_4.tpr new file mode 100644 index 00000000000..f061aa16ebb Binary files /dev/null and b/testsuite/MDAnalysisTests/data/tprs/virtual_sites/extra-interactions-2024_4.tpr differ diff --git a/testsuite/MDAnalysisTests/datafiles.py b/testsuite/MDAnalysisTests/datafiles.py index 9a63d33716c..3d3d7d93129 100644 --- a/testsuite/MDAnalysisTests/datafiles.py +++ b/testsuite/MDAnalysisTests/datafiles.py @@ -86,13 +86,15 @@ "TPR460", "TPR461", "TPR502", "TPR504", "TPR505", "TPR510", "TPR2016", "TPR2018", "TPR2019B3", "TPR2020B2", "TPR2020", "TPR2020Double", "TPR2021", "TPR2021Double", "TPR2022RC1", "TPR2023", "TPR2024", + "TPR2024_4", "TPR510_bonded", "TPR2016_bonded", "TPR2018_bonded", "TPR2019B3_bonded", "TPR2020B2_bonded", "TPR2020_bonded", "TPR2020_double_bonded", "TPR2021_bonded", "TPR2021_double_bonded", "TPR2022RC1_bonded", "TPR334_bonded", "TPR2023_bonded", "TPR2024_bonded", + "TPR2024_4_bonded", "TPR_EXTRA_2021", "TPR_EXTRA_2020", "TPR_EXTRA_2018", "TPR_EXTRA_2016", "TPR_EXTRA_407", "TPR_EXTRA_2022RC1", - "TPR_EXTRA_2023", "TPR_EXTRA_2024", + "TPR_EXTRA_2023", "TPR_EXTRA_2024", "TPR_EXTRA_2024_4", "PDB_sub_sol", "PDB_sub_dry", # TRRReader sub selection "TRR_sub_sol", "XTC_sub_sol", @@ -407,6 +409,7 @@ TPR2022RC1 = (_data_ref / 'tprs/2lyz_gmx_2022-rc1.tpr').as_posix() TPR2023 = (_data_ref / 'tprs/2lyz_gmx_2023.tpr').as_posix() TPR2024 = (_data_ref / 'tprs/2lyz_gmx_2024.tpr').as_posix() +TPR2024_4 = (_data_ref / 'tprs/2lyz_gmx_2024_4.tpr').as_posix() # double precision TPR455Double = (_data_ref / 'tprs/drew_gmx_4.5.5.double.tpr').as_posix() TPR460 = (_data_ref / 'tprs/ab42_gmx_4.6.tpr').as_posix() @@ -427,7 +430,9 @@ TPR2022RC1_bonded = (_data_ref / 'tprs/all_bonded/dummy_2022-rc1.tpr').as_posix() TPR2023_bonded = (_data_ref / 'tprs/all_bonded/dummy_2023.tpr').as_posix() TPR2024_bonded = (_data_ref / 'tprs/all_bonded/dummy_2024.tpr').as_posix() +TPR2024_4_bonded = (_data_ref / 'tprs/all_bonded/dummy_2024_4.tpr').as_posix() # all interactions +TPR_EXTRA_2024_4 = (_data_ref / 'tprs/virtual_sites/extra-interactions-2024_4.tpr').as_posix() TPR_EXTRA_2024 = (_data_ref / 'tprs/virtual_sites/extra-interactions-2024.tpr').as_posix() TPR_EXTRA_2023 = (_data_ref / 'tprs/virtual_sites/extra-interactions-2023.tpr').as_posix() TPR_EXTRA_2022RC1 = (_data_ref / 'tprs/virtual_sites/extra-interactions-2022-rc1.tpr').as_posix() diff --git a/testsuite/MDAnalysisTests/topology/test_tprparser.py b/testsuite/MDAnalysisTests/topology/test_tprparser.py index 34461c3d66d..208769bd61d 100644 --- a/testsuite/MDAnalysisTests/topology/test_tprparser.py +++ b/testsuite/MDAnalysisTests/topology/test_tprparser.py @@ -32,14 +32,15 @@ TPR450, TPR451, TPR452, TPR453, TPR454, TPR455, TPR455Double, TPR460, TPR461, TPR502, TPR504, TPR505, TPR510, TPR510_bonded, TPR2016, TPR2018, TPR2019B3, TPR2020B2, TPR2020, TPR2020Double, - TPR2021, TPR2021Double, TPR2022RC1, TPR2023, TPR2024, + TPR2021, TPR2021Double, TPR2022RC1, TPR2023, TPR2024, TPR2024_4, TPR2016_bonded, TPR2018_bonded, TPR2019B3_bonded, TPR2020B2_bonded, TPR2020_bonded, TPR2020_double_bonded, TPR2021_bonded, TPR2021_double_bonded, TPR334_bonded, TPR2022RC1_bonded, TPR2023_bonded, TPR2024_bonded, + TPR2024_4_bonded, TPR_EXTRA_2021, TPR_EXTRA_2020, TPR_EXTRA_2018, TPR_EXTRA_2016, TPR_EXTRA_407, TPR_EXTRA_2022RC1, - TPR_EXTRA_2023, TPR_EXTRA_2024, + TPR_EXTRA_2023, TPR_EXTRA_2024, TPR_EXTRA_2024_4, XTC, ) from MDAnalysisTests.topology.base import ParserBase @@ -58,6 +59,8 @@ TPR2022RC1_bonded, TPR2023_bonded, TPR2024_bonded, + TPR2024_4_bonded, + TPR_EXTRA_2024_4, TPR_EXTRA_2024, TPR_EXTRA_2023, TPR_EXTRA_2022RC1, @@ -135,7 +138,7 @@ class TestTPRGromacsVersions(TPRAttrs): TPR455, TPR502, TPR504, TPR505, TPR510, TPR2016, TPR2018, TPR2019B3, TPR2020, TPR2020Double, TPR2021, TPR2021Double, TPR2022RC1, TPR2023, - TPR2024]) + TPR2024, TPR2024_4]) def filename(self, request): return request.param @@ -262,7 +265,7 @@ def test_all_impropers(topology, impr): @pytest.fixture(params=( TPR400, TPR402, TPR403, TPR404, TPR405, TPR406, TPR407, TPR450, TPR451, TPR452, TPR453, TPR454, TPR502, TPR504, TPR505, TPR510, TPR2016, TPR2018, - TPR2023, TPR2024, + TPR2023, TPR2024, TPR2024_4, )) def bonds_water(request): parser = MDAnalysis.topology.TPRParser.TPRParser(request.param).parse()