API reference

The public API is re-exported from the top-level package, so the common calls are one import away:

import mescla as am

am.EMMA, am.emma                      # how many end-members, which species
am.mixing_ratios, am.mix_ml, am.MixML # in what proportions
am.WaterChemistry, am.EndMembers      # the containers

Everything below is importable from its own module too, which is what the reference pages document.

Containers

mescla.types

Core data containers shared across Mescla.

Preparing the data

Unit conversion, charge balance, standardisation, and the tools for ragged datasets.

mescla.prep.units

Unit conversion for major-ion chemistry.

mescla.prep.qaqc

Quality checks to run before any mixing analysis.

mescla.prep.transform

Standardisation of water chemistry prior to eigen-analysis.

mescla.prep.missing

Ragged datasets: reporting, and choosing what to keep.

End-member mixing analysis

How many end-members the data require, which species behave as a mixture, and whether candidate end-members bound the samples.

mescla.emma.model

The EMMA estimator: a scikit-learn-style wrapper over the functional pieces.

mescla.emma.pca

Eigen-analysis of standardised water chemistry.

mescla.emma.rank

How many components to retain -- and therefore how many end-members.

mescla.emma.projection

Projection into and out of the mixing subspace (U-space).

mescla.emma.diagnostics

Goodness-of-fit diagnostics for a mixing model (Hooper, 2003).

mescla.emma.endmembers

Screening candidate end-members in U-space.

mescla.emma.archetypes

Archetypal analysis: data-driven candidates for end-members.

Mixing ratios

Constrained least squares, the closed forms, and the maximum-likelihood method for uncertain end-members.

mescla.mixing.lsq

Constrained least squares for mixing ratios with known end-members.

mescla.mixing.geometric

Closed-form mixing fractions for the small cases, and the U-space solve.

mescla.mixing.ml

MIX: maximum-likelihood mixing ratios with uncertain end-members.

Isotopes

Isotopes of the water molecule mix linearly; isotope ratios of a solute do not.

mescla.isotopes

Isotope tracers, and the one that breaks linear mixing.

Uncertainty

mescla.uncertainty.propagation

Analytical error propagation for mixing fractions.

mescla.uncertainty.montecarlo

Monte Carlo uncertainty for mixing ratios.

mescla.uncertainty.resampling

Jackknife and bootstrap uncertainty for mixing ratios.

mescla.uncertainty.identifiability

Can these mixing ratios be computed at all?

Reactions

mescla.reactions.residuals

Reading geochemical reactions out of mixing residuals.

Datasets

mescla.datasets.synthetic

Synthetic mixtures with known ground truth.

mescla.datasets.loaders

Loaders for the bundled datasets and for live public data.

Plotting

Requires the plotting extra.

mescla.plotting.diagrams

Figures for EMMA and mixing analyses.

mescla.plotting.theme

Colours and mark specifications for Mescla figures.