for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
#! /usr/bin/env python
#
# Copyright (C) 2015 Rich Lewis <[email protected]>
# License: 3-clause BSD
"""
## skchem.forcefields.uff
Module specifying the universal force field.
import warnings
from .base import ForceField
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
class UFF(ForceField):
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
def __init__(self):
__init__
ForceField
It is generally advisable to initialize the super-class by calling its __init__ method:
class SomeParent: def __init__(self): self.x = 1 class SomeChild(SomeParent): def __init__(self): # Initialize the super class SomeParent.__init__(self)
pass
def optimize(self, mol):
res = UFFOptimizeMolecule(mol)
if res == -1:
msg = 'Failed to optimize molecule \'{}\' using MMFF'.format(mol.name)
if self.error_on_fail:
raise RuntimeError(msg)
elif self.warn_on_fail:
warnings.warn(msg)
else:
return mol
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.