rdkit.Chem.Descriptors.PropertyFunctor

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

# Class PropertyFunctor

source code

                        object --+
                                 |
                       ??.instance --+
                                     |
      rdMolDescriptors.PropertyFunctor --+
                                         |
    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) __init__( (object)arg1, (object)arg2, (str)arg3, (str)arg4) -> None : | source code
__call__(self, mol) __call__( (PythonPropertyFunctor)arg1, (Mol)arg2) -> float : Compute the property for the specified molecule | source code
Inherited from `rdMolDescriptors.PropertyFunctor`: `GetName`, `GetVersion`, `__reduce__` Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
Inherited from `rdMolDescriptors.PythonPropertyFunctor`: `__instance_size__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, name, version) (Constructor) | source code
    __init__( (object)arg1, (object)arg2, (str)arg3, (str)arg4) -> None :

        C++ signature :
            void __init__(_object*,_object*,std::string,std::string)
Overrides: object.__init__ (inherited documentation)

### __call__(self, mol) (Call operator) | source code
    __call__( (PythonPropertyFunctor)arg1, (Mol)arg2) -> float :
        Compute the property for the specified molecule

        C++ signature :
            double __call__((anonymous namespace)::PythonPropertyFunctor {lvalue},RDKit::ROMol)
Overrides: rdMolDescriptors.PropertyFunctor.__call__ (inherited documentation)