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.core.atom
Defining atoms in scikit-chem.
from rdkit import Chem
rdkit
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 skchem.core import ChemicalObject
class Atom(Chem.rdchem.Atom, ChemicalObject):
""" Object representing an Atom in scikit-chem. """
@property
def element(self):
""" Get the element of the atom as a string. """
return self.GetSymbol()
Atom
GetSymbol
This check looks for calls to members that are non-existent. These calls will fail.
The member could have been renamed or removed.
def atomic_number(self):
""" Get the atomic number of the atom as a float. """
return self.GetAtomicNum()
GetAtomicNum
def mass(self):
""" Get the mass of the atom as a float. """
return self.GetMass()
GetMass
def atomic_mass(self):
return self.mass
def props(self):
""" Return a dictionary of properties of the atom. """
# Some atom properties are inaccessible, but still give values.
props = {}
for prop in self.GetPropNames():
GetPropNames
try:
props[prop] = self.GetProp(prop)
GetProp
except RuntimeError:
pass
return props
def __repr__(self):
return '<{klass} element="{element}" at {address}>'.format(
klass=self.__class__.__name__,
element=self.element,
address=hex(id(self))
)
def __str__(self):
return self.element
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.