From: <bao...@us...> - 2006-05-24 19:43:47
|
Revision: 157 Author: baoilleach Date: 2006-05-24 12:43:41 -0700 (Wed, 24 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=157&view=rev Log Message: ----------- homos parsed correctly for both restricted and unrestricted calculations. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-24 19:16:00 UTC (rev 156) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-24 19:43:41 UTC (rev 157) @@ -379,9 +379,22 @@ if line.find("NUMBER OF OCCUPIED ORBITALS")>=0: if not hasattr(self,"homos"): self.logger.info("Creating attribute homos") - temp = line.strip().split('=') - self.homos = Numeric.array([int(temp[-1])-1],"i") + homos = [int(line.split()[-1])-1] + line = inputfile.next() + homos.append(int(line.split()[-1])-1) + # Note that we cannot trust this self.homos until we come to + # a line that contains the phrase: + # "SYMMETRIES FOR INITAL GUESS ORBITALS FOLLOW" + # which either is followed by "ALPHA" or "BOTH" + # at which point we can say for certain that it is an + # un/restricted calculations + self.homos = Numeric.array(homos,"i") + if line.find("SYMMETRIES FOR INITIAL GUESS ORBITALS FOLLOW")>=0: + # Not unrestricted, so lop off the second index + if line.find("BOTH SET(S)")>=0: + self.homos = Numeric.resize(self.homos,[1]) + if line.find("TOTAL NUMBER OF ATOMS")==1: self.logger.info("Creating attribute natom") self.natom = int(line.split()[-1]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |