@@ -63,9 +63,7 @@ def run(self):
6363 # submits the input file to mopac
6464 process = Popen ([self .executablePath , self .inputFilePath ])
6565 process .communicate ()# necessary to wait for executable termination!
66- #Wait for OS to flush the buffer to disk. There should be a better way
67- # import time
68- # time.sleep(1)
66+
6967 return self .verifyOutputFile ()
7068
7169 def verifyOutputFile (self ):
@@ -88,7 +86,7 @@ def verifyOutputFile(self):
8886 if not os .path .exists (self .outputFilePath ):
8987 logging .debug ("Output file {0} does not (yet) exist." .format (self .outputFilePath ))
9088 return False
91-
89+
9290 InChIMatch = False #flag (1 or 0) indicating whether the InChI in the file matches InChIaug this can only be 1 if InChIFound is also 1
9391 InChIFound = False #flag (1 or 0) indicating whether an InChI was found in the log file
9492
@@ -195,31 +193,6 @@ def inputFileKeywords(self, attempt):
195193 """
196194 raise NotImplementedError ("Should be defined by subclass, eg. MopacMolPM3" )
197195
198- def generateQMData (self ):
199- """
200- Calculate the QM data and return a QMData object, or None if it fails.
201- """
202- if self .verifyOutputFile ():
203- logging .info ("Found a successful output file already; using that." )
204- source = "QM MOPAC result file found from previous run."
205- else :
206- self .createGeometry ()
207- success = False
208- for attempt in range (1 , self .maxAttempts + 1 ):
209- self .writeInputFile (attempt )
210- logging .info ('Trying {3} attempt {0} of {1} on molecule {2}.' .format (attempt , self .maxAttempts , self .molecule .toSMILES (), self .__class__ .__name__ ))
211- success = self .run ()
212- if success :
213- source = "QM {0} calculation attempt {1}" .format (self .__class__ .__name__ , attempt )
214- break
215- else :
216- logging .error ('QM thermo calculation failed for {0}.' .format (self .molecule .toAugmentedInChI ()))
217- return None
218- result = self .parse () # parsed in cclib
219- result .source = source
220- return result # a CCLibData object
221-
222-
223196class MopacMolPM3 (MopacMol ):
224197
225198 #: Keywords that will be added at the top and bottom of the qm input file
@@ -368,4 +341,4 @@ def inputFileKeywords(self, attempt):
368341 multiplicity_keys ,
369342 )
370343
371- return top_keys , bottom_keys , polar_keys
344+ return top_keys , bottom_keys , polar_keys
0 commit comments