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

Reactor. More...

+ Inheritance diagram for CDPL.Chem.Reactor:

Public Member Functions

None __init__ ()
 Constructs and initializes a Reactor instance.
 
None __init__ (Reaction rxn_pattern)
 Constructs and initializes a Reactor instance for the specified reaction pattern. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None setReactionPattern (Reaction rxn_pattern)
 Allows to specify a new reaction pattern for the transformation of reactants to products. More...
 
bool findReactionSites (Reaction rxn_target)
 Perceives all possible reaction-sites on the reactants of the given reaction target where the specified reaction pattern can be applied. More...
 
int getNumReactionSites ()
 Returns the number of recorded reactions-sites in the last call to findReactionSites(). More...
 
AtomBondMapping getReactionSite (int idx)
 Returns a reference to the stored reaction-site data object at index idx. More...
 
None performReaction (AtomBondMapping rxn_site)
 Performs a transformation of the target reactants to corresponding products at the specified reaction-site. More...
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

Reactor.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Chem.Reactor.__init__ ( Reaction  rxn_pattern)

Constructs and initializes a Reactor instance for the specified reaction pattern.

Parameters
rxn_patternThe reaction pattern describing the transformation of reactants to products.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.Reactor.getObjectID ( )

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

Different Python Reactor 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 Reactor 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.

◆ setReactionPattern()

None CDPL.Chem.Reactor.setReactionPattern ( Reaction  rxn_pattern)

Allows to specify a new reaction pattern for the transformation of reactants to products.

Parameters
rxn_patternThe reaction pattern describing the transformation of reactants to products.

◆ findReactionSites()

bool CDPL.Chem.Reactor.findReactionSites ( Reaction  rxn_target)

Perceives all possible reaction-sites on the reactants of the given reaction target where the specified reaction pattern can be applied.

The specified Chem.Reaction instance rxn_target serves both as a provider for the starting materials (reactant components) in a later reaction transformation (see performReaction()) as well as a container for the generated reaction products.

Parameters
rxn_targetThe reaction target providing the reactants to be transformed.
Returns
True if matching reaction-sites were found, and False otherwise.
Note
Any reaction-site mappings that were recorded in a previous call to findReactionSites() will be discarded.
See also
performReaction()

◆ getNumReactionSites()

int CDPL.Chem.Reactor.getNumReactionSites ( )

Returns the number of recorded reactions-sites in the last call to findReactionSites().

Returns
The number of recorded reactions-sites in the last call to findReactionSites().

◆ getReactionSite()

AtomBondMapping CDPL.Chem.Reactor.getReactionSite ( int  idx)

Returns a reference to the stored reaction-site data object at index idx.

Parameters
idxThe zero-based index of the reaction-site data object to return.
Returns
A reference to the reaction-site data object at index idx.
Exceptions
Base.IndexErrorif no reactions-site data objects are available or idx is not in the range [0, getNumReactionSites() - 1].

◆ performReaction()

None CDPL.Chem.Reactor.performReaction ( AtomBondMapping  rxn_site)

Performs a transformation of the target reactants to corresponding products at the specified reaction-site.

The reactant components of the Chem.Reaction object specified in a prior call to findReactionSites() serve as starting materials for the reaction transformation into corresponding product molecules (according to the set reaction pattern). The input molecules are left unchanged by the transformation. New molecules will be generated that are directly stored as the product components of the given target reaction object. Note that the product molecules generated in a previous call will not be discarded and are still accessible after new products have been generated.

Parameters
rxn_siteSpecifies the reaction-site where the transformation shall take place.
See also
setReactionPattern(), findReactionSites()