rxn_network.core#
Composition class used to represent a chemical composition.
- class rxn_network.core.Composition(*args, strict=False, **kwargs)[source]#
Bases:
Composition
Modified Composition class adapted from pymatgen.
The purpose of this is to modify / extend methods for better performance within the rxn_network package.
Very flexible Composition construction, similar to the built-in Python dict(). Also extended to allow simple string init.
Takes any inputs supported by the Python built-in dict function.
A dict of either {Element/Species: amount},
{string symbol:amount}, or {atomic number:amount} or any mixture of these. E.g., {Element(“Li”): 2, Element(“O”): 1}, {“Li”:2, “O”:1}, {3: 2, 8: 1} all result in a Li2O composition.
Keyword arg initialization, similar to a dict, e.g.,
Composition(Li = 2, O = 1)
In addition, the Composition constructor also allows a single string as an input formula. E.g., Composition(“Li2O”).
- Parameters: