-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Optional RDKit run-time dependency not correctly pinned #50
Comments
Thanks for reporting. This is an issue with Sire, so I'll transfer over. I am not quite sure how this has happened, since there is a lot of internal functionality that uses this feature and the CI passed on main, which includes unit tests for this functionality. Bizarrely, doing the following with Sire: import sire as sr
sr.sr.__version__
'2023.2.2'
sr.convert.supported_formats()
['biosimspace', 'openmm', 'sire'] RDKit functionality is optional, so would be suppressed if the package is not installed. However, RDKit is a dependency of BioSimSpace and Sire will have been built against the same version. Trying to convert directly with Sire gives: import BioSimSpace as BSS
import sire as sr
mol = BSS.Parameters.openff_unconstrained_2_0_0('C').getMolecule()
sr.convert.to_rdkit(mol)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:1 │
│ │
│ /home/lester/.conda/envs/test/lib/python3.10/site-packages/sire/convert/__init__.py:184 in │
│ to_rdkit │
│ │
│ 181 │ Convert the passed object from its current object format to a │
│ 182 │ rdkit object format. │
│ 183 │ """ │
│ ❱ 184 │ return sire_to_rdkit(to_sire(obj, map=map), map=map) │
│ 185 │
│ 186 │
│ 187 def to_openmm(obj, map=None): │
│ │
│ /home/lester/.conda/envs/test/lib/python3.10/site-packages/sire/convert/__init__.py:419 in │
│ sire_to_rdkit │
│ │
│ 416 │ │
│ 417 │ from ..base import create_map │
│ 418 │ │
│ ❱ 419 │ mols = _sire_to_rdkit(obj, map=create_map(map)) │
│ 420 │ │
│ 421 │ if mols is None: │
│ 422 │ │ return None │
│ │
│ /home/lester/.conda/envs/test/lib/python3.10/site-packages/sire/legacy/Convert/__init__.py:38 in │
│ sire_to_rdkit │
│ │
│ 35 │ _has_rdkit = False │
│ 36 │ │
│ 37 │ def sire_to_rdkit(*args, **kwargs): │
│ ❱ 38 │ │ _no_rdkit() │
│ 39 │ │
│ 40 │ def rdkit_to_sire(*args, **kwargs): │
│ 41 │ │ _no_rdkit() │
│ │
│ /home/lester/.conda/envs/test/lib/python3.10/site-packages/sire/legacy/Convert/__init__.py:29 in │
│ _no_rdkit │
│ │
│ 26 except Exception: │
│ 27 │ # RDKit support is not available │
│ 28 │ def _no_rdkit(): │
│ ❱ 29 │ │ raise ModuleNotFoundError( │
│ 30 │ │ │ "Unable to convert to/from RDKit as it is not installed. " │
│ 31 │ │ │ "Please install using `mamba install -c conda-forge rdkit` " │
│ 32 │ │ │ "and then re-run this script." │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: Unable to convert to/from RDKit as it is not installed. Please install using `mamba install
-c conda-forge rdkit` and then re-run this script. However:
If I dig into the Python wrappers for
What I think is going on is that the RDKit version pinning is failing. Either RDKit have made a breaking change for a minor version bump, or the versions of Looking at the generated
This approach is only used to build Sire in an environment with a consistent set of dependencies (and transitive dependencies) to those BioSimSpace. However, it doesn't guarantee the pinning if any of those dependencies are actually needed by Sire at run time. As such, we'll likely need to add a |
As a workaround until this is fixed, you can pin
|
Just to say that while I think the solution used will work, i.e. adding...
...it's possible that conda could resolve a different version of I guess we can revisit this if it turns out to be problematic. (Note that |
Describe the bug
toRDKit function is broken
To Reproduce
create the env with
mamba create -n BSS_test -c openbiosim/label/main -c conda-forge BioSimSpace rdkit ambertools
Then run
Gives
Expected behavior
It works.
(please complete the following information):
The text was updated successfully, but these errors were encountered: