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.bond
Defining chemical bonds in scikit-chem.
import rdkit.Chem
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
from skchem.core import Atom
from skchem.core import ChemicalObject
class Bond(rdkit.Chem.rdchem.Bond, ChemicalObject):
Class representing a chemical bond in scikit-chem.
@property
def order(self):
The order of the bond.
Parameters
----------
None
Returns
-------
bond :int
return self.GetBondTypeAsDouble()
Bond
GetBondTypeAsDouble
This check looks for calls to members that are non-existent. These calls will fail.
The member could have been renamed or removed.
@order.setter
def order(self, value):
""" Set the order of the bond. Not implemented."""
raise NotImplementedError
def atoms(self):
""" Return an iterable of the atoms involved in the bond. """
return [Atom.from_super(self.GetBeginAtom()), Atom.from_super(self.GetEndAtom())]
GetBeginAtom
GetEndAtom
@atoms.setter
def atoms(self, value):
""" Set the atoms of the molecule. Not implemented. """
def draw(self):
""" Draw the bond inline. """
return '{}{}{}'.format(self.atoms[0].element, \
'-' if self.order == 1 else self.GetSmarts(), \
GetSmarts
self.atoms[0].element)
def to_dict(self):
""" Convert to a dictionary representation. """
return {"b": self.GetBeginAtomIdx(), "e": self.GetEndAtomIdx(), "o": self.order}
GetBeginAtomIdx
GetEndAtomIdx
def __repr__(self):
return '<{klass} type="{bond}" at {address}>'.format(klass=self.__class__.__name__, \
bond=self.draw(), \
address=hex(id(self)))
def __str__(self):
return self.draw()
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.