for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
#! /usr/bin/env python
#
# Copyright (C) 2007-2009 Rich Lewis <[email protected]>
# License: 3-clause BSD
"""
## skchem.descriptors.physicochemical
Physicochemical descriptors and associated functions are defined.
from rdkit.Chem import Descriptors
rdkit.Chem
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
import pandas as pd
pandas
from .fingerprints import Fingerprinter
from ..utils import camel_to_snail
DESCRIPTORS = [(camel_to_snail(s), f) for (s, f) in Descriptors.descList]
class PhysicochemicalFingerprinter(Fingerprinter):
""" Physicochemical descriptor generator using RDKit descriptor """
NAME = 'physchem'
def __init__(self, descriptors='all'):
__init__
Fingerprinter
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)
""" Create a physicochemical descriptor generator.
Args:
descriptors (list<(str, func)> or 'all'):
Descriptors to calculate, or if 'all', use all descriptors."""
if descriptors == 'all':
self.descriptors = DESCRIPTORS
else:
self.descriptors = descriptors
self.descriptor_names, _ = zip(*self.descriptors)
def _transform(self, mol):
return pd.Series({n: f(mol) for (n, f) in self.descriptors}, name=mol.name)
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__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.