pyrolite.geochem.parse
Functions for parsing, formatting and validating chemical names and formulae.
- pyrolite.geochem.parse.is_isotoperatio(s)[source]
Check if text is plausibly an isotope ratio.
Todo
Validate the isotope masses vs natural isotopes
- pyrolite.geochem.parse.repr_isotope_ratio(isotope_ratio)[source]
Format an isotope ratio pair as a string.
Todo
Consider returning additional text outside of the match (e.g. 87Sr/86Sri should include the ‘i’).
- pyrolite.geochem.parse.ischem(s)[source]
Checks if a string corresponds to chemical component (compositional). Here simply checking whether it is a common element or oxide.
Todo
Implement checking for other compounds, e.g. carbonates.
- pyrolite.geochem.parse.tochem(strings: list, abbrv=['ID', 'IGSN'], split_on='[\\s_]+')[source]
Converts a list of strings containing come chemical compounds to appropriate case.
- pyrolite.geochem.parse.check_multiple_cation_inclusion(df, exclude=['LOI', 'FeOT', 'Fe2O3T'])[source]
Returns cations which are present in both oxide and elemental form.
- Parameters
df (
pandas.DataFrame
) – Dataframe to check duplication within.exclude (
list
,["LOI", "FeOT", "Fe2O3T"]
) – List of components to exclude from the duplication check.- Returns
Set of elements for which multiple components exist in the dataframe.
- Return type
Todo
Options for output (string/formula).