Trajectory classes

BaseTrajectory

FullTrajectory

LazyTrajectory

class baggianalysis.core.BaseTrajectory(self: baggianalysis.core.BaseTrajectory, arg0: baggianalysis.core.BaseParser)None

Bases: pybind11_builtins.pybind11_object

add_filter(self: baggianalysis.core.BaseTrajectory, filter: baggianalysis.core.BaseFilter)None

Add a filter to the list of filters that will be applied to each frame (system) that compose the trajectory.

The order according to which filters are added to the trajectory is important, since they are applied to systems in a “first-in first-out” fashion.

Parameters

filter (:class:BaseFilter) – The new filter.

initialise_from_filelist(self: baggianalysis.core.BaseTrajectory, filelist: List[str])None

Initialise the trajectory out of a list of filenames.

Parameters

filelist (List(str)) – The list of filenames that will be used to initialise the trajectory.

initialise_from_folder(self: baggianalysis.core.BaseTrajectory, folder: str, pattern: str, natural_sorting: bool = True)None

Initialise the trajectory by loading up frames stored in files contained in a folder according to a pattern.

Parameters
  • folder (str) – The folder containing the files to be parsed

  • pattern (str) – A glob pattern used to select the files to be loaded. Examples are confs* or conf?0000.dat.

  • natural_sorting (bool) – Sort the files alphabetically while, at the same time, attempting to handle multi-digit numbers.

initialise_from_trajectory_file(self: baggianalysis.core.BaseTrajectory, trajectory_file: str)None

Initialise the trajectory from a single file, which should contain all the frames, one after the other.

Parameters

trajectory_file (str) – The name of the file containing the trajectory.

next_frame(self: baggianalysis.core.BaseTrajectory)baggianalysis.core.System

Return the next frame (system), or None if we reached the end of the trajectory.

Returns

Either the next system or None if there are no more available frames.

Return type

System

reset(self: baggianalysis.core.BaseTrajectory)None

Reset the trajectory so that a call to next_frame() will return the first frame of the trajectory.

class baggianalysis.core.FullTrajectory(self: baggianalysis.core.FullTrajectory, arg0: baggianalysis.core.BaseParser)None

Bases: baggianalysis.core.BaseTrajectory

property frames
class baggianalysis.core.LazyTrajectory(self: baggianalysis.core.LazyTrajectory, arg0: baggianalysis.core.BaseParser)None

Bases: baggianalysis.core.BaseTrajectory