httk.atomistic.models.formula.composition_view

Lazy composition presentation view.

Classes

CompositionView

Present any chemical-formula backend as a lazy composition.

Module Contents

class httk.atomistic.models.formula.composition_view.CompositionView(obj, **hints)[source]

Bases: httk.atomistic.models.formula.view_base.ChemicalFormulaViewBase, httk.atomistic.models.formula.composition.Composition

Present any chemical-formula backend as a lazy composition.

Parameters:
property amounts: tuple[tuple[str, fractions.Fraction], Ellipsis][source]

Return the lazily materialized elemental amounts.

property uncertainties: tuple[tuple[str, fractions.Fraction | None], Ellipsis][source]

Return the lazily materialized amount precisions.

property complete: bool[source]

Return whether the presented composition is complete.

property exact: bool[source]

Return whether the presented amounts are exact.

property normalized: bool[source]

Return whether the presented composition is normalized.

property normalization_status: str[source]

Return the presented composition’s normalization status.

property diagnostics: tuple[httk.atomistic.models.formula.diagnostics.CompositionDiagnostic, Ellipsis][source]

Return diagnostics associated with the presented composition.

unwrap()[source]

Return the raw object behind the backend.

Returns:

The unwrapped source object.

Return type:

Any

unview()[source]

Return the presented composition as a standalone value.

Returns:

The materialized composition value.

Return type:

httk.atomistic.models.formula.composition.Composition