Source code for httk.atomistic.species_api
"""
The minimal canonical species interface for httk-atomistic.
"""
from abc import ABC, abstractmethod
[docs]
class SpeciesAPI(ABC):
"""
Abstract base class for the canonical single-species interface.
It declares the accessors mirroring the OPTIMADE ``species`` fields that every
species backend produces from its own native representation and every species view
builds its presentation from: ``name``, ``chemical_symbols``, ``concentration``,
and the optional ``mass``, ``attached``, ``nattached``, and ``original_name``.
"""
@property
@abstractmethod
[docs]
def name(self) -> str:
raise NotImplementedError
@property
@abstractmethod
[docs]
def chemical_symbols(self) -> tuple[str, ...]:
raise NotImplementedError
@property
@abstractmethod
[docs]
def concentration(self) -> tuple[float, ...]:
raise NotImplementedError
@property
@abstractmethod
[docs]
def mass(self) -> tuple[float, ...] | None:
raise NotImplementedError
@property
@abstractmethod
[docs]
def attached(self) -> tuple[str, ...] | None:
raise NotImplementedError
@property
@abstractmethod
[docs]
def nattached(self) -> tuple[int, ...] | None:
raise NotImplementedError
@property
@abstractmethod
[docs]
def original_name(self) -> str | None:
raise NotImplementedError