Skip to content

Commit bd00f88

Browse files
IAlibaylilyminium
andauthored
Unpin parmed w/ numpy v2 (#4883)
* Update ParmEd.py * Update test_parmed.py * Update util.py * Update package/MDAnalysis/converters/ParmEd.py Co-authored-by: Lily Wang <[email protected]> --------- Co-authored-by: Lily Wang <[email protected]>
1 parent 6a75df0 commit bd00f88

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

package/MDAnalysis/converters/ParmEd.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383

8484
from ..guesser.tables import SYMB2Z
8585
import numpy as np
86-
from numpy.lib import NumpyVersion
8786

8887
from . import base
8988
from ..coordinates.base import SingleFrameReaderBase
@@ -171,21 +170,13 @@ def convert(self, obj):
171170
obj : AtomGroup or Universe or :class:`Timestep`
172171
"""
173172
try:
174-
# TODO: remove this guard when parmed has a release
175-
# that supports NumPy 2
176-
if NumpyVersion(np.__version__) < "2.0.0":
177-
import parmed as pmd
178-
else:
179-
raise ImportError
173+
import parmed as pmd
180174
except ImportError:
181-
if NumpyVersion(np.__version__) >= "2.0.0":
182-
ermsg = "ParmEd is not compatible with NumPy 2.0+"
183-
else:
184-
ermsg = (
185-
"ParmEd is required for ParmEdConverter but is not "
186-
"installed. Try installing it with \n"
187-
"pip install parmed"
188-
)
175+
errmsg = (
176+
"ParmEd is required for ParmEdConverter but is not "
177+
"installed. Try installing it with \n"
178+
"pip install parmed"
179+
)
189180
raise ImportError(errmsg)
190181
try:
191182
# make sure to use atoms (Issue 46)

testsuite/MDAnalysisTests/converters/test_parmed.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
import pytest
2424
import MDAnalysis as mda
2525

26-
import numpy as np
2726
from numpy.testing import assert_allclose, assert_equal
28-
from numpy.lib import NumpyVersion
2927

3028
from MDAnalysisTests.coordinates.base import _SingleFrameReader
3129
from MDAnalysisTests.coordinates.reference import RefAdKSmall
@@ -43,12 +41,8 @@
4341
PRM_UreyBradley,
4442
)
4543

46-
# TODO: remove this guard when parmed has a release
47-
# that support NumPy 2
48-
if NumpyVersion(np.__version__) < "2.0.0":
49-
pmd = pytest.importorskip("parmed")
50-
else:
51-
pmd = pytest.importorskip("parmed_skip_with_numpy2")
44+
45+
pmd = pytest.importorskip("parmed")
5246

5347

5448
class TestParmEdReaderGRO:

testsuite/MDAnalysisTests/util.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
import pytest
4141

4242
from numpy.testing import assert_warns
43-
import numpy as np
44-
from numpy.lib import NumpyVersion
4543

4644

4745
def block_import(package):
@@ -121,11 +119,6 @@ def import_not_available(module_name):
121119
msg="skip test as module_name could not be imported")
122120
123121
"""
124-
# TODO: remove once these packages have a release
125-
# with NumPy 2 support
126-
if NumpyVersion(np.__version__) >= "2.0.0":
127-
if module_name == "parmed":
128-
return True
129122
try:
130123
test = importlib.import_module(module_name)
131124
except ImportError:

0 commit comments

Comments
 (0)