Skip to content

Commit

Permalink
Merge branch 'fix/pandas_tools' into 'dev'
Browse files Browse the repository at this point in the history
add lazy loading of pandas tools to prevent errors in new version of rdkit

See merge request cdd/QSPRpred!187
  • Loading branch information
martin-sicho committed May 28, 2024
2 parents ffcd60b + cc90e31 commit e430e99
Show file tree
Hide file tree
Showing 13 changed files with 1,350 additions and 1,961 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ] # FIXME: add macos-latest and windows-latest (removed for now due to limited debugging options)
python-version: [ '3.10' ]
python-version: [ '3.12' ]
fail-fast: false
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Cache Python Environment
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre_merge_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- name: Cache Python Environment
uses: actions/cache@v3
Expand Down
11 changes: 3 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ stages:
script:
- cd testing && QSPPRED_TEST_SPLIT_UNITS=true QSPRPRED_VERBOSE_LOGGING=true ./run.sh

# # Run tests on Python version 11 (linux image)
# test:python3.11:
# extends: .test
# image: python:3.11

# Run tests on Python version 10 (linux image)
test:python3.10:
# Run tests on the recent Python (linux image)
test:python3.12:
extends: .test
image: python:3.10
image: python:3.12
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ From v3.0.2 to v3.1.0
format by adding
a prefix with descriptor set name to the old descriptor tables. Feel free to contact
us if you require assistance with this.
- Due to some changes in `rdkit-2023.9.6`, the `add_rdkit`
option for molecule tables temporarily might not work.
This also affects the current ChemProp integration, which was not adapted to 2.0.0 yet.
In order to prevent these issues, QSPRpred now forces rdkit version `rdkit-2023.9.5`,
but we will be working on resolving these.

## New Features

Expand All @@ -39,4 +44,4 @@ From v3.0.2 to v3.1.0

## Removed Features

None.
- removed support for PyBoost since the project was abandoned by the original developers and is [no longer maintained](https://github.com/sb-ai-lab/Py-Boost/graphs/contributors)
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ The following options are available:
- extra : include extra dependencies for PCM models and extra descriptor sets from
packages other than RDKit
- deep : include deep learning models (torch and chemprop)
- pyboost : include pyboost model (requires cupy, `pip install cupy-cudaX`, replace X
with your [cuda version](https://docs.cupy.dev/en/stable/install.html), you can obtain
cude toolkit from Anaconda as well: `conda install cudatoolkit`)
- chemprop: include the ChemProp integration (only ChemProp versions < 2.0.0 supported at the moment)
- full : include all optional dependecies (requires cupy, `pip install cupy-cudaX`,
replace X with your [cuda version](https://docs.cupy.dev/en/stable/install.html))

Expand Down
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ maintainers = [{ name = "Helle van den Maagdenberg", email = "h.w.van.den.maagde
{ name = "Gerard van Westen", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent", # We tested it on Mac and Windows as well?
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
Expand Down Expand Up @@ -70,15 +72,17 @@ extra = [
"prodec",
"Signature-pywrapper",
]
pyboost = ["py-boost"]
deep = [
"torch >= 1.7.0",
"chemprop >= 1.6.0"
]
chemprop = [
"rdkit < 2023.9.6",
"chemprop >= 1.6.0, < 2.0.0",
]
full = [
"qsprpred[pyboost]",
"qsprpred[deep]",
"qsprpred[extra]"
"qsprpred[extra]",
"qsprpred[chemprop]",
]
dev = [
"qsprpred[full]",
Expand Down
13 changes: 8 additions & 5 deletions qsprpred/data/chem/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from parameterized import parameterized
from rdkit import Chem

from ... import TargetTasks
from ...data import QSPRDataset
Expand Down Expand Up @@ -31,11 +30,15 @@ def testScaffoldAdd(self, _, scaffold):
self.dataset.addScaffolds([scaffold])
scaffs = self.dataset.getScaffolds()
self.assertEqual(scaffs.shape, (len(self.dataset), 1))
self.dataset.addScaffolds([scaffold], add_rdkit_scaffold=True, recalculate=True)
self.dataset.addScaffolds(
[scaffold],
add_rdkit_scaffold=False,
recalculate=True
)
scaffs = self.dataset.getScaffolds(include_mols=True)
self.assertEqual(scaffs.shape, (len(self.dataset), 2))
for mol in scaffs[f"Scaffold_{scaffold}_RDMol"]:
self.assertTrue(isinstance(mol, Chem.rdchem.Mol))
self.assertEqual(scaffs.shape, (len(self.dataset), 1))
# for mol in scaffs[f"Scaffold_{scaffold}_RDMol"]:
# self.assertTrue(isinstance(mol, Chem.rdchem.Mol))


class TestStandardizers(DataSetsPathMixIn, QSPRTestCase):
Expand Down
Loading

0 comments on commit e430e99

Please sign in to comment.