httk.atomistic.models.sites.api

The minimal canonical sites interface for httk-atomistic.

Classes

SitesAPI

Abstract base class for the canonical sites interface.

Module Contents

class httk.atomistic.models.sites.api.SitesAPI[source]

Bases: abc.ABC

Abstract base class for the canonical sites interface.

It declares the single reduced_coords accessor (the exact Nx3 rational FracVector of reduced coordinates) that every sites backend produces from its own native representation and every sites view builds its presentation from. This is the single interchange format; there is no pairwise conversion between backends.

property reduced_coords: httk.core.FracVector[source]
Abstractmethod:

Return the reduced site coordinates.

property num_sites: int[source]

Return the number of coordinate rows.

Returns:

The number of sites.

Return type:

int

property precision: fractions.Fraction | None[source]

How precisely the coordinates were stated, in fractional units, or None.

Fractional, not a length: reduced coordinates are dimensionless and a Sites has no cell to convert with. cartesian_precision() does the conversion, where the cell is known.

Concrete rather than abstract, so a backend with no source of precision inherits None instead of breaking.

Returns:

The fractional precision, or None when unknown.

Return type:

fractions.Fraction | None