Skip to content

Commit

Permalink
Merge pull request #85 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Versions of openbabel, openeye, and rdkit
  • Loading branch information
seamm authored Nov 22, 2024
2 parents caec4a8 + fdb6f63 commit 4f18522
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2024.11.21.1 -- Versions of openbabel, openeye, and rdkit
* Added functions to get the versions of openbabel, openeye, and rdkit that are
installed.

2024.11.21 -- Added access to OpenEye mols and SMILES
* Added the ability to create a system from an OpenEye molecule and vice versa.
This gives access to the OpenEye toolkit for generating conformers, etc.
Expand Down
4 changes: 4 additions & 0 deletions molsystem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
from .system_db import SystemDB # noqa: F401
from .cell import Cell # noqa: F401
from .properties import standard_properties, add_properties_from_file # noqa: F401
from .openbabel import openbabel_version # noqa: F401
from .openeye import openeye_version # noqa: F401
from .rdkit_ import rdkit_version # noqa: F401


# Handle versioneer
from ._version import get_versions
Expand Down
5 changes: 5 additions & 0 deletions molsystem/openbabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
logger = logging.getLogger(__name__)


def openbabel_version():
"""Return the version of openbabel."""
return ob.OBReleaseVersion()


class OpenBabelMixin:
"""A mixin for handling OpenBabel via its Python interface."""

Expand Down
7 changes: 7 additions & 0 deletions molsystem/openeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ def check_openeye_license():
)


def openeye_version():
"""The version of the OpenEye OEChem toolkit."""
if not oechem_available:
return None
return oechem.OEChemGetVersion()


class OpenEyeMixin:
"""A mixin for handling OpenEye's software via its Python interface."""

Expand Down
5 changes: 5 additions & 0 deletions molsystem/rdkit_.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
}


def rdkit_version():
"""Return the RDKit version."""
return Chem.rdBase.rdkitVersion


class RDKitMixin:
"""A mixin for handling RDKit via its Python interface."""

Expand Down
7 changes: 7 additions & 0 deletions tests/test_openbabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import pytest # noqa: F401

from molsystem import openbabel_version

# H-Asp-Arg-Val-Tyr-Ile-His-Pro-Phe-OH
SMILES = (
"[NH2][C@@H](CC(=O)O)C(=O)"
Expand Down Expand Up @@ -366,6 +368,11 @@
known_input_formats["Windows"] = known_input_formats["Darwin"]


def test_version():
"""Test the version number of Open Babel."""
openbabel_version()


def test_substructure(CH3COOH_3H2O):
"""Test the finding substructures in the configuration."""
answer1 = [(5, 6, 7)]
Expand Down
8 changes: 8 additions & 0 deletions tests/test_openeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
except ImportError:
pass

from molsystem import openeye_version


@pytest.mark.openeye
def test_version():
"""Test the version of the OpenEye toolkit."""
openeye_version()


@pytest.mark.openeye
def test_to_OEGraphMol(Acetate):
Expand Down
7 changes: 7 additions & 0 deletions tests/test_rdkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import rdkit.Chem.AllChem
import pytest # noqa: F401

from molsystem import rdkit_version


def test_version():
"""Test the version of RDKit."""
rdkit_version()


def test_to_RDKMol(Acetate):
"""Test creating a RDKMol object from a structure."""
Expand Down

0 comments on commit 4f18522

Please sign in to comment.