From 36887d99b5bf04cda6c0fe4075748d8840f94fec Mon Sep 17 00:00:00 2001 From: gmatteo Date: Tue, 10 Oct 2023 23:02:20 +0200 Subject: [PATCH] Write QE POS file at the end of abiml md --- abipy/ml/aseml.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/abipy/ml/aseml.py b/abipy/ml/aseml.py index 041d63dfd..5edba7edd 100644 --- a/abipy/ml/aseml.py +++ b/abipy/ml/aseml.py @@ -1763,6 +1763,12 @@ def run(self) -> None: md.run(steps=self.steps) + # Convert ASE trajectory file to QE POS file. + write_qe_pos = True + if write_qe_pos: + pos_filepath = self.get_path("md.pos", "QE POS file") + traj_to_qepos(traj_file, pos_filepath) + #trajectory = read(traj_file, index=":") #write_vasp_xdatcar(workdir / "XDATCAR", trajectory, # label=f"xdatcar with relaxation generated by {self.__class__.__name__}") @@ -2589,7 +2595,7 @@ def traj_to_qepos(traj_filepath: str, pos_filepath: str) -> None: traj_filepath: Name of ASE trajectory file pos_filepath: Name of output POS file. """ - traj = Trajectory(traj_filepath) + traj = Trajectory(str(traj_filepath)) nStepsTraj = len(traj) nAtoms = len(traj[0]) #print(nStepsTraj)