httk.atomistic.structure_record

Frozen storage records for complete atomistic structures.

Classes

SpeciesRecord

The storable frozen snapshot of an atomistic Species.

StructureRecord

A storable snapshot of a complete Structure.

Module Contents

class httk.atomistic.structure_record.SpeciesRecord[source]

The storable frozen snapshot of an atomistic Species.

The presence flags preserve None for optional tuple fields because a relational child table cannot distinguish a missing optional value from an empty tuple when reconstructing.

name: str[source]
chemical_symbols: tuple[str, Ellipsis][source]
concentration: tuple[float, Ellipsis][source]
mass: tuple[float, Ellipsis] | None = None[source]
original_name: str | None = None[source]
attached: tuple[str, Ellipsis] | None = None[source]
nattached: tuple[int, Ellipsis] | None = None[source]
mass_present: bool = False[source]
attached_present: bool = False[source]
classmethod from_species(species: httk.atomistic.species.Species) SpeciesRecord[source]

Create a storage record containing the exact species metadata.

to_species() httk.atomistic.species.Species[source]

Reconstruct the domain Species from this snapshot.

class httk.atomistic.structure_record.StructureRecord[source]

A storable snapshot of a complete Structure.

This record is a snapshot, not a live proxy: changing a source Structure does not update it, and changing a record does not update a previously reconstructed structure. Rationals, surd bases, precisions, and periodicity remain exact. Species float fields round-trip at IEEE-double fidelity, with the SQL layer’s documented caveat that -0.0 may return as +0.0.

periodicity is annotated as a list because the storage schema supports homogeneous variable-length sequences, not fixed-length tuples. It is copied and validated here so callers cannot mutate the input list through the record. Construction also builds and discards the domain Structure once, so invalid domain combinations cannot exist.

basis: tuple[httk.core.SurdScalar, Ellipsis][source]
reduced_coords: Annotated[httk.core.FracVector, httk.core.storage_markers.Shape(0, 3)][source]
species: tuple[SpeciesRecord, Ellipsis][source]
species_at_sites: tuple[str, Ellipsis][source]
periodicity: list[bool][source]
basis_precision: fractions.Fraction | None[source]
coordinate_precision: fractions.Fraction | None[source]
classmethod from_structure(structure: httk.atomistic.structure_like.StructureLike) StructureRecord[source]

Take a canonical snapshot of any StructureLike input.

to_structure() httk.atomistic.structure.Structure[source]

Rebuild the exact Structure represented by this snapshot.