diff --git a/testsuite/MDAnalysisTests/converters/test_rdkit.py b/testsuite/MDAnalysisTests/converters/test_rdkit.py index a75ea606e0e..85860162f7b 100644 --- a/testsuite/MDAnalysisTests/converters/test_rdkit.py +++ b/testsuite/MDAnalysisTests/converters/test_rdkit.py @@ -27,7 +27,6 @@ import MDAnalysis as mda import numpy as np -from numpy.lib import NumpyVersion import pytest from MDAnalysis.topology.guessers import guess_atom_element from MDAnalysisTests.datafiles import GRO, PDB_full, PDB_helix, mol2_molecule @@ -56,8 +55,6 @@ reason="only for min dependencies build") class TestRequiresRDKit(object): def test_converter_requires_rdkit(self): - if NumpyVersion(np.__version__) >= "2.0.0": - pytest.skip("RDKit not compatible with NumPy 2") u = mda.Universe(PDB_full) with pytest.raises(ImportError, match="RDKit is required for the RDKitConverter"): diff --git a/testsuite/MDAnalysisTests/converters/test_rdkit_parser.py b/testsuite/MDAnalysisTests/converters/test_rdkit_parser.py index c9b3bdcd8f2..e54672902d9 100644 --- a/testsuite/MDAnalysisTests/converters/test_rdkit_parser.py +++ b/testsuite/MDAnalysisTests/converters/test_rdkit_parser.py @@ -24,7 +24,6 @@ import warnings import pytest import numpy as np -from numpy.lib import NumpyVersion from numpy.testing import assert_equal import MDAnalysis as mda @@ -33,12 +32,9 @@ # TODO: remove these shims when RDKit # has a release supporting NumPy 2 -if NumpyVersion(np.__version__) < "2.0.0": - Chem = pytest.importorskip('rdkit.Chem') - AllChem = pytest.importorskip('rdkit.Chem.AllChem') -else: - Chem = pytest.importorskip("RDKit_does_not_support_NumPy_2") - AllChem = pytest.importorskip("RDKit_does_not_support_NumPy_2") +Chem = pytest.importorskip('rdkit.Chem') +AllChem = pytest.importorskip('rdkit.Chem.AllChem') + class RDKitParserBase(ParserBase): parser = mda.converters.RDKitParser.RDKitParser diff --git a/testsuite/MDAnalysisTests/core/test_universe.py b/testsuite/MDAnalysisTests/core/test_universe.py index 10509b98139..2c4d2331269 100644 --- a/testsuite/MDAnalysisTests/core/test_universe.py +++ b/testsuite/MDAnalysisTests/core/test_universe.py @@ -30,7 +30,6 @@ import warnings import numpy as np -from numpy.lib import NumpyVersion from numpy.testing import ( assert_allclose, assert_almost_equal, @@ -224,12 +223,6 @@ def test_universe_empty_ROMol(self): class TestUniverseFromSmiles(object): - def setup_class(self): - if NumpyVersion(np.__version__) < "2.0.0": - pytest.importorskip("rdkit.Chem") - else: - pytest.importorskip("RDKit_does_not_support_NumPy_2") - def test_default(self): smi = "CN1C=NC2=C1C(=O)N(C(=O)N2C)C" u = mda.Universe.from_smiles(smi, format='RDKIT') @@ -288,17 +281,17 @@ def test_coordinates(self): rdkit_kwargs=dict(randomSeed=42)) assert u.trajectory.n_frames == 2 expected = np.array([ - [[-0.02209686, 0.00321505, 0.01651974], - [-0.6690088 , 0.8893599 , -0.1009085 ], - [-0.37778795, -0.8577519 , -0.58829606], - [ 0.09642092, -0.3151253 , 1.0637809 ], - [ 0.97247267, 0.28030226, -0.3910961 ]], - [[-0.0077073 , 0.00435363, 0.01834692], - [-0.61228824, -0.83705765, -0.38619974], - [-0.41925883, 0.9689095 , -0.3415968 ], - [ 0.03148226, -0.03256683, 1.1267245 ], - [ 1.0077721 , -0.10363862, -0.41727486]]], dtype=np.float32) - assert_almost_equal(u.trajectory.coordinate_array, expected) + [[-0.02209686, 0.00321505, 0.01651974], + [-0.6664637 , 0.8884155 , -0.10135844], + [-0.37778795, -0.8577519 , -0.58829606], + [ 0.09642092, -0.3151253 , 1.0637809 ], + [ 0.96992755, 0.2812466 , -0.39064613]], + [[-0.0077073 , 0.00435363, 0.01834692], + [-0.61228824, -0.83705765, -0.38619974], + [-0.41925883, 0.9689095 , -0.3415968 ], + [ 0.03148226, -0.03256683, 1.1267245 ], + [ 1.0077721 , -0.10363862, -0.41727486]]], dtype=np.float32) + assert_allclose(u.trajectory.coordinate_array, expected, rtol=1e-5) class TestUniverse(object):