66
77import numpy as np
88
9+ from dpgen .generator .run import _gromacs_input_files
10+
911sys .path .insert (0 , os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." )))
1012__package__ = "generator"
1113dirname = os .path .join (os .path .abspath (os .path .dirname (__file__ )), "gromacs" )
@@ -43,6 +45,7 @@ def setUp(self):
4345 "ref_filename" : "em.tpr" ,
4446 "model_devi_script" : "model_devi.py" ,
4547 "traj_filename" : "deepmd_traj.gro" ,
48+ "deffnm" : "deepmd" ,
4649 },
4750 "model_devi_dt" : 0.001 ,
4851 "model_devi_f_trust_lo" : 0.05 ,
@@ -80,7 +83,10 @@ def setUp(self):
8083
8184 def _check_dir (self , wdir , post = True ):
8285 for key in self .jdata ["gromacs_settings" ].keys ():
83- if key != "traj_filename" :
86+ if key == "deffnm" :
87+ # deffnm names generated outputs and must not be staged as input.
88+ self .assertFalse (os .path .exists (os .path .join (wdir , "deepmd" )))
89+ elif key != "traj_filename" :
8490 self .assertTrue (
8591 os .path .exists (
8692 os .path .join (wdir , self .jdata ["gromacs_settings" ][key ])
@@ -105,6 +111,13 @@ def _copy_outputs(self, path_1, path_2):
105111 )
106112 shutil .copytree (os .path .join (path_1 , "traj" ), os .path .join (path_2 , "traj" ))
107113
114+ def test_deffnm_is_not_an_input_file (self ):
115+ """Command/output settings must not be symlinked from the source system."""
116+ input_files = _gromacs_input_files (self .jdata ["gromacs_settings" ])
117+
118+ self .assertNotIn ("deepmd" , input_files )
119+ self .assertIn ("processed.top" , input_files )
120+
108121 @unittest .skipIf (
109122 importlib .util .find_spec ("openbabel" ) is not None ,
110123 "when openbabel is found, this test will be skipped. " ,
0 commit comments