httk.atomistic.models.species.plain

Backend wrapping a validated OPTIMADE species dict.

Classes

PlainSpecies

Backend for a species backed by an OPTIMADE species dict.

Module Contents

class httk.atomistic.models.species.plain.PlainSpecies(obj, **hints)[source]

Bases: httk.atomistic.models.species.backend.SpeciesBackend

Backend for a species backed by an OPTIMADE species dict.

The native representation is a mapping with the OPTIMADE species fields; the required name/chemical_symbols/concentration are validated conservatively on construction. The accessors read the corresponding fields (optional fields absent from the dict read as None), and unwrap returns the original dict.

Parameters:
  • obj (dict[str, Any]) – The species mapping.

  • **hints (Any) – Backend-selection hints.

property name: str[source]

Return the species name.

Returns:

The species name.

Return type:

str

property chemical_symbols: tuple[str, Ellipsis][source]

Return the constituent symbols.

Returns:

The chemical symbols in constituent order.

Return type:

tuple[str, Ellipsis]

property concentration: tuple[fractions.Fraction, Ellipsis][source]

Return the constituent concentrations.

Returns:

The concentrations in constituent order.

Return type:

tuple[fractions.Fraction, Ellipsis]

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

Return the concentration precision metadata.

Returns:

Per-constituent precision, or None when unavailable.

Return type:

tuple[fractions.Fraction | None, Ellipsis] | None

property mass: tuple[float, Ellipsis] | None[source]

Return the constituent masses, if stated.

Returns:

The masses, or None when unstated.

Return type:

tuple[float, Ellipsis] | None

property attached: tuple[str, Ellipsis] | None[source]

Return the attached constituent symbols, if stated.

Returns:

The attached symbols, or None when unstated.

Return type:

tuple[str, Ellipsis] | None

property nattached: tuple[int, Ellipsis] | None[source]

Return the attached counts, if stated.

Returns:

The attached counts, or None when unstated.

Return type:

tuple[int, Ellipsis] | None

property original_name: str | None[source]

Return the original source name, if stated.

Returns:

The original name, or None when unstated.

Return type:

str | None

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

Return the constituent charges, if stated.

Returns:

The charges, or None when unstated.

Return type:

tuple[fractions.Fraction | None, Ellipsis] | None

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

Return the constituent spins, if stated.

Returns:

The spins, or None when unstated.

Return type:

tuple[fractions.Fraction | None, Ellipsis] | None

property labels: tuple[str | None, Ellipsis] | None[source]

Return the constituent labels, if stated.

Returns:

The labels, or None when unstated.

Return type:

tuple[str | None, Ellipsis] | None

unwrap()[source]

Return the original species mapping.

Returns:

The raw mapping.

Return type:

Any