chemistry_tools.pubchem.atom
Attention
This package has the following additional requirements:
cawdrey>=0.1.7 mathematical>=0.1.13 pillow>=7.0.0 pyparsing>=2.4.6 tabulate>=0.8.9
These can be installed as follows:
python -m pip install chemistry-tools[pubchem]
Represents an atom in a Compound
.
Classes:
|
Class to represent an atom in a |
Functions:
|
Parse atoms from the given dictionary. |
-
class
Atom
(aid, number, x=None, y=None, z=None, charge=0)[source] Bases:
object
Class to represent an atom in a
Compound
.- Parameters
aid (
int
) – The Atom ID within the owning Compound.number (
int
) – The Atomic number for this atom.x (
Optional
[float
]) – The x coordinate for this atom. DefaultNone
.y (
Optional
[float
]) – The y coordinate for this atom. DefaultNone
.z (
Optional
[float
]) – The z coordinate for this atom. Will beNone
in 2D Compound records. DefaultNone
.charge (
int
) – Formal charge on atom. Default0
.
Methods:
__eq__
(other)Return
self == other
.__repr__
()Return a string representation of the
Atom
.set_coordinates
(x, y[, z])Set all coordinate dimensions at once.
to_dict
()Return a dictionary containing Atom data.
Attributes:
Returns whether this atom has 2D or 3D coordinates.
The element symbol for this atom.