diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca111d..8caf6b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: fail-fast: false matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - os: [ubuntu-latest, windows-latest, macos-13] + os: [ubuntu-latest, windows-latest, macos-latest] exclude: - os: macos-13 python-version: '3.8' @@ -59,10 +59,6 @@ jobs: python -m pip install -r requirements.txt python -m pip install -e . python -m pip install coverage - - name: Avoid Problematic Packages on MacOS 13 - if: matrix.os == 'macos-13' - run: | - python -m pip install --force-reinstall 'numpy<2' 'scipy<1.14' - name: Run Tests run: | coverage run --source=. --omit=interfaces/*,aimsim/__main__.py,aimsim/tasks/__init__.py,aimsim/ops/__init__.py,aimsim/chemical_datastructures/__init__.py,aimsim/utils/__init__.py,setup.py,tests/*,aimsim/__init__.py,aimsim/utils/plotting_scripts.py -m unittest discover -v diff --git a/aimsim/__init__.py b/aimsim/__init__.py index 877e143..14606cd 100644 --- a/aimsim/__init__.py +++ b/aimsim/__init__.py @@ -7,4 +7,4 @@ except ImportError: pass # aimsim_core does not include this -__version__ = "2.2.1" +__version__ = "2.2.2" diff --git a/aimsim/ops/descriptor.py b/aimsim/ops/descriptor.py index a99b585..6abe7a6 100644 --- a/aimsim/ops/descriptor.py +++ b/aimsim/ops/descriptor.py @@ -4,7 +4,7 @@ from rdkit.Chem import rdmolops from rdkit import Chem from rdkit import DataStructs -from rdkit.Chem import AllChem +from rdkit.Chem import rdFingerprintGenerator from rdkit.Chem.Fingerprints import FingerprintMols from rdkit.Chem import MACCSkeys from rdkit.Chem.AtomPairs import Pairs, Torsions @@ -101,7 +101,8 @@ def _set_morgan_fingerprint(self, molecule_graph, radius, n_bits, **kwargs): as count. """ - self.rdkit_ = AllChem.GetMorganFingerprintAsBitVect(molecule_graph, radius, nBits=n_bits, **kwargs) + fpg = rdFingerprintGenerator.GetMorganGenerator(radius=radius, fpSize=n_bits, **kwargs) + self.rdkit_ = fpg.GetFingerprint(molecule_graph) self.label_ = "morgan_fingerprint" self.params_ = {"radius": radius, "n_bits": n_bits} @@ -127,7 +128,8 @@ def _set_rdkit_topological_fingerprint(self, molecule_graph, min_path, max_path, f"greater than the minimum path " f"used for fingerprint." ) - self.rdkit_ = rdmolops.RDKFingerprint(molecule_graph, minPath=min_path, maxPath=max_path) + fpg = rdFingerprintGenerator.GetRDKitFPGenerator(minPath=min_path, maxPath=max_path, **kwargs) + self.rdkit_ = fpg.GetFingerprint(molecule_graph) self.label_ = "topological_fingerprint" self.params_ = {"min_path": min_path, "max_path": max_path} diff --git a/tests/test_Descriptor.py b/tests/test_Descriptor.py index 6577246..8bb964b 100644 --- a/tests/test_Descriptor.py +++ b/tests/test_Descriptor.py @@ -247,6 +247,7 @@ def test_padelpy_descriptors(self): with self.assertRaises(ValueError): descriptor.to_rdkit() + @unittest.skipIf(int(np.__version__[0]) >= 2, "MHFP fails on numpy >2 see https://github.com/reymond-group/mhfp/issues/6") def test_minhash_fingerprint(self): """Test creation of minhash fingerprint""" mol_graph = MolFromSmiles("CCOCC") @@ -303,7 +304,7 @@ def test_exptl_descriptors(self): "maccs_keys", "atom-pair_fingerprint", "torsion_fingerprint", - "minhash_fingerprint", + # "minhash_fingerprint", -> upstream bug, see https://github.com/reymond-group/mhfp/issues/6 ] for desc in fprint_list: descriptor = Descriptor()