httk.atomistic.models.formula.composition¶
The immutable canonical elemental composition value.
Classes¶
Store an immutable projected composition and its formula diagnostics. |
Module Contents¶
- class httk.atomistic.models.formula.composition.Composition(amounts, uncertainties=None, complete=True, exact=None, normalized=True, normalization_status=None, diagnostics=())[source]¶
Bases:
httk.atomistic.models.formula.backend.ChemicalFormulaBackendStore an immutable projected composition and its formula diagnostics.
- Parameters:
amounts (collections.abc.Mapping[str, Any] | collections.abc.Iterable[tuple[str, Any]]) – The projected elemental amounts in symbol order.
uncertainties (collections.abc.Mapping[str, Any] | collections.abc.Iterable[tuple[str, Any]] | None) – The corresponding amount precisions, if known.
complete (bool) – Whether the projection contains no unknown elemental content.
exact (bool | None) – Whether all projected amounts are exact.
normalized (bool) – Whether all contributing probabilities and concentrations normalize.
normalization_status (str | None) – The combined normalization status.
diagnostics (collections.abc.Iterable[httk.atomistic.models.formula.diagnostics.CompositionDiagnostic]) – The non-fatal issues found during projection.
- amounts: tuple[tuple[str, fractions.Fraction], Ellipsis] = ()[source]¶
Ordered
(label, exact amount)pairs for this chemical formula.Labels are element symbols in alphabetical order unless
is_anonymous, in which case they are OPTIMADE anonymous symbols in canonical (descending-coefficient) order.
- uncertainties: tuple[tuple[str, fractions.Fraction | None], Ellipsis] = ()[source]¶
Per-amount absolute uncertainties, or
Nonewhere exactness is unstated.
- normalization_status: str = 'exact'[source]¶
The formula’s normalization status derived from exactness and normalization.
- diagnostics: tuple[httk.atomistic.models.formula.diagnostics.CompositionDiagnostic, Ellipsis] = ()[source]¶
Non-fatal structured diagnostics associated with the formula.
- property amount_mapping: collections.abc.Mapping[str, fractions.Fraction][source]¶
Return the projected amounts as a read-only mapping.
- property uncertainty_mapping: collections.abc.Mapping[str, fractions.Fraction | None][source]¶
Return the projected amount precisions as a read-only mapping.
- property elements: tuple[str, Ellipsis][source]¶
Return the projected element symbols in amount order.
- property elements_ratios: tuple[fractions.Fraction, Ellipsis][source]¶
Return the projected amounts normalized by their total.