httk.atomistic.models.trajectory.trajectory

Store the native immutable trajectory representation.

Classes

Trajectory

Store an immutable trajectory in the native backend.

Module Contents

class httk.atomistic.models.trajectory.trajectory.Trajectory(frames, observables=None, reference_frames=None)

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

Store an immutable trajectory in the native backend.

A trajectory requires at least one frame and keeps one constant composition across all frames.

Parameters:
kind: ClassVar[str] = 'native'
property nframes: int

Return the number of stored frames.

frame(i)

Return one stored frame by index.

Parameters:

i (int) – Frame index.

Returns:

The requested unit-cell structure.

Raises:

IndexError – If the index is out of range.

Return type:

httk.atomistic.models.structure.unitcell.UnitcellStructure

frames()

Iterate over the stored frames.

Returns:

An iterator of unit-cell structures.

Return type:

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

property reference_frames: tuple[int, Ellipsis] | None

Return the bounded reference-frame indexes, or None.

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

Return the constant distinct species.

property species_at_sites: tuple[str, Ellipsis]

Return the constant species name at each site.

property observable_names: tuple[str, Ellipsis]

Return the names of stored observables.

observable(name)

Return one observable’s values in frame order.

Parameters:

name (str) – Observable name.

Returns:

The observable values.

Raises:

KeyError – If the observable is unavailable.

Return type:

tuple[Any, Ellipsis]