chemistry_tools.formulae.composition
Attention
This module has the following additional requirements:
cawdrey>=0.5.0 mathematical>=0.5.1 pyparsing>=2.4.6 tabulate>=0.8.9
These can be installed as follows:
python -m pip install chemistry-tools[formulae]
Elemental composition of a Formula.
Classes:
|
Class to represent the elemental composition of a |
|
Lookup for sorting elemental composition output. |
-
class
Composition(formula)[source] Bases:
DataArrayClass to represent the elemental composition of a
Formula.Methods:
__str__()Return
str(self).as_array([sort_by, reverse])Returns the elemental composition as a list of lists.
Attributes:
The number of elements in the composition.
The total mass of the composition.
-
enum
CompositionSort(value)[source] Bases:
enum.EnumLookup for sorting elemental composition output.
Valid values are as follows:
-
symbol= <CompositionSort.symbol: 'symbol'>
-
count= <CompositionSort.count: 'count'>
-
rel_mass= <CompositionSort.rel_mass: 'rel_mass'>
-
mass_fraction= <CompositionSort.mass_fraction: 'mass_fraction'>
-