stk.ConstructedMoleculeDatabase

class stk.ConstructedMoleculeDatabase[source]

Bases: object

Abstract base class for storing constructed molecules.

See also

MoleculeDatabase

If you need to store and retrieve Molecule instances.

Examples

Subclass Implementation

The source code of the subclasses, listed in constructed_molecule_database, can serve as good examples.

Methods

get

Get the molecule with key from the database.

get_all

Get all entries in the database.

put

Put molecule into the database.

get(key)[source]

Get the molecule with key from the database.

Parameters:

key (object) – The key of a molecule, which is to be returned from the database.

Returns:

The molecule held in the database under key.

Return type:

ConstructedMolecule

Raises:

KeyError – If key is not found in the database.

get_all()[source]

Get all entries in the database.

Yields:

ConstructedMolecule – A molecule in the database.

put(molecule)[source]

Put molecule into the database.

Parameters:

molecule (ConstructedMolecule) – The molecule to place into the database.

Returns:

None

Return type:

NoneType