Molecule¶
-
class
Molecule
(atoms, bonds)[source]¶ Bases:
object
A molecular graph.
Parameters: Methods
get_atoms
([atom_ids])Yield the atoms of the molecule. get_bonds
([bond_ids])Yield the bonds of the molecule. get_num_atoms
()Return the number of atoms in the molecule. get_num_bonds
()Return the number of bonds in the molecule. -
get_atoms
(atom_ids=None)[source]¶ Yield the atoms of the molecule.
Parameters: atom_ids ( iterable
ofint
) – The ids of the atoms which should be yielded. Can be anint
, if only one atom should be yielded.Yields: Atom
– An atom of the molecule.
-
get_bonds
(bond_ids=None)[source]¶ Yield the bonds of the molecule.
Parameters: bond_ids ( iterable
ofint
) – The ids of bonds which should be yielded. Can be anint
, if only one bond should be yielded.Yields: Bond
– A bond of the molecule.
-