httk.atomistic.structure_record¶
Frozen storage records for complete atomistic structures.
Classes¶
Module Contents¶
- class httk.atomistic.structure_record.SpeciesRecord[source]¶
The storable frozen snapshot of an atomistic
Species.The presence flags preserve
Nonefor optional tuple fields because a relational child table cannot distinguish a missing optional value from an empty tuple when reconstructing.- 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
Speciesfrom 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
Structuredoes 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.0may return as+0.0.periodicityis 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 domainStructureonce, 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]¶
- 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
StructureLikeinput.
- to_structure() httk.atomistic.structure.Structure[source]¶
Rebuild the exact
Structurerepresented by this snapshot.