for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
#! /usr/bin/env python
#
# Copyright (C) 2016 Rich Lewis <[email protected]>
# License: 3-clause BSD
"""
## skchem.forcefields.uff
Module specifying the universal force field.
from rdkit.Chem.rdForceFieldHelpers import UFFOptimizeMolecule
rdkit.Chem.rdForceFieldHelpers
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
from .base import ForceField
class UFF(ForceField):
""" Universal Force Field transformer. """
def __init__(self, preembed=True, warn_on_fail=True, error_on_fail=False,
add_hs=True, n_jobs=1, verbose=True):
""" Initialize a UFF object.
Args:
preembed (bool):
Whether to embed before optimizing.
warn_on_fail (bool):
Whether to warn if a molecule fails to optimise.
error_on_fail (bool):
Whether to raise an error if a molecule fails to optimise.
add_hs (bool):
Whether to automatically add hydrogens.
super(UFF, self).__init__(preembed=preembed, warn_on_fail=warn_on_fail,
error_on_fail=error_on_fail, add_hs=add_hs,
verbose=verbose, n_jobs=n_jobs)
def _optimize(self, mol):
try:
return UFFOptimizeMolecule(mol)
except RuntimeError:
return None
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.