diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a904853b..c55f50cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/devtools/conda-envs/test-env.yaml b/devtools/conda-envs/test-env.yaml index 6a671774..d7201222 100644 --- a/devtools/conda-envs/test-env.yaml +++ b/devtools/conda-envs/test-env.yaml @@ -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 diff --git a/openff/bespokefit/executor/utilities/depiction.py b/openff/bespokefit/executor/utilities/depiction.py index fe6a3fd8..c0a8422a 100644 --- a/openff/bespokefit/executor/utilities/depiction.py +++ b/openff/bespokefit/executor/utilities/depiction.py @@ -1,11 +1,14 @@ import functools from typing import Optional, Tuple +from openff.utilities.utilities import requires_oe_module + IMAGE_UNAVAILABLE_SVG = """ PreviewUnavailable """ +@requires_oe_module("oechem") def _oe_smiles_to_image(smiles: str, highlight_atoms: Tuple[int]) -> str: from openeye import oechem, oedepict diff --git a/openff/bespokefit/utilities/molecule.py b/openff/bespokefit/utilities/molecule.py index fd0f16bf..42f84d5d 100644 --- a/openff/bespokefit/utilities/molecule.py +++ b/openff/bespokefit/utilities/molecule.py @@ -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 @@ -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