Chemical Data Processing Library Python API - Version 1.2.0
Public Member Functions | Properties | List of all members
CDPL.Chem.AtomBondMapping Class Reference

A data structure for the common storage of related atom to atom and bond to bond mappings. More...

+ Inheritance diagram for CDPL.Chem.AtomBondMapping:

Public Member Functions

None __init__ ()
 Initializes the AtomBondMapping instance.
 
None __init__ (AtomBondMapping mapping)
 Initializes a copy of the AtomBondMapping instance mapping. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
AtomBondMapping assign (AtomBondMapping mapping)
 Replaces the current state of self with a copy of the state of the AtomBondMapping instance mapping. More...
 
AtomMapping getAtomMapping ()
 Returns a reference to the Chem.AtomMapping data member storing the atom to atom mappings. More...
 
BondMapping getBondMapping ()
 Returns a reference to the Chem.BondMapping data member storing the bond to bond mappings. More...
 
None clear ()
 Removes all atom to atom and bond to bond mappings.
 
bool __eq__ (AtomBondMapping mapping)
 Equality comparison operator. More...
 
bool __ne__ (AtomBondMapping mapping)
 Inequality comparison operator. More...
 

Properties

 objectID = property(getObjectID)
 
 atomMapping = property(getAtomMapping)
 
 bondMapping = property(getBondMapping)
 

Detailed Description

A data structure for the common storage of related atom to atom and bond to bond mappings.

AtomBondMapping is used to represent arbitrary mappings between the atoms and bonds of two (or more) molecular graphs (e.g. results of a substructure search). The atom and bond mappings are stored in respective data members of type Chem.AtomMapping and Chem.BondMapping. They can be accessed by the provided getAtomMapping() and getBondMapping() family of overloaded methods.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Chem.AtomBondMapping.__init__ ( AtomBondMapping  mapping)

Initializes a copy of the AtomBondMapping instance mapping.

Parameters
mappingThe AtomBondMapping instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.AtomBondMapping.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python AtomBondMapping instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two AtomBondMapping instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

AtomBondMapping CDPL.Chem.AtomBondMapping.assign ( AtomBondMapping  mapping)

Replaces the current state of self with a copy of the state of the AtomBondMapping instance mapping.

Parameters
mappingThe AtomBondMapping instance to copy.
Returns
self

◆ getAtomMapping()

AtomMapping CDPL.Chem.AtomBondMapping.getAtomMapping ( )

Returns a reference to the Chem.AtomMapping data member storing the atom to atom mappings.

Returns
A reference to the Chem.AtomMapping data member.

◆ getBondMapping()

BondMapping CDPL.Chem.AtomBondMapping.getBondMapping ( )

Returns a reference to the Chem.BondMapping data member storing the bond to bond mappings.

Returns
A reference to the Chem.BondMapping data member.

◆ __eq__()

bool CDPL.Chem.AtomBondMapping.__eq__ ( AtomBondMapping  mapping)

Equality comparison operator.

Parameters
mappingThe other AtomBondMapping instance to be compared with.
Returns
True if the atom to atom and bond to bond mappings compare equal, and False otherwise.

◆ __ne__()

bool CDPL.Chem.AtomBondMapping.__ne__ ( AtomBondMapping  mapping)

Inequality comparison operator.

The result is equivalent to !(self == mapping).

Parameters
mappingThe other AtomBondMapping instance to be compared with.
Returns
True if the atom to atom and/or bond to bond mappings compare non-equal, and False otherwise.
See also
eq()