From: <bao...@us...> - 2006-05-22 13:06:58
|
Revision: 143 Author: baoilleach Date: 2006-05-22 06:06:52 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=143&view=rev Log Message: ----------- Added test for atomcoords in SP calcs, and bug fixed gamessparser which was only extracting x and y, and furthermore was making a list, not an array Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py trunk/test/testSP.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-22 10:43:56 UTC (rev 142) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-22 13:06:52 UTC (rev 143) @@ -167,7 +167,7 @@ line = inputfile.next() while line.strip(): temp = line.strip().split() - atomcoords.append([utils.convertor(float(x),"au","Ang") for x in temp[2:4]]) + atomcoords.append([utils.convertor(float(x),"au","Ang") for x in temp[2:5]]) atomnos.append(self.table.number[temp[0]]) # Use the element name line = inputfile.next() self.atomnos = Numeric.array(atomnos,"i") @@ -191,7 +191,7 @@ line = inputfile.next() while line.strip(): temp = line.strip().split() - atomcoords.append(map(float,temp[2:4])) + atomcoords.append(map(float,temp[2:5])) line = inputfile.next() self.atomcoords.append(atomcoords) @@ -438,6 +438,8 @@ if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") + if hasattr(self,"atomcoords"): + self.atomcoords = Numeric.array(self.atomcoords,"f") if not hasattr(self,"nmo"): self.logger.info("Creating attribute nmo with default value") self.nmo = self.nbasis Modified: trunk/test/testSP.py =================================================================== --- trunk/test/testSP.py 2006-05-22 10:43:56 UTC (rev 142) +++ trunk/test/testSP.py 2006-05-22 13:06:52 UTC (rev 143) @@ -9,6 +9,10 @@ """Are the dims of the overlap matrix consistent with nbasis?""" self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + def testatomcoords(self): + """Are the dimensions of atomcoords 1 x natom x 3?""" + self.assertEquals(self.data.atomcoords.shape,(1,self.data.natom,3)) + def testdimmocoeffs(self): """Are the dimensions of mocoeffs equal to 1 x nmo x nbasis?""" self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nmo,self.data.nbasis)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |