automol.form#
some words
molecular formula
- automol.form.add_element(fml, symb, num=1)#
Add or subtract (if num < 0) this element from the molecular formula.
- automol.form.argsort_symbols(seq, symbs_first=('C', 'H'), symbs_last=(), idx=None)#
Determine the sort order for a sequence of atomic symbols.
- automol.form.atom_count(fml)#
Count the number of atoms in this molecular formula.
- automol.form.electron_count(fml)#
Count the number of electrons for the atoms in a molecular formula.
- automol.form.element_count(fml, symb)#
Count the number of a given element in this molecular formula.
- automol.form.equal(fml1, fml2)#
Determine whether two formulas are equal.
- automol.form.from_string(fml_str)#
Convert formula string to formula dictionary.
Wildcard values can be specified as, for example, ‘O2H*’, which will be interpreted as {‘O’: 2, ‘H’: -1} where the -1 indicates a wildcard stoichiometry.
- automol.form.heavy_atom_count(fml)#
Count the number of heavy atoms in this molecular formula.
- automol.form.join(fml1, fml2)#
Join two formulas together.
- automol.form.join_sequence(fmls)#
Join a sequence of formulas together.
- Parameters:
fml – Stochiometric chemical formula
- Return type:
- Returns:
Sum of the formulas
- automol.form.match(fml1, fml2)#
Check for a match between two formulas, allowing wildcard values.
A stoichiometry of -1 indicates a wildcard value
- automol.form.sort_vector(fml, symbs=None)#
Generate a sort vector for sorting various formulas against each other.
- automol.form.sorted_sequence(fmls)#
Sort a sequence of formulas based on Hill-sorting.
- automol.form.sorted_symbols(seq, symbs_first=('C', 'H'), symbs_last=())#
Produce a sorted list of atomic symbols; some elements given priority. By default, C placed first, then H, then others in alphabetical order.
- automol.form.sorted_symbols_in_sequence(fmls)#
Sort a sequence of formulas based on Hill-sorting.
- automol.form.string(fml, hyd=True)#
Convert formula dictionary to formula string in the Hill convention. Resultant string is identical to InChI formula string.
- automol.form.string2(fml)#
Convert formula dictionary to formula string that includes 1s in when there is only one atom.
- automol.form.unique(fmls)#
Get the unique formulas in a list.
automol.form.reac#
some words
reaction formulae.
- automol.form.reac.argsort_hydrogen_abstraction(rct_fmls, prd_fmls)#
Generate the indices which allows the reactants and products of a hydrogen abstraction reaction can be sorted as RH + Q => R + QH.
- automol.form.reac.is_valid_reaction(rct_fmls, prd_fmls)#
Use the formula to see if a reaction preserves stoichiometry.