httk.atomistic.entries.precision

Serving how precisely a structure’s numbers were stated.

OPTIMADE standardises nothing about data precision — the only standard_uncertainty in its structures definition is CODATA metadata inside a unit definition — so these are database-specific properties described by the published definitions in definitions.

Serving them matters because a consumer choosing a matching tolerance or a symmetry symprec otherwise has to guess. With these two values it can derive one, exactly as structure_tolerance() does locally.

Attributes

Functions

precision_definitions()

Load the vendored coordinate and basis precision definitions.

precision_properties(structure)

Project the stated coordinate and basis precision.

Module Contents

httk.atomistic.entries.precision.PRECISION_PROPERTY_KEYS: dict[str, str][source]
httk.atomistic.entries.precision.precision_definitions()[source]

Load the vendored coordinate and basis precision definitions.

Returns:

Definitions keyed by their served names.

Return type:

dict[str, httk.core.PropertyDefinition]

httk.atomistic.entries.precision.precision_properties(structure)[source]

Project the stated coordinate and basis precision.

Both are null for a structure that does not say — one built by hand, or read from a source that does not write its numbers to a definite number of digits. That is the honest answer, and it is distinguishable from a claim of exactness.

Rendered as floats, since that is what a JSON consumer will use them as; they are held exactly on the structure itself.

Parameters:

structure (Any) – The structure to project, or None for an empty entry.

Returns:

The _httk_coordinate_precision and _httk_basis_precision values.

Return type:

dict[str, Any]