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

A global dictionary for the lookup of data associated with the atom types defined in namespace Chem.AtomType. More...

+ Inheritance diagram for CDPL.Chem.AtomDictionary:

Classes

class  Entry
 

Public Member Functions

None __init__ ()
 Initializes the AtomDictionary instance.
 
None __init__ (AtomDictionary dict)
 Initializes a copy of the AtomDictionary instance dict. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None addEntry (Entry entry)
 
bool containsEntry (int type, int isotope)
 
None removeEntry (int type, int isotope)
 
Entry getEntry (int type, int isotope)
 
None clear ()
 
int getNumEntries ()
 
list getEntries ()
 
None loadDefaults ()
 
AtomDictionary assign (AtomDictionary dict)
 Replaces the current state of self with a copy of the state of the AtomDictionary instance dict. More...
 

Static Public Member Functions

None set (AtomDictionary dict)
 
AtomDictionary get ()
 
str getSymbol (int type, int isotope=0)
 Returns the symbol that is associated with the specified atom type and isotope. More...
 
str getName (int type, int isotope=0)
 Returns the name of the chemical element that is associated with the specified atom type and isotope. More...
 
int getType (str symbol, bool strict=False)
 Returns the numeric atom type that is associated with the specified atom type symbol. More...
 
int getMostAbundantIsotope (int type)
 Returns the mass number of the most abundant isotope of the chemical element specified by type. More...
 
int getIUPACGroup (int type)
 Returns the IUPAC group of the chemical element specified by type. More...
 
int getPeriod (int type)
 Returns the period number of the chemical element specified by type. More...
 
int getNumValenceElectrons (int type)
 Returns the number of valence electrons of the chemical element specified by type. More...
 
float getAtomicWeight (int type, int isotope=0)
 Returns the standard atomic weight or the relative isotopic mass of an isotope of the chemical element specified by type. More...
 
float getVdWRadius (int type)
 Returns the van der Waals radius of the chemical element specified by type. More...
 
float getCovalentRadius (int type, int order=1)
 Returns the covalent radius of the chemical element specified by type for the given bond order. More...
 
float getAllredRochowElectronegativity (int type)
 Returns the Allred-Rochow electronegativity of the chemical element specified by type. More...
 
Util.STArray getValenceStates (int type)
 Returns an array with the valence states of the chemical element specified by type. More...
 
bool isChemicalElement (int type)
 Tells whether the specified atom type represents a chemical element. More...
 
bool isMainGroupElement (int type)
 Tells whether the chemical element specified by type is a main group element. More...
 
bool isTransitionMetal (int type)
 Tells whether the chemical element specified by type is a transition metal. More...
 
bool isMetal (int type)
 Tells whether the chemical element specified by type is a metal. More...
 
bool isSemiMetal (int type)
 Tells whether the chemical element specified by type is a semi-metal. More...
 
bool isNonMetal (int type)
 Tells whether the chemical element specified by type is a non-metal. More...
 
bool isHalogen (int type)
 Tells whether the chemical element specified by type is a halogen. More...
 
bool isNobleGas (int type)
 Tells whether the chemical element specified by type is a noble gas. More...
 

Properties

 objectID = property(getObjectID)
 
 numEntries = property(getNumEntries)
 
 entries = property(getEntries)
 

Detailed Description

A global dictionary for the lookup of data associated with the atom types defined in namespace Chem.AtomType.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Chem.AtomDictionary.__init__ ( AtomDictionary  dict)

Initializes a copy of the AtomDictionary instance dict.

Parameters
dictThe AtomDictionary instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Chem.AtomDictionary.getObjectID ( )

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

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

◆ addEntry()

None CDPL.Chem.AtomDictionary.addEntry ( Entry  entry)
Parameters
entry

◆ containsEntry()

bool CDPL.Chem.AtomDictionary.containsEntry ( int  type,
int  isotope 
)
Parameters
type
isotope
Returns

◆ removeEntry()

None CDPL.Chem.AtomDictionary.removeEntry ( int  type,
int  isotope 
)
Parameters
type
isotope

◆ getEntry()

Entry CDPL.Chem.AtomDictionary.getEntry ( int  type,
int  isotope 
)
Parameters
type
isotope
Returns

◆ getNumEntries()

int CDPL.Chem.AtomDictionary.getNumEntries ( )
Returns

◆ getEntries()

list CDPL.Chem.AtomDictionary.getEntries ( )
Returns

◆ assign()

AtomDictionary CDPL.Chem.AtomDictionary.assign ( AtomDictionary  dict)

Replaces the current state of self with a copy of the state of the AtomDictionary instance dict.

Parameters
dictThe AtomDictionary instance to copy.
Returns
self

◆ set()

None CDPL.Chem.AtomDictionary.set ( AtomDictionary  dict)
static
Parameters
dict

◆ get()

AtomDictionary CDPL.Chem.AtomDictionary.get ( )
static
Parameters
<br>
Returns

◆ getSymbol()

str CDPL.Chem.AtomDictionary.getSymbol ( int  type,
int   isotope = 0 
)
static

Returns the symbol that is associated with the specified atom type and isotope.

The isotope argument has only an effect for hydrogen whose isotopes have different symbols (D for Deuterium and T for Tritium).

Parameters
typeThe atom type.
isotopeThe mass number of the isotope, or 0 if not specified.
Returns
The atom type symbol, or an empty string if the symbol for the specified type and isotope is not available.

◆ getName()

str CDPL.Chem.AtomDictionary.getName ( int  type,
int   isotope = 0 
)
static

Returns the name of the chemical element that is associated with the specified atom type and isotope.

The isotope argument has only an effect for hydrogen whose isotopes are named differently (Deuterium and Tritium).

Parameters
typeThe atom type specifying the chemical element.
isotopeThe mass number of the element's isotope, or 0 if not specified.
Returns
The name of the element isotope, or an empty string if type does not specify a supported chemical element.

◆ getType()

int CDPL.Chem.AtomDictionary.getType ( str  symbol,
bool   strict = False 
)
static

Returns the numeric atom type that is associated with the specified atom type symbol.

Parameters
symbolThe atom type symbol.
strictIf True, dictionary symbols strictly have to match the argument symbol. Otherwise, the symbols will be converted to upper-case before their comparison.
Returns
The numeric atom type, or AtomType.UNKNOWN if symbol does not specify a supported atom type.

◆ getMostAbundantIsotope()

int CDPL.Chem.AtomDictionary.getMostAbundantIsotope ( int  type)
static

Returns the mass number of the most abundant isotope of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The mass number of the most abundant isotope of the element, or 0 if type does not specify a supported chemical element.

◆ getIUPACGroup()

int CDPL.Chem.AtomDictionary.getIUPACGroup ( int  type)
static

Returns the IUPAC group of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The IUPAC group of the element, or 0 if type does not specify a supported chemical element.

◆ getPeriod()

int CDPL.Chem.AtomDictionary.getPeriod ( int  type)
static

Returns the period number of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The period of the element, or 0 if type does not specify a supported chemical element.

◆ getNumValenceElectrons()

int CDPL.Chem.AtomDictionary.getNumValenceElectrons ( int  type)
static

Returns the number of valence electrons of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The number of valence electrons, or 0 if type does not specify a supported chemical element.

◆ getAtomicWeight()

float CDPL.Chem.AtomDictionary.getAtomicWeight ( int  type,
int   isotope = 0 
)
static

Returns the standard atomic weight or the relative isotopic mass of an isotope of the chemical element specified by type.

If the element isotope is left unspecified, i.e. the argument isotope is zero, then the standard atomic weight of the chemical element will be returned. If an isotope is specified and the exact relative isotopic mass of the specified isotope is not available, the relative isotopic mass is approximated by the provided mass number of the isotope.

Parameters
typeThe atom type specifying the chemical element.
isotopeThe mass number of the element's isotope, or 0 if not specified.
Returns
The relative isotopic mass of the specified element isotope, or the standard atomic weight of the element if isotope is zero.

◆ getVdWRadius()

float CDPL.Chem.AtomDictionary.getVdWRadius ( int  type)
static

Returns the van der Waals radius of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The van der Waals radius, or 0.0 if type does not specify a supported chemical element.

◆ getCovalentRadius()

float CDPL.Chem.AtomDictionary.getCovalentRadius ( int  type,
int   order = 1 
)
static

Returns the covalent radius of the chemical element specified by type for the given bond order.

Parameters
typeThe atom type specifying the chemical element.
orderThe bond order.
Returns
The covalent radius for the specified bond order, or 0.0 if type does not specify a supported chemical element, order is not valid or the radius is unknown.

◆ getAllredRochowElectronegativity()

float CDPL.Chem.AtomDictionary.getAllredRochowElectronegativity ( int  type)
static

Returns the Allred-Rochow electronegativity of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
The Allred-Rochow electronegativity, or 0.0 if the electronegativity of the specified element is not available.

◆ getValenceStates()

Util.STArray CDPL.Chem.AtomDictionary.getValenceStates ( int  type)
static

Returns an array with the valence states of the chemical element specified by type.

Parameters
typeThe atom type specifying the chemical element.
Returns
An array with the valence states of the specified chemical element.

◆ isChemicalElement()

bool CDPL.Chem.AtomDictionary.isChemicalElement ( int  type)
static

Tells whether the specified atom type represents a chemical element.

Parameters
typeThe atom type.
Returns
True if type specifies a chemical element, and False otherwise.

◆ isMainGroupElement()

bool CDPL.Chem.AtomDictionary.isMainGroupElement ( int  type)
static

Tells whether the chemical element specified by type is a main group element.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a main group element, and False otherwise.

◆ isTransitionMetal()

bool CDPL.Chem.AtomDictionary.isTransitionMetal ( int  type)
static

Tells whether the chemical element specified by type is a transition metal.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a transition metal, and False otherwise.

◆ isMetal()

bool CDPL.Chem.AtomDictionary.isMetal ( int  type)
static

Tells whether the chemical element specified by type is a metal.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a metal, and False otherwise.

◆ isSemiMetal()

bool CDPL.Chem.AtomDictionary.isSemiMetal ( int  type)
static

Tells whether the chemical element specified by type is a semi-metal.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a semi-metal, and False otherwise.

◆ isNonMetal()

bool CDPL.Chem.AtomDictionary.isNonMetal ( int  type)
static

Tells whether the chemical element specified by type is a non-metal.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a non-metal, and False otherwise.

◆ isHalogen()

bool CDPL.Chem.AtomDictionary.isHalogen ( int  type)
static

Tells whether the chemical element specified by type is a halogen.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a halogen, and False otherwise.

◆ isNobleGas()

bool CDPL.Chem.AtomDictionary.isNobleGas ( int  type)
static

Tells whether the chemical element specified by type is a noble gas.

Parameters
typeThe atom type specifying the chemical element.
Returns
True if type specifies a noble gas, and False otherwise.