Skip to content

Commit

Permalink
Merge pull request #18 from choderalab/delay_import
Browse files Browse the repository at this point in the history
Use delayed import of openeye tools to avoid dependency.
  • Loading branch information
jchodera committed Apr 13, 2014
2 parents 8720a0c + 89c7af4 commit 939306a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions gaff2xml/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
except ImportError:
from commands import getoutput # If python 2

import openeye.oechem

import simtk.openmm
from simtk.openmm import app
import simtk.unit as units
Expand Down Expand Up @@ -160,7 +158,14 @@ def molecule_to_mol2(molecule, tripos_mol2_filename=None):
-------
tripos_mol2_filename : str
Filename of output tripos mol2 file
"""

try:
import openeye.oechem
except ImportError:
raise(ImportError("Must install OpenEye tools to process OpenEye MOL2 files."))

# Get molecule name.
molecule_name = molecule.GetTitle()
logger.debug(molecule_name)
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
""")
else:
molecule_name, mol2_filename = sys.argv[1:]
run_antechamber(molecule_name, mol2_filename, charge_model="bcc")
run_antechamber(molecule_name, mol2_filename, charge_method="bcc")

0 comments on commit 939306a

Please sign in to comment.