1111
1212from arc import ARC
1313from arc .common import ARC_PATH
14- from arc .exceptions import InputError
1514from arc .imports import settings
1615from arc .reaction import ARCReaction
1716from arc .species import ARCSpecies
@@ -50,6 +49,7 @@ def setUpClass(cls):
5049 job_types = cls .job_types ,
5150 conformer_level = 'gfn2' ,
5251 level_of_theory = 'gfn2' ,
52+ arkane_level_of_theory = 'cbs-qb3' ,
5353 freq_scale_factor = 1.0 ,
5454 n_confs = 2 ,
5555 bac_type = None ,
@@ -69,6 +69,7 @@ def setUpClass(cls):
6969 conformer_level = 'gfn2' ,
7070 level_of_theory = 'gfn2' ,
7171 ts_guess_level = 'gfn2' ,
72+ arkane_level_of_theory = 'cbs-qb3' ,
7273 freq_scale_factor = 1.0 ,
7374 n_confs = 2 ,
7475 dont_gen_confs = ["TS0" ],
@@ -77,38 +78,51 @@ def setUpClass(cls):
7778 compare_to_rmg = False ,
7879 )
7980
80- def testThermo (self ):
81+ def test_thermo (self ):
8182 """Test thermo"""
8283 self .arc_object_1 .execute ()
8384 summary = self .arc_object_1 .summary ()
8485 for _ , ter in summary .items ():
8586 self .assertTrue (ter )
86- self .assertTrue (os .path .exists (os .path .join (ARC_PATH , "functional" , "test" , "thermo" , "output " , "RMG libraries " , "thermo" )))
87- with open ( file = os . path . join ( ARC_PATH , "functional" , "test" , " thermo" , "output" , "RMG libraries" , "thermo" , "FunctionalThermoTest.py" ), mode = 'r' ) as f :
88- entry = 0
87+ self .assertTrue (os .path .isfile (os .path .join (ARC_PATH , "functional" , "test" , "thermo" , "calcs " , "statmech " , "thermo" , "arkane.log " )))
88+ species , thermo = 0 , 0
89+ with open ( file = os . path . join ( ARC_PATH , "functional" , "test" , "thermo" , "calcs" , "statmech" , "thermo" , "input.py" ), mode = 'r' ) as f :
8990 for line in f .readlines ():
90- if "entry" in line :
91- entry += 1
92- self .assertEqual (entry , len (self .species_list_1 ))
91+ if "species('" in line :
92+ species += 1
93+ if "thermo('" in line :
94+ thermo += 1
95+ self .assertEqual (species , len (self .species_list_1 ))
96+ self .assertEqual (thermo , len (self .species_list_1 ))
9397
94- def testKinetic (self ):
98+ def test_kinetic (self ):
9599 """Test kinetics"""
96- try :
97- self .arc_object_2 .execute ()
98- except InputError as e :
99- self .skipTest (f"execution of ARC failed: { e } , skipping this test for now..." )
100+ self .arc_object_2 .execute ()
100101 summary = self .arc_object_2 .summary ()
101102 for _ , ter in summary .items ():
102103 self .assertTrue (ter )
103- self .assertTrue (os .path .exists (os .path .join (ARC_PATH , "functional" , "test" , "kinetic" , "output" , "RMG libraries" , "kinetics" )))
104- has_content = False
105- with open (file = os .path .join (ARC_PATH , "functional" , "test" , "kinetic" , "output" , "RMG libraries" , "kinetics" , "reactions.py" ), mode = 'r' ) as f :
104+ base_path = os .path .join (ARC_PATH , "functional" , "test" , "kinetic" , "calcs" , "statmech" )
105+ self .assertTrue (os .path .isfile (os .path .join (base_path , "thermo" , "input.py" )))
106+ self .assertTrue (os .path .isfile (os .path .join (base_path , "kinetics" , "input.py" )))
107+ self .assertTrue (os .path .isfile (os .path .join (base_path , "kinetics" , "species" , "iC3H7.py" )))
108+ self .assertTrue (os .path .isfile (os .path .join (base_path , "kinetics" , "species" , "nC3H7.py" )))
109+ self .assertTrue (os .path .isfile (os .path .join (base_path , "kinetics" , "TSs" , "TS0.py" )))
110+ species , thermo , kinetics , ts = 0 , 0 , 0 , 0
111+ with open (file = os .path .join (base_path , "kinetics" , "input.py" ), mode = 'r' ) as f :
106112 for line in f .readlines ():
107- if "Arrhenius" in line :
108- has_content = True
109- break
110- self .assertTrue (has_content )
111-
113+ if "species('" in line :
114+ species += 1
115+ elif "thermo('" in line :
116+ thermo += 1
117+ elif "kinetics(label='" in line :
118+ kinetics += 1
119+ elif "transitionState" in line :
120+ ts += 1
121+ self .assertEqual (species , 2 )
122+ self .assertEqual (thermo , 0 )
123+ self .assertEqual (kinetics , 1 )
124+ self .assertEqual (ts , 2 )
125+
112126 @classmethod
113127 def tearDownClass (cls ):
114128 """
0 commit comments