[docs]classLoadDataFile(zntrack.Node):"""Load a trajectory file. Entry point of trajectory data for the use in other nodes. Parameters ---------- path : str | pathlib.Path Path to the trajectory file. start : int, default=0 Index of the first frame to load. stop : int, default=None Index of the last frame to load. step : int, default=1 Step size between frames. Attributes ---------- frames : list[ase.Atoms] Loaded frames. """path:str|pathlib.Path=zntrack.deps_path()# TODO these are not usedstart:int=zntrack.params(0)stop:t.Optional[int]=zntrack.params(None)step:int=zntrack.params(1)defrun(self):pass@propertydefframes(self)->list[ase.Atoms]:ifpathlib.Path(self.path).suffixin[".h5",".h5md"]:withself.state.fs.open(self.path,"rb")asf:withh5py.File(f)asfile:returnznh5md.IO(file_handle=file)[self.start:self.stop:self.step]else:format=pathlib.Path(self.path).suffix.lstrip(".")ifformat=="xyz":format="extxyz"# force ase to use the extxyz readerwithself.state.fs.open(self.path,"r")asf:returnlist(ase.io.iread(f,format=format,index=slice(self.start,self.stop,self.step)))