Skip to content
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

OpenEye license check in OpenEyeToolkitWrapper #1895

Open
isty2e opened this issue Jun 18, 2024 · 2 comments
Open

OpenEye license check in OpenEyeToolkitWrapper #1895

isty2e opened this issue Jun 18, 2024 · 2 comments

Comments

@isty2e
Copy link

isty2e commented Jun 18, 2024

Describe the bug

def _check_licenses(cls) -> bool:

This method detects the presence of OpenEye toolkits licenses by checking if any of toolkit licenses is available. However, the OpenEyeToolkitWrapper requires oechem, oeomega, and oequacpac to function. If the user has at least one of these licenses but not all (e.g, only oechem license) and has OE_LICENSE environment variable set, an exception will occur in runtime.

To Reproduce

  • A license file with 1 <= num_supported_packages < 3
  • OE_LICENSE environment variable set

Output

  File "/path/to/script.py", line 419, in get_ligand_structure
    ligand_system = force_field.create_openmm_system(off_topology)
  File "/path/to/env/lib/python3.9/site-packages/openff/utilities/utilities.py", line 80, in wrapper
    return function(*args, **kwargs)
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/typing/engines/smirnoff/forcefield.py", line 1164, in create_openmm_system
    return self.create_interchange(
  File "/path/to/env/lib/python3.9/site-packages/openff/utilities/utilities.py", line 80, in wrapper
    return function(*args, **kwargs)
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/typing/engines/smirnoff/forcefield.py", line 1223, in create_interchange
    return Interchange.from_smirnoff(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/components/interchange.py", line 270, in from_smirnoff
    return _create_interchange(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_create.py", line 117, in _create_interchange
    _electrostatics(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_create.py", line 270, in _electrostatics
    "Electrostatics": SMIRNOFFElectrostaticsCollection.create(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_nonbonded.py", line 447, in create
    handler.store_matches(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_nonbonded.py", line 861, in store_matches
    matches, potentials = self._find_reference_matches(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_nonbonded.py", line 716, in _find_reference_matches
    ) = cls._find_charge_model_matches(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_nonbonded.py", line 652, in _find_charge_model_matches
    partial_charges = cls._compute_partial_charges(
  File "/path/to/env/lib/python3.9/site-packages/openff/interchange/smirnoff/_nonbonded.py", line 467, in _compute_partial_charges
    molecule.assign_partial_charges(method)
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/topology/molecule.py", line 2607, in assign_partial_charges
    toolkit_registry.call(
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/utils/toolkit_registry.py", line 352, in call
    return method(*args, **kwargs)
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/utils/openeye_wrapper.py", line 2422, in assign_partial_charges
    self.generate_conformers(
  File "/path/to/env/lib/python3.9/site-packages/openff/toolkit/utils/openeye_wrapper.py", line 2158, in generate_conformers
    traceback.print_stack()
LICENSE: No valid license found for omega
LICENSE: File(s) used: /path/to/oe_license.txt
LICENSE: Closest license failed because:
LICENSE: features
@mattwthompson
Copy link
Member

We've run into this before (#825 (comment)) and thought we fixed it (#850); OpenEyeToolkitWrapper returns True if any of those licenses are found, not requiring all to be found.

There could be a separate interaction between different wrapped calls failing and raising unhandled exceptions (#1863 a little related; it's possible that using RDKit conformers and Quacpac charges fails since it's not clear that's ever been tested or even that it's possible).

Could you fill out the issue template with a reproducible example that demonstrates how I can trigger the specific failure you're encountering? I have access to an OpenEye license and can mock different modules being licensed or unlicensed.

@insukjoung
Copy link

On behalf of my colleague, #1896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants