Skip to content

Commit e6c1b44

Browse files
ENH: tpx 138 (GROMACS 2026.0) support (#5219)
* ENH: tpx 138 (GROMACS 2026.0) support (TPX generation 29) * Add .tpr parsing support for GROMACS 2026.0, which was recently released: https://manual.gromacs.org/2026.0/release-notes/2026/major/highlights.html * test file generation: used gmx convert-tpr with GROMACS 2026.0 on the alanine dipeptide NN potential .tpr provided back in gh-4919. --------- Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
1 parent 6b8d417 commit e6c1b44

File tree

10 files changed

+31
-6
lines changed

10 files changed

+31
-6
lines changed

package/CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Fixes
3737
DSSP by porting upstream PyDSSP 0.9.1 fix (Issue #4913)
3838

3939
Enhancements
40+
* Adds support for parsing `.tpr` files produced by GROMACS 2026.0
4041
* Enables parallelization for analysis.diffusionmap.DistanceMatrix
4142
(Issue #4679, PR #4745)
4243

package/MDAnalysis/topology/TPRParser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
133 28 2024.1 yes
7070
134 28 2024.4 yes
7171
137 28 2025.0 yes
72+
138 29 2026.0 yes
7273
========== ============== ==================== =====
7374
7475
.. [*] Files generated by the beta versions of Gromacs 2020 are NOT supported.

package/MDAnalysis/topology/tpr/setting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
133,
5555
134,
5656
137,
57+
138,
5758
)
5859

5960
# Some constants

testsuite/MDAnalysisTests/coordinates/test_tpr.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
TPR455Double,
6565
TPR_xvf_2024_4,
6666
TPR_NNPOT_2025_0,
67+
TPR_NNPOT_2026_0,
6768
TPR2020B2,
6869
INPCRD,
6970
TPR_gh_5145,
@@ -82,6 +83,14 @@
8283
# this case is an alanine dipeptide
8384
# with neural network potential active
8485
# and nonzero velocities
86+
(
87+
TPR_NNPOT_2026_0, # tpx 138
88+
[2.36700e00, 2.30000e-02, 9.20000e-02],
89+
[2.95100e00, 2.00000e-01, 2.41000e-01],
90+
(23, 3),
91+
[-4.72100e-01, -2.20900e-01, -2.42800e-01],
92+
[-1.11900e-01, -3.69300e-01, -6.10000e-03],
93+
),
8594
(
8695
TPR_NNPOT_2025_0, # tpx 137
8796
[2.36700e00, 2.30000e-02, 9.20000e-02],
503 KB
Binary file not shown.
10.7 KB
Binary file not shown.
5.07 KB
Binary file not shown.
Binary file not shown.

testsuite/MDAnalysisTests/datafiles.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
"TPR2024",
137137
"TPR2024_4",
138138
"TPR2025_0",
139+
"TPR2026_0",
139140
"TPR510_bonded",
140141
"TPR2016_bonded",
141142
"TPR2018_bonded",
@@ -151,6 +152,7 @@
151152
"TPR2024_bonded",
152153
"TPR2024_4_bonded",
153154
"TPR2025_0_bonded",
155+
"TPR2026_0_bonded",
154156
"TPR_EXTRA_2021",
155157
"TPR_EXTRA_2020",
156158
"TPR_EXTRA_2018",
@@ -161,7 +163,9 @@
161163
"TPR_EXTRA_2024",
162164
"TPR_EXTRA_2024_4",
163165
"TPR_EXTRA_2025_0",
166+
"TPR_EXTRA_2026_0",
164167
"TPR_NNPOT_2025_0",
168+
"TPR_NNPOT_2026_0",
165169
"PDB_sub_sol",
166170
"PDB_sub_dry", # TRRReader sub selection
167171
"TRR_sub_sol",
@@ -568,6 +572,7 @@
568572
TPR2024 = (_data_ref / "tprs/2lyz_gmx_2024.tpr").as_posix()
569573
TPR2024_4 = (_data_ref / "tprs/2lyz_gmx_2024_4.tpr").as_posix()
570574
TPR2025_0 = (_data_ref / "tprs/2lyz_gmx_2025_0.tpr").as_posix()
575+
TPR2026_0 = (_data_ref / "tprs/2lyz_gmx_2026_0.tpr").as_posix()
571576
# double precision
572577
TPR455Double = (_data_ref / "tprs/drew_gmx_4.5.5.double.tpr").as_posix()
573578
TPR460 = (_data_ref / "tprs/ab42_gmx_4.6.tpr").as_posix()
@@ -600,7 +605,11 @@
600605
TPR2024_bonded = (_data_ref / "tprs/all_bonded/dummy_2024.tpr").as_posix()
601606
TPR2024_4_bonded = (_data_ref / "tprs/all_bonded/dummy_2024_4.tpr").as_posix()
602607
TPR2025_0_bonded = (_data_ref / "tprs/all_bonded/dummy_2025_0.tpr").as_posix()
608+
TPR2026_0_bonded = (_data_ref / "tprs/all_bonded/dummy_2026_0.tpr").as_posix()
603609
# all interactions
610+
TPR_EXTRA_2026_0 = (
611+
_data_ref / "tprs/virtual_sites/extra-interactions-2026_0.tpr"
612+
).as_posix()
604613
TPR_EXTRA_2025_0 = (
605614
_data_ref / "tprs/virtual_sites/extra-interactions-2025_0.tpr"
606615
).as_posix()
@@ -633,6 +642,7 @@
633642
).as_posix()
634643
# ALA dipeptide with neural network potential and a few other options
635644
TPR_NNPOT_2025_0 = (_data_ref / "tprs/ala_nnpot_gmx_2025_0.tpr").as_posix()
645+
TPR_NNPOT_2026_0 = (_data_ref / "tprs/ala_nnpot_gmx_2026_0.tpr").as_posix()
636646

637647
XYZ_psf = (_data_ref / "2r9r-1b.psf").as_posix()
638648
XYZ_bz2 = (_data_ref / "2r9r-1b.xyz.bz2").as_posix()

testsuite/MDAnalysisTests/topology/test_tprparser.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
TPR2016, TPR2018, TPR2019B3, TPR2020,
3535
TPR2020B2, TPR2021, TPR2022RC1,
3636
TPR2023, TPR2024, TPR2024_4,
37-
TPR2025_0,
37+
TPR2025_0, TPR2026_0,
3838
TPR_EXTRA_407, TPR_EXTRA_2016,
3939
TPR_EXTRA_2018, TPR_EXTRA_2020,
4040
TPR_EXTRA_2021, TPR_EXTRA_2022RC1,
4141
TPR_EXTRA_2023, TPR_EXTRA_2024,
4242
TPR_EXTRA_2024_4, XTC, TPR334_bonded,
43-
TPR_EXTRA_2025_0,
43+
TPR_EXTRA_2025_0, TPR_EXTRA_2026_0,
4444
TPR455Double, TPR510_bonded,
4545
TPR2016_bonded, TPR2018_bonded,
4646
TPR2019B3_bonded, TPR2020_bonded,
@@ -50,7 +50,8 @@
5050
TPR2021Double, TPR2022RC1_bonded,
5151
TPR2023_bonded, TPR2024_4_bonded,
5252
TPR2025_0_bonded, TPR2024_bonded,
53-
TPR_NNPOT_2025_0)
53+
TPR2026_0_bonded,
54+
TPR_NNPOT_2025_0, TPR_NNPOT_2026_0)
5455
from numpy.testing import assert_equal
5556

5657
# fmt: on
@@ -70,6 +71,8 @@
7071
TPR2024_bonded,
7172
TPR2024_4_bonded,
7273
TPR2025_0_bonded,
74+
TPR2026_0_bonded,
75+
TPR_EXTRA_2026_0,
7376
TPR_EXTRA_2025_0,
7477
TPR_EXTRA_2024_4,
7578
TPR_EXTRA_2024,
@@ -154,7 +157,7 @@ class TestTPRGromacsVersions(TPRAttrs):
154157
TPR451, TPR452, TPR453, TPR454, TPR455, TPR502, TPR504, TPR505,
155158
TPR510, TPR2016, TPR2018, TPR2019B3, TPR2020, TPR2020Double,
156159
TPR2021, TPR2021Double, TPR2022RC1, TPR2023, TPR2024, TPR2024_4,
157-
TPR2025_0,
160+
TPR2025_0, TPR2026_0,
158161
]
159162
)
160163
# fmt: on
@@ -220,7 +223,7 @@ class TestTPRNnpot(TPRAttrs):
220223
ref_molnums = np.array([0] * 2)
221224
ref_chainIDs = ["A"]
222225

223-
@pytest.fixture(params=[TPR_NNPOT_2025_0])
226+
@pytest.fixture(params=[TPR_NNPOT_2025_0, TPR_NNPOT_2026_0])
224227
def filename(self, request):
225228
return request.param
226229

@@ -357,7 +360,7 @@ def test_settle(bonds_water):
357360
assert bonds_water[-1][1] == 2262
358361

359362

360-
@pytest.mark.parametrize("tpr_path", [TPR_NNPOT_2025_0])
363+
@pytest.mark.parametrize("tpr_path", [TPR_NNPOT_2025_0, TPR_NNPOT_2026_0])
361364
def test_ala2(tpr_path):
362365
topology = MDAnalysis.topology.TPRParser.TPRParser(tpr_path).parse()
363366
# Check that bonds etc are read correctly

0 commit comments

Comments
 (0)