Skip to content

Commit e13c186

Browse files
wanghan-iapcmHan Wangpre-commit-ci[bot]
authored
fix: hard-coded model name in gromacs model devi calculation (#1544)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved efficiency in model name processing within the model deviation functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Han Wang <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8bf5778 commit e13c186

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dpgen/generator/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,9 @@ def run_md_model_devi(iter_index, jdata, mdata):
20022002
command += f'&& echo -e "{grp_name}\\n{grp_name}\\n" | {model_devi_exec} trjconv -s {ref_filename} -f {deffnm}.trr -o {traj_filename} -pbc mol -ur compact -center'
20032003
command += "&& if [ ! -d traj ]; then \n mkdir traj; fi\n"
20042004
command += f"python -c \"import dpdata;system = dpdata.System('{traj_filename}', fmt='gromacs/gro'); [system.to_gromacs_gro('traj/%d.gromacstrj' % (i * {trj_freq}), frame_idx=i) for i in range(system.get_nframes())]; system.to_deepmd_npy('traj_deepmd')\""
2005-
command += f"&& dp model-devi -m ../graph.000.pb ../graph.001.pb ../graph.002.pb ../graph.003.pb -s traj_deepmd -o model_devi.out -f {trj_freq}"
2005+
_rel_model_names = " ".join([str(os.path.join("..", ii)) for ii in model_names])
2006+
command += f"&& dp model-devi -m {_rel_model_names} -s traj_deepmd -o model_devi.out -f {trj_freq}"
2007+
del _rel_model_names
20062008
commands = [command]
20072009

20082010
forward_files = [

0 commit comments

Comments
 (0)