From: <bao...@us...> - 2006-05-13 18:48:24
|
Revision: 117 Author: baoilleach Date: 2006-05-13 11:48:19 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=117&view=rev Log Message: ----------- Changed indentation of 2-spaces to 4-spaces. I think we should standardise on 4. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-13 18:45:57 UTC (rev 116) +++ trunk/src/cclib/parser/adfparser.py 2006-05-13 18:48:19 UTC (rev 117) @@ -23,8 +23,7 @@ from logfileparser import Logfile,convertor class ADF(Logfile): - """A Gaussian 98/03 log file""" - #SCFRMS,SCFMAX,SCFENERGY = range(3) # Used to index self.scftargets[] + """An ADF log file""" SCFCNV,SCFCNV2 = range(2) #used to index self.scftargets[] def __init__(self,*args): @@ -132,50 +131,50 @@ if line[1:22]=="S C F U P D A T E S": # find targets for SCF convergence (QM calcs) - if not hasattr(self,"scftargets"): - self.logger.info("Creating attribute scftargets[]") - self.scftargets = Numeric.array([0.0, 0.0],'f') + if not hasattr(self,"scftargets"): + self.logger.info("Creating attribute scftargets[]") + self.scftargets = Numeric.array([0.0, 0.0],'f') + + #underline, blank, nr + for i in range(3): inputfile.next() + + line=inputfile.next() + self.scftargets[ADF.SCFCNV]=float(line.split()[2]) + line=inputfile.next() + self.scftargets[ADF.SCFCNV2]=float(line.split()[2]) - #underline, blank, nr - for i in range(3): inputfile.next() - - line=inputfile.next() - self.scftargets[ADF.SCFCNV]=float(line.split()[2]) - line=inputfile.next() - self.scftargets[ADF.SCFCNV2]=float(line.split()[2]) - if line[1:11]=="CYCLE 1": - if self.progress and random.random() < fupdate: - step=inputfile.tell() - if step!=oldstep: - self.progress.update(step, "QM Convergence") - oldstep=step + if self.progress and random.random() < fupdate: + step=inputfile.tell() + if step!=oldstep: + self.progress.update(step, "QM Convergence") + oldstep=step - if not hasattr(self,"scfvalues"): - self.logger.info("Creating attribute scfvalues") - self.scfvalues = [] + if not hasattr(self,"scfvalues"): + self.logger.info("Creating attribute scfvalues") + self.scfvalues = [] - newlist = [ [] for x in self.scftargets ] - line=inputfile.next() - - while line.find("SCF CONVERGED")==-1: - - if line[1:7]=="d-Pmat": - info=line.split() - newlist[ADF.SCFCNV].append(float(info[2])) + newlist = [ [] for x in self.scftargets ] + line=inputfile.next() + + while line.find("SCF CONVERGED")==-1: + + if line[1:7]=="d-Pmat": + info=line.split() + newlist[ADF.SCFCNV].append(float(info[2])) - line=inputfile.next() - info=line.split() - newlist[ADF.SCFCNV2].append(float(info[2])) + line=inputfile.next() + info=line.split() + newlist[ADF.SCFCNV2].append(float(info[2])) + + try: + line=inputfile.next() + except StopIteration: #EOF reached? + break + + self.scfvalues.append(newlist) - try: - line=inputfile.next() - except StopIteration: #EOF reached? - break - - self.scfvalues.append(newlist) - # if line[1:10]=='Cycle 1': # # Extract SCF convergence information (QM calcs) # if self.progress and random.random()<fupdate: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |