httk.atomistic.models.trajectory.view

Present trajectory backends through the lazy canonical view.

Classes

TrajectoryView

Present any trajectory backend through the canonical trajectory API.

Module Contents

class httk.atomistic.models.trajectory.view.TrajectoryView(obj, **hints)[source]

Bases: httk.core.View[httk.atomistic.models.trajectory.backend.TrajectoryBackend], httk.atomistic.models.trajectory.api.TrajectoryAPI

Present any trajectory backend through the canonical trajectory API.

Parameters:
  • obj (Any) – A trajectory backend or another accepted trajectory value.

  • **hints (Any) – Backend-selection hints.

property nframes: int[source]

Return the number of frames.

frame(i)[source]

Return one frame by index.

Parameters:

i (int) – Frame index.

Returns:

The requested unit-cell structure.

Return type:

httk.atomistic.models.structure.unitcell.UnitcellStructure

frames()[source]

Iterate over the 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[source]

Return stored reference-frame indexes, or None.

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

Return the constant distinct species.

property species_at_sites: tuple[str, Ellipsis][source]

Return the constant species name at each site.

property observable_names: tuple[str, Ellipsis][source]

Return the names of available per-frame observables.

property observable_summaries: tuple[Any, Ellipsis][source]

Return backend-provided observable summaries, if any.

property immutable_id: str | None[source]

Return the backend immutable identifier, if available.

property last_modified: Any[source]

Return the backend modification marker, if available.

property source_locator: str | None[source]

Return the source locator, if available.

observable(name)[source]

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]

unwrap()[source]

Return the original value wrapped by the backend.