httk.atomistic.models.trajectory.jsonl

Stream the neutral trajectory JSONL payload lazily.

Classes

JsonlTrajectory

Stream a neutral httk-trajectory-jsonl payload or path lazily.

Module Contents

class httk.atomistic.models.trajectory.jsonl.JsonlTrajectory(source, **hints)[source]

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

Stream a neutral httk-trajectory-jsonl payload or path lazily.

Frame data remains in the JSONL container and is read as requested.

Parameters:
  • source (Any) – A JSONL payload or path to one.

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

kind: ClassVar[str] = 'jsonl'[source]
property nframes: int[source]

Return the number of frames in the container.

property header: collections.abc.Mapping[str, Any][source]

Return the neutral JSONL header mapping.

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 reference_frames: tuple[int, Ellipsis] | None[source]

Return stored reference-frame indexes, or None.

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

Return the names of available per-frame observables.

observable(name)[source]

Read 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]

frame(i)[source]

Read one frame from the JSONL container.

Parameters:

i (int) – Frame index.

Returns:

The requested unit-cell structure.

Raises:

IndexError – If the frame index is out of range.

Return type:

httk.atomistic.models.structure.unitcell.UnitcellStructure

frames()[source]

Stream all frames from the JSONL container.

Yields:

Unit-cell structures in container order.

unwrap()[source]

Return the original JSONL source payload or path.

property source_locator: str | None[source]

Return the JSONL path, if the source has one.