@@ -76,6 +76,8 @@ def assert_total_score(self, pose1, pose2):
7676 self .assertEqual (scorefxn (pose1 ), scorefxn (pose2 ))
7777
7878 def test_coordinates (self ):
79+ if not pyrosetta .rosetta .basic .was_init_called ():
80+ pyrosetta .init (options = "" , extra_options = self .pyrosetta_init_flags , silent = True )
7981 original_pose = io .pose_from_file (self .original_output_file ).pose
8082 reproduce_pose = io .pose_from_file (self .reproduce_output_file ).pose
8183 self .assert_atom_coordinates (original_pose , reproduce_pose )
@@ -88,9 +90,16 @@ def test_coordinates(self):
8890 parser = argparse .ArgumentParser ()
8991 parser .add_argument ('--original_output_file' , type = str , required = True )
9092 parser .add_argument ('--reproduce_output_file' , type = str , required = True )
93+ parser .add_argument (
94+ "--pyrosetta_init_flags" ,
95+ type = str ,
96+ required = False ,
97+ default = "-run:constant_seed 1 -out:level 200" ,
98+ )
9199 args , remaining_argv = parser .parse_known_args ()
92100 # Inject args into the class before running test
93101 TestAtomCoordinates .original_output_file = args .original_output_file
94102 TestAtomCoordinates .reproduce_output_file = args .reproduce_output_file
103+ TestAtomCoordinates .pyrosetta_init_flags = args .pyrosetta_init_flags
95104 # Run test
96105 unittest .main (argv = [__file__ ] + remaining_argv )
0 commit comments