Package rdkit :: Package Chem :: Module Descriptors :: Class PropertyFunctor
[hide private]
[frames] | no frames]

Class PropertyFunctor

source code

rdMolDescriptors.PythonPropertyFunctor --+
                                         |
                                        PropertyFunctor

Creates a python based property function that can be added to the
global property list.  To use, subclass this class and override the
__call__ method.  Then create an instance and add it to the
registry.  The __call__ method should return a numeric value.

Example:

  class NumAtoms(Descriptors.PropertyFunctor):
    def __init__(self):
      Descriptors.PropertyFunctor.__init__(self, "NumAtoms", "1.0.0")
    def __call__(self, mol):
      return mol.GetNumAtoms()

  numAtoms = NumAtoms()
  rdMolDescriptors.Properties.RegisterProperty(numAtoms)

Instance Methods [hide private]
 
__init__(self, name, version) source code
 
__call__(self, mol) source code