CompositeReader¶
- class mdcraft.io.reader.CompositeReader(filename: str | Path, /, *, n_workers: int | None = 1)[source]¶
Bases:
BaseTrajectoryReaderMethods
Closes the topology or trajectory file and deletes the handle.
Opens the topology or trajectory file and stores a handle to it.
Reads data from one or more frames from the trajectory file.
- abstract property dt: float | None¶
Time step size between timesteps in the trajectory. If None, the time step size is not constant across frames or could not be determined from the trajectory.
Reference unit: \(\mathrm{ps}\).
- abstract property n_atoms: int | None¶
Number of atoms in each frame. If None, the number of atoms is not constant across frames.
- read_frames(frame_indices: int | slice | Iterable[int], /, *, _convert_units: bool = True) dict[str, Any] | list[dict[str, Any]]¶
Reads data from one or more frames from the trajectory file.
- Parameters:
- frame_indicesint, slice, or array-like, positional-only
Indices of frames to read.
- Returns:
- datadict or list
Data from the frame(s).
- abstract property time_step: float | None¶
Time step between frames in the trajectory. If None, the time step is not constant across frames.
Reference unit: \(\mathrm{ps}\).