Skip to content

Commit

Permalink
Add requires_openeye decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Jul 13, 2023
1 parent 656dca3 commit 4ee8831
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
files: ^openff
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/test-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- click
- click-option-group
- rdkit
- openff-utilities
- openff-utilities >=0.1.8
- openff-toolkit-base =0.11
- openff-forcefields
- openff-interchange
Expand Down
3 changes: 3 additions & 0 deletions openff/bespokefit/executor/utilities/depiction.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import functools
from typing import Optional, Tuple

from openff.utilities.utilities import requires_oe_module

IMAGE_UNAVAILABLE_SVG = """
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 200 200" width="200pt" height="200pt"><defs><clipPath id="_clipPath_eSdCSpw1sB1xWp7flmMoZ0WjTPwPpzQh"><rect width="200" height="200"/></clipPath></defs><g clip-path="url(#_clipPath_eSdCSpw1sB1xWp7flmMoZ0WjTPwPpzQh)"><g clip-path="url(#_clipPath_LvpdWbrYj1cREqoXz8Lwbk3ZilfC6tg9)"><text transform="matrix(1,0,0,1,44.039,91.211)" style="font-family:'Open Sans';font-weight:400;font-size:30px;font-style:normal;fill:#000000;stroke:none;">Preview</text><text transform="matrix(1,0,0,1,17.342,132.065)" style="font-family:'Open Sans';font-weight:400;font-size:30px;font-style:normal;fill:#000000;stroke:none;">Unavailable</text></g><defs><clipPath id="_clipPath_LvpdWbrYj1cREqoXz8Lwbk3ZilfC6tg9"><rect x="0" y="0" width="166" height="81.709" transform="matrix(1,0,0,1,17,59.146)"/></clipPath></defs></g></svg>
"""


@requires_oe_module("oechem")
def _oe_smiles_to_image(smiles: str, highlight_atoms: Tuple[int]) -> str:
from openeye import oechem, oedepict

Expand Down
3 changes: 3 additions & 0 deletions openff/bespokefit/utilities/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

from openff.toolkit.topology import Molecule
from openff.toolkit.utils.exceptions import ToolkitUnavailableException
from openff.utilities.utilities import requires_oe_module


@requires_oe_module("oechem")
def _oe_get_atom_symmetries(molecule: Molecule) -> List[int]:
from openeye import oechem

Expand All @@ -31,6 +33,7 @@ def get_atom_symmetries(molecule: Molecule) -> List[int]:
return _rd_get_atom_symmetries(molecule)


@requires_oe_module("oechem")
def _oe_canonical_atom_order(molecule: Molecule) -> List[int]:
from openeye import oechem

Expand Down

0 comments on commit 4ee8831

Please sign in to comment.