httk.atomistic.models.trajectory.record

Expose bounded trajectory storage records as backends.

Classes

RecordTrajectory

Expose only the bounded summary and stored reference frames.

Module Contents

class httk.atomistic.models.trajectory.record.RecordTrajectory(obj, **hints)

Bases: httk.atomistic.models.trajectory.backend.TrajectoryBackend

Expose only the bounded summary and stored reference frames.

Full frame data is deliberately absent from httk.atomistic.storage.records.TrajectoryRecord. Callers must use source_locator to reopen the original source for any frame that is not one of the stored reference frames.

Parameters:
property nframes: int

Return the total number of source frames.

property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis]

Return the stored distinct species.

property species_at_sites: tuple[str, Ellipsis]

Return the stored species name at each site.

property reference_frames: tuple[int, Ellipsis]

Return the indexes of frames stored in the bounded record.

property observable_names: tuple[str, Ellipsis]

Return the names of summarized observables.

property observable_summaries: tuple[httk.atomistic.storage.records.ObservableSummaryRecord, Ellipsis]

Return the stored per-observable summaries.

frame(i)

Return a stored reference frame by source index.

Parameters:

i (int) – Source frame index.

Returns:

The stored reference frame.

Raises:
  • IndexError – If the frame is not stored in the bounded record.

  • TypeError – If the index is not an integer.

Return type:

httk.atomistic.models.structure.unitcell.UnitcellStructure

frames()

Reject iteration because full frames are not stored.

Returns:

Never; reopen the source at source_locator instead.

Raises:

RuntimeError – Always, because the record stores no full frame sequence.

Return type:

collections.abc.Iterator[httk.atomistic.models.structure.unitcell.UnitcellStructure]

observable(name)

Reject per-frame access to summarized observable values.

Parameters:

name (str) – Observable name.

Returns:

Never; reopen the source at source_locator instead.

Raises:
  • KeyError – If the observable is unavailable.

  • RuntimeError – If the observable is summarized but not stored per frame.

Return type:

tuple[Any, Ellipsis]

unwrap()

Return the bounded storage record.