httk.atomistic.species_primitive

Backend wrapping a validated OPTIMADE species dict.

Classes

SpeciesPrimitive

Backend for a species backed by an OPTIMADE species dict.

Module Contents

class httk.atomistic.species_primitive.SpeciesPrimitive(obj: dict[str, Any], **hints: Any)[source]

Bases: httk.atomistic.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.

property name: str[source]
property chemical_symbols: tuple[str, Ellipsis][source]
property concentration: tuple[float, Ellipsis][source]
property mass: tuple[float, Ellipsis] | None[source]
property attached: tuple[str, Ellipsis] | None[source]
property nattached: tuple[int, Ellipsis] | None[source]
property original_name: str | None[source]
unwrap() Any[source]

Return the most raw representation possible of this backend, i.e., if it uses a backend with an internal representaion - or if it can (possibly lossly) convert itself into a more raw representation that still would be recognized as a <Something>Like type, that representation will be returned. If this is not possible, the instance itself is returned.