From ec178cf46ef0511cbb6f91d412c1720b230974da Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Sun, 25 Aug 2024 12:54:17 +0100 Subject: [PATCH 1/4] Investigate rdkit issue --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41424cf50de..bdb83b5e0ef 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,7 +113,7 @@ jobs: parmed pytng>=0.2.3 tidynamics>=1.0.0 - rdkit>=2020.03.1 + "rdkit>=2020.03.1,<2024.3.5" displayName: 'Install additional dependencies for 64-bit tests' condition: and(succeeded(), eq(variables['PYTHON_ARCH'], 'x64')) - script: >- From 047930ecec4c2351083e5b068affd39519bc1bdb Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Sun, 25 Aug 2024 13:09:25 +0100 Subject: [PATCH 2/4] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bdb83b5e0ef..fb8351b56e7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,7 +101,7 @@ jobs: displayName: 'pin to older NumPy (wheel test)' condition: and(succeeded(), ne(variables['NUMPY_MIN'], '')) - script: >- - python -m pip install + python -m pip install -vvv biopython "chemfiles>=0.10,<0.10.4" duecredit @@ -112,8 +112,8 @@ jobs: networkx parmed pytng>=0.2.3 - tidynamics>=1.0.0 "rdkit>=2020.03.1,<2024.3.5" + tidynamics>=1.0.0 displayName: 'Install additional dependencies for 64-bit tests' condition: and(succeeded(), eq(variables['PYTHON_ARCH'], 'x64')) - script: >- From 3b9b1cd95d03c388877acab70b50b0984b484a32 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 25 Aug 2024 13:39:16 +0100 Subject: [PATCH 3/4] fix numpy 2.0 import block --- azure-pipelines.yml | 2 +- testsuite/MDAnalysisTests/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fb8351b56e7..cace2be35ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -112,7 +112,7 @@ jobs: networkx parmed pytng>=0.2.3 - "rdkit>=2020.03.1,<2024.3.5" + rdkit>=2020.03.1 tidynamics>=1.0.0 displayName: 'Install additional dependencies for 64-bit tests' condition: and(succeeded(), eq(variables['PYTHON_ARCH'], 'x64')) diff --git a/testsuite/MDAnalysisTests/util.py b/testsuite/MDAnalysisTests/util.py index 8438a95bdbf..57b65df42c8 100644 --- a/testsuite/MDAnalysisTests/util.py +++ b/testsuite/MDAnalysisTests/util.py @@ -117,7 +117,7 @@ def import_not_available(module_name): # TODO: remove once these packages have a release # with NumPy 2 support if NumpyVersion(np.__version__) >= "2.0.0": - if module_name in {"rdkit", "parmed"}: + if module_name == "parmed": return True try: test = importlib.import_module(module_name) From 3923c585a76cf7867c9d188519cd9c4bb9670ed8 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 25 Aug 2024 14:14:56 +0100 Subject: [PATCH 4/4] fix imports --- package/MDAnalysis/converters/RDKit.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/package/MDAnalysis/converters/RDKit.py b/package/MDAnalysis/converters/RDKit.py index da52e23b915..139528440ab 100644 --- a/package/MDAnalysis/converters/RDKit.py +++ b/package/MDAnalysis/converters/RDKit.py @@ -87,7 +87,6 @@ from io import StringIO import numpy as np -from numpy.lib import NumpyVersion from . import base from ..coordinates import memory @@ -96,13 +95,8 @@ from ..exceptions import NoDataError try: - # TODO: remove this guard when RDKit has a release - # that supports NumPy 2 - if NumpyVersion(np.__version__) < "2.0.0": - from rdkit import Chem - from rdkit.Chem import AllChem - else: - raise ImportError + from rdkit import Chem + from rdkit.Chem import AllChem except ImportError: pass else: