This list is closed, nobody may subscribe to it.
2006 |
Jan
|
Feb
|
Mar
(34) |
Apr
(46) |
May
(61) |
Jun
(32) |
Jul
(37) |
Aug
(55) |
Sep
(25) |
Oct
(44) |
Nov
(28) |
Dec
(23) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(27) |
Feb
(71) |
Mar
(55) |
Apr
(10) |
May
(18) |
Jun
(32) |
Jul
(36) |
Aug
(33) |
Sep
(25) |
Oct
(21) |
Nov
(22) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(9) |
Jul
(10) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(6) |
Mar
|
Apr
(5) |
May
|
Jun
(1) |
Jul
(17) |
Aug
|
Sep
(1) |
Oct
(10) |
Nov
(2) |
Dec
|
2010 |
Jan
(2) |
Feb
(6) |
Mar
(7) |
Apr
(14) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(5) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
(6) |
Feb
|
Mar
(10) |
Apr
(9) |
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(11) |
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
(18) |
Nov
(22) |
Dec
(6) |
2013 |
Jan
|
Feb
(21) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(4) |
Oct
(1) |
Nov
(11) |
Dec
(4) |
From: <bao...@us...> - 2006-05-17 17:13:53
|
Revision: 123 Author: baoilleach Date: 2006-05-17 09:56:45 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=123&view=rev Log Message: ----------- Completed parsing of atomcoords...still passes tests, although I haven't checked the output to see if it makes sense. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py trunk/src/cclib/parser/logfileparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:27:40 UTC (rev 122) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:56:45 UTC (rev 123) @@ -73,7 +73,7 @@ oldstep=0 - endofopt = False + firststdorient = True # Used to decide whether to wipe the atomcoords clean for line in inputfile: @@ -136,7 +136,7 @@ line = inputfile.next() while line.strip(): temp = line.strip().split() - atomcoords.append(map(float,temp[2:4])) + atomcoords.append([convertor(float(x),"au","Ang") for x in temp[2:4]]) atomnos.append(self.pt.number[temp[0]]) # Use the element name line = inputfile.next() self.atomnos = Numeric.array(atomnos,"i") @@ -145,7 +145,22 @@ if line[1:37]=="COORDINATES OF ALL ATOMS ARE": # This is the standard orientation, which is the only coordinate # information available for all geometry optimisation cycles. - pass + # The input orientation will be overwritten if this is a geometry optimisation + # We assume that a previous Input Orientation has been found and + # used to extract the atomnos + if firststdorient: + firststdorient = False + # Wipes out the single input coordinate at the start of the file + self.atomcoords = [] + + line = inputfile.next() + hyphens = inputfile.next() + atomcoords = [] + while line.strip(): + temp = line.strip().split() + atomcoords.append(map(float,temp[2:4])) + line = inputfile.next() + self.atomcoords.append(atomcoords) if line.find("ITER EX DEM")==1: # This is the section with the SCF information Modified: trunk/src/cclib/parser/logfileparser.py =================================================================== --- trunk/src/cclib/parser/logfileparser.py 2006-05-17 16:27:40 UTC (rev 122) +++ trunk/src/cclib/parser/logfileparser.py 2006-05-17 16:56:45 UTC (rev 123) @@ -29,7 +29,8 @@ _convertor = {"eV_to_cm-1": lambda x: x*8065.6, "hartree_to_eV": lambda x: x*27.2114, "nm_to_cm-1": lambda x: 1e7/x, - "cm-1_to_nm": lambda x: 1e7/x} + "cm-1_to_nm": lambda x: 1e7/x, + "au_to_Ang": lambda x: x*0.529177} return _convertor["%s_to_%s" % (fromunits,tounits)] (value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-17 16:27:44
|
Revision: 122 Author: baoilleach Date: 2006-05-17 09:27:40 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=122&view=rev Log Message: ----------- Now parses aonames (not normalised to Gaussian though), and started work on parsing atomnos and atomcoords Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:22:09 UTC (rev 121) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-17 16:27:40 UTC (rev 122) @@ -20,7 +20,7 @@ import re,time import Numeric import random # For sometimes running the progress updater -from logfileparser import Logfile,convertor +from logfileparser import Logfile,convertor,PeriodicTable class GAMESS(Logfile): """A GAMESS log file.""" @@ -29,6 +29,8 @@ # Call the __init__ method of the superclass super(GAMESS, self).__init__(logname="GAMESS",*args) + + self.pt = PeriodicTable() def __str__(self): """Return a string representation of the object.""" @@ -120,6 +122,31 @@ self.logger.info("Creating attribute scftargets") self.scftargets = Numeric.array([float(line.strip().split()[-1])]) + if line[11:50]=="ATOMIC COORDINATES": + # This is the input orientation, which is the only data available for + # SP calcs, but which should be overwritten by the standard orientation + # values, which is the only information available for all geoopt cycles. + if not hasattr(self,"atomcoords"): + self.logger.info("Creating attribute atomcoords, atomnos") + self.atomcoords = [] + self.atomnos = [] + line = inputfile.next() + atomcoords = [] + atomnos = [] + line = inputfile.next() + while line.strip(): + temp = line.strip().split() + atomcoords.append(map(float,temp[2:4])) + atomnos.append(self.pt.number[temp[0]]) # Use the element name + line = inputfile.next() + self.atomnos = Numeric.array(atomnos,"i") + self.atomcoords.append(atomcoords) + + if line[1:37]=="COORDINATES OF ALL ATOMS ARE": + # This is the standard orientation, which is the only coordinate + # information available for all geometry optimisation cycles. + pass + if line.find("ITER EX DEM")==1: # This is the section with the SCF information if not hasattr(self,"scfvalues"): @@ -322,8 +349,9 @@ # The first is for PC-GAMESS, the second for GAMESS # Read 1-electron overlap matrix if not hasattr(self,"aooverlaps"): - self.logger.info("Creating attribute aooverlaps") + self.logger.info("Creating attribute aooverlaps, aonames") self.aooverlaps = Numeric.zeros((self.nbasis,self.nbasis), "f") + self.aonames = [] else: self.logger.info("Reading additional aooverlaps...") base = 0 @@ -334,10 +362,12 @@ for i in range(self.nbasis-base): # Fewer lines each time line = inputfile.next() temp = line.split() + if base==0: # Only do this for the first block + self.aonames.append("%s%s_%s" % (temp[1],temp[2],temp[3])) for j in range(4,len(temp)): self.aooverlaps[base+j-4,i+base] = float(temp[j]) self.aooverlaps[i+base,base+j-4] = float(temp[j]) - base+=5 + base += 5 inputfile.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-17 16:22:22
|
Revision: 121 Author: baoilleach Date: 2006-05-17 09:22:09 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=121&view=rev Log Message: ----------- Fixed bug when creating the Numeric array for atomnos. Modified Paths: -------------- trunk/src/cclib/parser/g03parser.py Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-16 18:21:53 UTC (rev 120) +++ trunk/src/cclib/parser/g03parser.py 2006-05-17 16:22:09 UTC (rev 121) @@ -121,7 +121,7 @@ line = inputfile.next() self.atomcoords.append(atomcoords) if not hasattr(self,"natom"): - self.atomnos = Numeric.array(atomnos,'f') + self.atomnos = Numeric.array(atomnos,'i') self.logger.info("Creating attribute atomnos[]") self.natom = len(self.atomnos) self.logger.info("Creating attribute natom: %d" % self.natom) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-16 18:21:59
|
Revision: 120 Author: atenderholt Date: 2006-05-16 11:21:53 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=120&view=rev Log Message: ----------- Changed nindep to nmo. Gaussian and GAMESS pass the unittests. SCF stuff is still broken in ADF, and Jaguar is very incomplete. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py trunk/src/cclib/parser/g03parser.py trunk/src/cclib/parser/gamessparser.py trunk/src/cclib/parser/logfileparser.py trunk/test/testSP.py trunk/test/testSPun.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/src/cclib/parser/adfparser.py 2006-05-16 18:21:53 UTC (rev 120) @@ -472,16 +472,16 @@ # # if line[1:7]=="NBsUse": # # Extract the number of linearly-independent basis sets -# nindep = int(line.split('=')[1].split()[0]) -# if hasattr(self,"nindep"): -# assert nindep==self.nindep +# nmo = int(line.split('=')[1].split()[0]) +# if hasattr(self,"nmo"): +# assert nmo==self.nmo # else: -# self.nindep = nindep -# self.logger.info("Creating attribute nindep: %d" % self.nindep) +# self.nmo = nmo +# self.logger.info("Creating attribute nmo: %d" % self.nmo) # # if line[7:22]=="basis functions,": # # For AM1 calculations, set nbasis by a second method -# # (nindep may not always be explicitly stated) +# # (nmo may not always be explicitly stated) # nbasis = int(line.split()[0]) # if hasattr(self,"nbasis"): # assert nbasis==self.nbasis @@ -609,15 +609,15 @@ # if line[5:40]=="Beta Molecular Orbital Coefficients": # beta = True # # Need to add an extra dimension to self.mocoeffs -# self.mocoeffs = Numeric.resize(self.mocoeffs,(2,nindep,nbasis)) +# self.mocoeffs = Numeric.resize(self.mocoeffs,(2,nmo,nbasis)) # else: # beta = False # self.logger.info("Creating attributes aonames[], mocoeffs[][]") # self.aonames = [] -# self.mocoeffs = Numeric.zeros((1,nindep,nbasis),"float") +# self.mocoeffs = Numeric.zeros((1,nmo,nbasis),"float") # # base = 0 -# for base in range(0,nindep,5): +# for base in range(0,nmo,5): # # if self.progress: # step=inputfile.tell() @@ -656,7 +656,7 @@ if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] self.parsed = True - if hasattr(self,"moenergies"): self.nindep = len(self.moenergies[0]) + if hasattr(self,"moenergies"): self.nmo = len(self.moenergies[0]) Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/src/cclib/parser/g03parser.py 2006-05-16 18:21:53 UTC (rev 120) @@ -445,16 +445,16 @@ if line[1:7]=="NBsUse": # Extract the number of linearly-independent basis sets - nindep = int(line.split('=')[1].split()[0]) - if hasattr(self,"nindep"): - assert nindep==self.nindep + nmo = int(line.split('=')[1].split()[0]) + if hasattr(self,"nmo"): + assert nmo==self.nmo else: - self.nindep = nindep - self.logger.info("Creating attribute nindep: %d" % self.nindep) + self.nmo = nmo + self.logger.info("Creating attribute nmo: %d" % self.nmo) if line[7:22]=="basis functions,": # For AM1 calculations, set nbasis by a second method -# (nindep may not always be explicitly stated) +# (nmo may not always be explicitly stated) nbasis = int(line.split()[0]) if hasattr(self,"nbasis"): assert nbasis==self.nbasis @@ -497,15 +497,15 @@ if line[5:40]=="Beta Molecular Orbital Coefficients": beta = True # Need to add an extra dimension to self.mocoeffs - self.mocoeffs = Numeric.resize(self.mocoeffs,(2,nindep,nbasis)) + self.mocoeffs = Numeric.resize(self.mocoeffs,(2,nmo,nbasis)) else: beta = False self.logger.info("Creating attributes aonames[], mocoeffs[][]") self.aonames = [] - self.mocoeffs = Numeric.zeros((1,nindep,nbasis),"float") + self.mocoeffs = Numeric.zeros((1,nmo,nbasis),"float") base = 0 - for base in range(0,nindep,5): + for base in range(0,nmo,5): if self.progress: step=inputfile.tell() Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-16 18:21:53 UTC (rev 120) @@ -236,12 +236,12 @@ self.logger.info("Creating attributes moenergies, mosyms") self.moenergies = [[]] self.mosyms = [[]] - if not hasattr(self,"nindep"): - self.logger.info("Creating attribute nindep with default value") - self.nindep = self.nbasis - self.mocoeffs = Numeric.zeros((1,self.nindep,self.nbasis),"f") + if not hasattr(self,"nmo"): + self.logger.info("Creating attribute nmo with default value") + self.nmo = self.nbasis + self.mocoeffs = Numeric.zeros((1,self.nmo,self.nbasis),"f") line = inputfile.next() - for base in range(0,self.nindep,5): + for base in range(0,self.nmo,5): blank = inputfile.next() line = inputfile.next() # Eigenvector no line = inputfile.next() @@ -273,12 +273,12 @@ # # 1 2 3 4 5 - self.mocoeffs.resize((2,self.nindep,self.nbasis)) + self.mocoeffs.resize((2,self.nmo,self.nbasis)) self.moenergies.append([]) self.mosyms.append([]) for i in range(5): line = inputfile.next() - for base in range(0,self.nindep,5): + for base in range(0,self.nmo,5): blank = inputfile.next() line = inputfile.next() # Eigenvector no line = inputfile.next() @@ -315,7 +315,7 @@ elif line.find("TOTAL NUMBER OF MOS IN VARIATION SPACE")==1: # Note that this line is not always present, so by default # NBsUse is set equal to NBasis (see below). - self.logger.info("Creating attribute nindep") + self.logger.info("Creating attribute nmo") self.indep = int(line.split()[-1]) elif line.find("OVERLAP MATRIX")==0 or line.find("OVERLAP MATRIX")==1: @@ -351,9 +351,9 @@ 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 not hasattr(self,"nindep"): - self.logger.info("Creating attribute nindep with default value") - self.nindep = self.nbasis + if not hasattr(self,"nmo"): + self.logger.info("Creating attribute nmo with default value") + self.nmo = self.nbasis self.parsed = True Modified: trunk/src/cclib/parser/logfileparser.py =================================================================== --- trunk/src/cclib/parser/logfileparser.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/src/cclib/parser/logfileparser.py 2006-05-16 18:21:53 UTC (rev 120) @@ -72,7 +72,7 @@ mosyms -- orbital symmetries (list[2]) natom -- number of atoms (integer) nbasis -- number of basis functions (integer) - nindep -- number of linearly-independent basis functions (integer) + nmo -- number of linearly-independent basis functions (integer) scfenergies -- the electronic energy of the molecule (array[1], a.u.) scftargets -- targets for convergence of the SCF (array[1]) scfvalues -- current values for convergence of the SCF (array[2], same units as scftargets) Modified: trunk/test/testSP.py =================================================================== --- trunk/test/testSP.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/test/testSP.py 2006-05-16 18:21:53 UTC (rev 120) @@ -10,8 +10,8 @@ self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) def testdimmocoeffs(self): - """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" - self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nindep,self.data.nbasis)) + """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)) class GaussianSPTest(GenericSPTest): def setUp(self): Modified: trunk/test/testSPun.py =================================================================== --- trunk/test/testSPun.py 2006-05-16 17:01:46 UTC (rev 119) +++ trunk/test/testSPun.py 2006-05-16 18:21:53 UTC (rev 120) @@ -10,8 +10,8 @@ self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) def testdimmocoeffs(self): - """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" - self.assertEquals(self.data.mocoeffs.shape,(2,self.data.nindep,self.data.nbasis)) + """Are the dimensions of mocoeffs equal to 1 x nmo x nbasis?""" + self.assertEquals(self.data.mocoeffs.shape,(2,self.data.nmo,self.data.nbasis)) def testhomos(self): """What are the homos?""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-16 17:02:41
|
Revision: 119 Author: baoilleach Date: 2006-05-16 10:01:46 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=119&view=rev Log Message: ----------- Added atomcoords which stores the input orientation at all stages of a geometry optimisation. Needed to add a flag to indicate when the GeoOpt was over to avoid extracting the final geometry twice. Modified Paths: -------------- trunk/src/cclib/parser/g03parser.py Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-13 21:05:51 UTC (rev 118) +++ trunk/src/cclib/parser/g03parser.py 2006-05-16 17:01:46 UTC (rev 119) @@ -64,6 +64,8 @@ self.progress.initialize(nstep) oldstep=0 + optfinished = False # Flag that indicates whether it has reached the end of a geoopt + for line in inputfile: if self.progress and random.random()<cupdate: @@ -89,30 +91,39 @@ self.natom = natom self.logger.info("Creating attribute natom: %d" % self.natom) - if not hasattr(self,"atomnos") and (line.find("Z-Matrix orientation")>=0 - or line[25:45]=="Standard orientation" - or line[26:43]=="Input orientation"): -# Extract the atomic numbers of the atoms + if line[1:23]=="Optimization completed": + optfinished = True + + if not optfinished and line[26:43]=="Input orientation": +# Extract the atomic numbers and coordinates of the atoms if self.progress and random.random()<cupdate: step = inputfile.tell() if step!=oldstep: self.progress.update(step,"Attributes") oldstep=step - self.logger.info("Creating attribute atomnos[]") - self.atomnos = [] + if not hasattr(self,"atomcoords"): + self.logger.info("Creating attribute atomcoords[]") + self.atomcoords = [] + hyphens = inputfile.next() - colmNames = inputfile.next(); colmNames = inputfile.next() + colmNames = inputfile.next() + colmNames = inputfile.next() hyphens = inputfile.next() + + atomnos = [] + atomcoords = [] line = inputfile.next() while line!=hyphens: - self.atomnos.append(int(line.split()[1])) + broken = line.split() + atomnos.append(int(broken[1])) + atomcoords.append(map(float,broken[3:6])) line = inputfile.next() - natom = len(self.atomnos) - if hasattr(self,"natom"): - assert self.natom==natom - else: - self.natom = natom + self.atomcoords.append(atomcoords) + if not hasattr(self,"natom"): + self.atomnos = Numeric.array(atomnos,'f') + self.logger.info("Creating attribute atomnos[]") + self.natom = len(self.atomnos) self.logger.info("Creating attribute natom: %d" % self.natom) if line[1:44]=='Requested convergence on RMS density matrix': @@ -534,6 +545,7 @@ if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] + if hasattr(self,"atomcoords"): self.atomcoords = Numeric.array(self.atomcoords,"f") self.parsed = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-13 21:06:04
|
Revision: 118 Author: baoilleach Date: 2006-05-13 14:05:51 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=118&view=rev Log Message: ----------- Based on the new dvb_gopt_b.adfout I've corrected the adfparser, but the results are still strange and I'm planning to post a question to the ADF users' forum. Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py trunk/test/testGeoOpt.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-13 18:48:19 UTC (rev 117) +++ trunk/src/cclib/parser/adfparser.py 2006-05-13 21:05:51 UTC (rev 118) @@ -25,6 +25,7 @@ class ADF(Logfile): """An ADF log file""" SCFCNV,SCFCNV2 = range(2) #used to index self.scftargets[] + maxelem,norm = range(2) # used to index scf.values def __init__(self,*args): # Call the __init__ method of the superclass @@ -139,9 +140,8 @@ 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]) + self.scftargets[ADF.maxelem] = float(line.split()[2]) + self.scftargets[ADF.norm] = self.scftargets[ADF.maxelem]*10 if line[1:11]=="CYCLE 1": @@ -151,29 +151,24 @@ self.progress.update(step, "QM Convergence") oldstep=step - if not hasattr(self,"scfvalues"): - self.logger.info("Creating attribute scfvalues") - self.scfvalues = [] - - newlist = [ [] for x in self.scftargets ] + newlist = [] line=inputfile.next() while line.find("SCF CONVERGED")==-1: + if line[4:12]=="SCF test": + if not hasattr(self,"scfvalues"): + self.logger.info("Creating attribute scfvalues") + self.scfvalues = [] + + info = line.split() + newlist.append([float(info[4]),abs(float(info[6]))]) + try: + line=inputfile.next() + except StopIteration: #EOF reached? + break - 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])) - - try: - line=inputfile.next() - except StopIteration: #EOF reached? - break - - self.scfvalues.append(newlist) + if hasattr(self,"scfvalues"): + self.scfvalues.append(newlist) # if line[1:10]=='Cycle 1': # # Extract SCF convergence information (QM calcs) Modified: trunk/test/testGeoOpt.py =================================================================== --- trunk/test/testGeoOpt.py 2006-05-13 18:48:19 UTC (rev 117) +++ trunk/test/testGeoOpt.py 2006-05-13 21:05:51 UTC (rev 118) @@ -55,7 +55,7 @@ class ADFGeoOptTest(GenericGeoOptTest): def setUp(self): - self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") + self.data = getfile(ADF,"basicADF2004.01","dvb_gopt_b.adfout") def testscfvaluedim(self): """Do the scf values have the right dimensions? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <bao...@us...> - 2006-05-13 18:46:09
|
Revision: 116 Author: baoilleach Date: 2006-05-13 11:45:57 -0700 (Sat, 13 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=116&view=rev Log Message: ----------- Changed so it doesn't import qtprogress if Qt is not installed. Modified Paths: -------------- trunk/src/cclib/progress/__init__.py Modified: trunk/src/cclib/progress/__init__.py =================================================================== --- trunk/src/cclib/progress/__init__.py 2006-05-12 23:50:23 UTC (rev 115) +++ trunk/src/cclib/progress/__init__.py 2006-05-13 18:45:57 UTC (rev 116) @@ -1,2 +1,7 @@ from textprogress import TextProgress -from qtprogress import QtProgress +try: + import qt +except ImportError: + pass # import QtProgress will cause an error +else: + from qtprogress import QtProgress This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-12 23:50:24
|
Revision: 115 Author: atenderholt Date: 2006-05-12 16:50:23 -0700 (Fri, 12 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=115&view=rev Log Message: ----------- Made nindep in the ADF parser equal to the length of moenergies[0] Modified Paths: -------------- trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-12 09:12:05 UTC (rev 114) +++ trunk/src/cclib/parser/adfparser.py 2006-05-12 23:50:23 UTC (rev 115) @@ -662,6 +662,7 @@ if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] self.parsed = True + if hasattr(self,"moenergies"): self.nindep = len(self.moenergies[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-11 23:55:45
|
Revision: 113 Author: atenderholt Date: 2006-05-11 16:55:35 -0700 (Thu, 11 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=113&view=rev Log Message: ----------- More work on the Mulliken and C-sqared PAs Modified Paths: -------------- trunk/src/cclib/method/__init__.py trunk/src/cclib/method/cspa.py Added Paths: ----------- trunk/src/cclib/method/mpa.py Modified: trunk/src/cclib/method/__init__.py =================================================================== --- trunk/src/cclib/method/__init__.py 2006-05-11 00:52:59 UTC (rev 112) +++ trunk/src/cclib/method/__init__.py 2006-05-11 23:55:35 UTC (rev 113) @@ -1,2 +1,3 @@ from density import Density from cspa import CSPA +from mpa import MPA Modified: trunk/src/cclib/method/cspa.py =================================================================== --- trunk/src/cclib/method/cspa.py 2006-05-11 00:52:59 UTC (rev 112) +++ trunk/src/cclib/method/cspa.py 2006-05-11 23:55:35 UTC (rev 113) @@ -31,7 +31,7 @@ def __str__(self): """Return a string representation of the object.""" - return "Density matrix of" % (self.parser) + return "CSPA of" % (self.parser) def __repr__(self): """Return a representation of the object.""" @@ -84,6 +84,75 @@ if self.progress: self.progress.update(nstep,"Done") +#build list of groups of orbitals in each atom for atomresults + if hasattr(self.parser,"aonames"): + names=self.parser.aonames + elif hasattr(self.parser,"foonames"): + names=self.parser.fonames + + atoms=[] + indices=[] + + name=names[0].split('_')[0] + atoms.append(name) + indices.append([0]) + + for i in range(1,len(names)): + name=names[i].split('_')[0] + if name==atoms[-1]: + indices[-1].append(i) + else: + atoms.append(name) + indices.append([i]) + + self.logger.info("Creating atomresults: array[3]") + self.atomresults=self.partition(indices) + +#create array for mulliken charges + self.logger.info("Creating atomcharges: array[1]") + size=len(self.atomresults[0][0]) + self.atomcharges=Numeric.zeros([size],"f") + + for spin in range(len(self.atomresults)): + + for i in range(self.parser.homos[spin]+1): + + temp=Numeric.reshape(self.atomresults[spin][i],(size,)) + self.atomcharges=Numeric.add(self.atomcharges,temp) + + if not unrestricted: + self.atomcharges=Numeric.multiply(self.atomcharges,2) + + + return True + + def partition(self,indices): + + if not hasattr(self,"aoresults"): + self.calculate() + + natoms=len(indices) + nmocoeffs=len(self.aoresults[0]) + +#build results Numeric array[3] + if len(self.aoresults)==2: + results=Numeric.zeros([2,nmocoeffs,natoms],"f") + else: + results=Numeric.zeros([1,nmocoeffs,natoms],"f") + +#for each spin, splice Numeric array at ao index, and add to correct result row + for spin in range(len(results)): + + for i in range(natoms): #number of groups + + for j in range(len(indices[i])): #for each group + + temp=self.aoresults[spin,:,indices[i][j]] + results[spin,:,i]=Numeric.add(results[spin,:,i],temp) + + return results + + if __name__=="__main__": - import doctest,g03parser - doctest.testmod(g03parser,verbose=False) + import doctest,cspa + doctest.testmod(cspa,verbose=False) Added: trunk/src/cclib/method/mpa.py =================================================================== --- trunk/src/cclib/method/mpa.py (rev 0) +++ trunk/src/cclib/method/mpa.py 2006-05-11 23:55:35 UTC (rev 113) @@ -0,0 +1,167 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import re,time +import Numeric +import random # For sometimes running the progress updater +from calculationmethod import Method + +class MPA(Method): + """The Mulliken population analysis""" + def __init__(self,*args): + + # Call the __init__ method of the superclass + super(MPA, self).__init__(logname="MPA",*args) + + def __str__(self): + """Return a string representation of the object.""" + return "MPA of" % (self.parser) + + def __repr__(self): + """Return a representation of the object.""" + return 'MPA("%s")' % (self.parser) + + def calculate(self,fupdate=0.05): + """Perform a Mulliken population analysis given the results of a parser""" + + if not self.parser.parsed: + self.parser.parse() + + #do we have the needed info in the parser? + if not hasattr(self.parser,"mocoeffs") \ + and not ( hasattr(self.parser,"aooverlaps") \ + or hasattr(self.parser, "fooverlaps") ) \ + and not hasattr(self.parser,"nbasis"): + self.logger.error("Missing mocoeffs, aooverlaps/fooverlaps or nbasis") + return False #let the caller of function know we didn't finish + + unrestricted=(len(self.parser.mocoeffs)==2) + nmocoeffs=len(self.parser.mocoeffs[0]) + nbasis=self.parser.nbasis + + #determine number of steps, and whether process involves beta orbitals + nstep=nmocoeffs + self.logger.info("Creating attribute aoresults: array[3]") + if unrestricted: + self.aoresults=Numeric.zeros([2,nmocoeffs,nbasis],"f") + nstep+=nmocoeffs + else: + self.aoresults=Numeric.zeros([1,nmocoeffs,nbasis],"f") + + #intialize progress if available + if self.progress: + self.progress.initialize(nstep) + + step=0 + for spin in range(len(self.parser.mocoeffs)): + + for i in range(nmocoeffs): + + if self.progress and random.random()<fupdate: + self.progress.update(step,"Mulliken Population Analysis") + + #X_{ai} = \sum_b c_{ai} c_{bi} S_{ab} + # = c_{ai} \sum_b c_{bi} S_{ab} + # = c_{ai} C(i) \cdot S(a) + # X = C(i) * [C(i) \cdot S] + # C(i) is 1xn and S is nxn, result of matrix mult is 1xn + + ci = self.parser.mocoeffs[spin][i] + if hasattr(self.parser,"aooverlaps"): + temp = Numeric.matrixmultiply(ci,self.parser.aooverlaps) + elif hasattr(self.parser,"fooverlaps"): + temp = Numeric.matrixmultiply(ci,self.parser.fooverlaps) + + self.aoresults[spin][i]=Numeric.multiply(ci,temp) + + step+=1 + + if self.progress: + self.progress.update(nstep,"Done") + +#build list of groups of orbitals in each atom for atomresults + if hasattr(self.parser,"aonames"): + names=self.parser.aonames + elif hasattr(self.parser,"foonames"): + names=self.parser.fonames + + atoms=[] + indices=[] + + name=names[0].split('_')[0] + atoms.append(name) + indices.append([0]) + + for i in range(1,len(names)): + name=names[i].split('_')[0] + if name==atoms[-1]: + indices[-1].append(i) + else: + atoms.append(name) + indices.append([i]) + + self.logger.info("Creating atomresults: array[3]") + self.atomresults=self.partition(indices) + +#create array for mulliken charges + self.logger.info("Creating atomcharges: array[1]") + size=len(self.atomresults[0][0]) + self.atomcharges=Numeric.zeros([size],"f") + + for spin in range(len(self.atomresults)): + + for i in range(self.parser.homos[spin]+1): + + temp=Numeric.reshape(self.atomresults[spin][i],(size,)) + self.atomcharges=Numeric.add(self.atomcharges,temp) + + if not unrestricted: + self.atomcharges=Numeric.multiply(self.atomcharges,2) + + return True + + def partition(self,indices): + + if not hasattr(self,"aoresults"): + self.calculate() + + natoms=len(indices) + nmocoeffs=len(self.aoresults[0]) + +#build results Numeric array[3] + if len(self.aoresults)==2: + results=Numeric.zeros([2,nmocoeffs,natoms],"f") + else: + results=Numeric.zeros([1,nmocoeffs,natoms],"f") + +#for each spin, splice Numeric array at ao index, and add to correct result row + for spin in range(len(results)): + + for i in range(natoms): #number of groups + + for j in range(len(indices[i])): #for each group + + temp=self.aoresults[spin,:,indices[i][j]] + results[spin,:,i]=Numeric.add(results[spin,:,i],temp) + + return results + +if __name__=="__main__": + import doctest,mpa + doctest.testmod(mpa,verbose=False) Property changes on: trunk/src/cclib/method/mpa.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-11 00:53:02
|
Revision: 112 Author: atenderholt Date: 2006-05-10 17:52:59 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=112&view=rev Log Message: ----------- Started CSPA method, still need atomresults and other possibilities Modified Paths: -------------- trunk/src/cclib/method/__init__.py Added Paths: ----------- trunk/src/cclib/method/cspa.py Modified: trunk/src/cclib/method/__init__.py =================================================================== --- trunk/src/cclib/method/__init__.py 2006-05-10 23:28:49 UTC (rev 111) +++ trunk/src/cclib/method/__init__.py 2006-05-11 00:52:59 UTC (rev 112) @@ -1 +1,2 @@ from density import Density +from cspa import CSPA Added: trunk/src/cclib/method/cspa.py =================================================================== --- trunk/src/cclib/method/cspa.py (rev 0) +++ trunk/src/cclib/method/cspa.py 2006-05-11 00:52:59 UTC (rev 112) @@ -0,0 +1,89 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import re,time +import Numeric +import random # For sometimes running the progress updater +from calculationmethod import Method + +class CSPA(Method): + """The C-squared population analysis""" + def __init__(self,*args): + + # Call the __init__ method of the superclass + super(CSPA, self).__init__(logname="Density",*args) + + def __str__(self): + """Return a string representation of the object.""" + return "Density matrix of" % (self.parser) + + def __repr__(self): + """Return a representation of the object.""" + return 'CSPA("%s")' % (self.parser) + + def calculate(self,fupdate=0.05): + """Perform a C-squared population analysis given the results of a parser""" + + if not self.parser.parsed: + self.parser.parse() + + #do we have the needed info in the parser? + if not hasattr(self.parser,"mocoeffs") \ + and not hasattr(self.parser,"nbasis"): + self.logger.error("Missing mocoeffs or nbasis") + return False #let the caller of function know we didn't finish + + self.logger.info("Creating attribute aoresults: array[3]") + unrestricted=(len(self.parser.mocoeffs)==2) + nmocoeffs=len(self.parser.mocoeffs[0]) + nbasis=self.parser.nbasis + + #determine number of steps, and whether process involves beta orbitals + nstep=nmocoeffs + if unrestricted: + self.aoresults=Numeric.zeros([2,nmocoeffs,nbasis],"f") + nstep+=nmocoeffs + else: + self.aoresults=Numeric.zeros([1,nmocoeffs,nbasis],"f") + + #intialize progress if available + if self.progress: + self.progress.initialize(nstep) + + step=0 + for spin in range(len(self.parser.mocoeffs)): + + for i in range(nmocoeffs): + + if self.progress and random.random()<fupdate: + self.progress.update(step,"C^2 Population Analysis") + + submocoeffs=self.parser.mocoeffs[spin][i] + scale=Numeric.innerproduct(submocoeffs,submocoeffs) + tempcoeffs=Numeric.multiply(submocoeffs,submocoeffs) + self.aoresults[spin][i]=Numeric.divide(tempcoeffs,scale) + + step+=1 + + if self.progress: + self.progress.update(nstep,"Done") + +if __name__=="__main__": + import doctest,g03parser + doctest.testmod(g03parser,verbose=False) Property changes on: trunk/src/cclib/method/cspa.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 23:28:52
|
Revision: 111 Author: atenderholt Date: 2006-05-10 16:28:49 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=111&view=rev Log Message: ----------- Progress info in density method, and some fix to adfparser Modified Paths: -------------- trunk/src/cclib/method/density.py trunk/src/cclib/parser/adfparser.py Modified: trunk/src/cclib/method/density.py =================================================================== --- trunk/src/cclib/method/density.py 2006-05-10 23:02:55 UTC (rev 110) +++ trunk/src/cclib/method/density.py 2006-05-10 23:28:49 UTC (rev 111) @@ -37,7 +37,7 @@ """Return a representation of the object.""" return 'Density matrix("%s")' % (self.parser) - def calculate(self,fupdate=0.05,cupdate=0.002): + def calculate(self,fupdate=0.05): """Calculate the density matrix given the results of a parser""" if not self.parser.parsed: @@ -45,33 +45,49 @@ #do we have the needed info in the parser? if not hasattr(self.parser,"mocoeffs") \ - and not hasattr(self.parser,"aooverlaps") \ and not hasattr(self.parser,"nbasis") \ and not hasattr(self.parser,"homos"): - self.logger.error("Missing mocoeffs or aooverlaps") + self.logger.error("Missing mocoeffs, nbasis, or homos") return False #let the caller of function know we didn't finish self.logger.info("Creating attribute density: array[3]") size=self.parser.nbasis unrestricted=(len(self.parser.mocoeffs)==2) + #determine number of steps, and whether process involves beta orbitals + nstep=self.parser.homos[0]+1 if unrestricted: self.density=Numeric.zeros([2,size,size],"f") + nstep+=self.parser.homos[1]+1 else: self.density=Numeric.zeros([1,size,size],"f") + #intialize progress if available + if self.progress: + self.progress.initialize(nstep) + + step=0 for spin in range(len(self.parser.mocoeffs)): for i in range(self.parser.homos[spin]+1): + + if self.progress and random.random()<fupdate: + self.progress.update(step,"Density Matrix") + col=Numeric.reshape(self.parser.mocoeffs[spin][i],(size,1)) colt=Numeric.reshape(col,(1,size)) tempdensity=Numeric.matrixmultiply(col,colt) self.density[spin]=Numeric.add(self.density[spin],tempdensity) + step+=1 + if not unrestricted: #multiply by two to account for second electron self.density[0]=Numeric.add(self.density[0],self.density[0]) + if self.progress: + self.progress.update(nstep,"Done") + if __name__=="__main__": import doctest,g03parser doctest.testmod(g03parser,verbose=False) Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-10 23:02:55 UTC (rev 110) +++ trunk/src/cclib/parser/adfparser.py 2006-05-10 23:28:49 UTC (rev 111) @@ -295,6 +295,7 @@ temp=Numeric.array(self.moenergies,"f") self.moenergies=temp + self.homos=Numeric.array(self.homos) if line[1:24]=="List of All Frequencies": # Start of the IR/Raman frequency section This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 23:02:59
|
Revision: 110 Author: atenderholt Date: 2006-05-10 16:02:55 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=110&view=rev Log Message: ----------- Fixed the aooverlap problem in ADF by replacing it with fooverlaps Modified Paths: -------------- trunk/test/testSP.py trunk/test/testSPun.py Modified: trunk/test/testSP.py =================================================================== --- trunk/test/testSP.py 2006-05-10 22:55:56 UTC (rev 109) +++ trunk/test/testSP.py 2006-05-10 23:02:55 UTC (rev 110) @@ -28,6 +28,11 @@ class ADFSPTest(GenericSPTest): def setUp(self): self.data = getfile(ADF,"basicADF2004.01","dvb_sp_b.adfout") + + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + #ADF uses fooverlaps + self.assertEquals(self.data.fooverlaps.shape,(self.data.nbasis,self.data.nbasis)) names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] tests = [ GaussianSPTest, PCGamessSPTest, Modified: trunk/test/testSPun.py =================================================================== --- trunk/test/testSPun.py 2006-05-10 22:55:56 UTC (rev 109) +++ trunk/test/testSPun.py 2006-05-10 23:02:55 UTC (rev 110) @@ -34,6 +34,12 @@ def setUp(self): self.data = getfile(ADF,"basicADF2004.01","dvb_un_sp.adfout") + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + #ADF uses fooverlaps + self.assertEquals(self.data.fooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + + names = [ "Gaussian", "PCGamess", "GAMESS", "ADF" ] tests = [ GaussianSPunTest, PCGamessSPunTest, GamessUSSPunTest, ADFSPunTest ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 22:56:00
|
Revision: 109 Author: atenderholt Date: 2006-05-10 15:55:56 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=109&view=rev Log Message: ----------- Density checks to see if the logfile has been parsed (ie. parser.parsed == True). If not, it parses it. Modified Paths: -------------- trunk/src/cclib/method/density.py trunk/src/cclib/parser/adfparser.py trunk/src/cclib/parser/g03parser.py trunk/src/cclib/parser/gamessparser.py trunk/src/cclib/parser/jaguarparser.py trunk/src/cclib/parser/logfileparser.py Modified: trunk/src/cclib/method/density.py =================================================================== --- trunk/src/cclib/method/density.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/method/density.py 2006-05-10 22:55:56 UTC (rev 109) @@ -40,8 +40,8 @@ def calculate(self,fupdate=0.05,cupdate=0.002): """Calculate the density matrix given the results of a parser""" - #if not self.parser.parsed: - # self.parser.parse() + if not self.parser.parsed: + self.parser.parse() #do we have the needed info in the parser? if not hasattr(self.parser,"mocoeffs") \ Modified: trunk/src/cclib/parser/adfparser.py =================================================================== --- trunk/src/cclib/parser/adfparser.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/parser/adfparser.py 2006-05-10 22:55:56 UTC (rev 109) @@ -660,6 +660,7 @@ if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] + self.parsed = True Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/parser/g03parser.py 2006-05-10 22:55:56 UTC (rev 109) @@ -534,6 +534,7 @@ if hasattr(self,"geovalues"): self.geovalues = Numeric.array(self.geovalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") if hasattr(self,"scfvalues"): self.scfvalues = [Numeric.array(x,"f") for x in self.scfvalues] + self.parsed = True Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/parser/gamessparser.py 2006-05-10 22:55:56 UTC (rev 109) @@ -355,7 +355,9 @@ self.logger.info("Creating attribute nindep with default value") self.nindep = self.nbasis + self.parsed = True + if __name__=="__main__": import doctest,gamessparser Modified: trunk/src/cclib/parser/jaguarparser.py =================================================================== --- trunk/src/cclib/parser/jaguarparser.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/parser/jaguarparser.py 2006-05-10 22:55:56 UTC (rev 109) @@ -166,6 +166,7 @@ ## self.scfvalues = Numeric.array(self.scfvalues,"f") if hasattr(self,"scfenergies"): self.scfenergies = Numeric.array(self.scfenergies,"f") + self.parsed = True if __name__=="__main__": import doctest,g03parser Modified: trunk/src/cclib/parser/logfileparser.py =================================================================== --- trunk/src/cclib/parser/logfileparser.py 2006-05-10 22:20:20 UTC (rev 108) +++ trunk/src/cclib/parser/logfileparser.py 2006-05-10 22:55:56 UTC (rev 109) @@ -93,6 +93,7 @@ """ self.filename = filename self.progress = progress + self.parsed = False self.loglevel = loglevel self.logname = logname self.table = PeriodicTable() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 22:20:21
|
Revision: 108 Author: atenderholt Date: 2006-05-10 15:20:20 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=108&view=rev Log Message: ----------- Hopefully finished up density, more testing is needed. Modified Paths: -------------- trunk/src/cclib/method/density.py Modified: trunk/src/cclib/method/density.py =================================================================== --- trunk/src/cclib/method/density.py 2006-05-10 21:58:18 UTC (rev 107) +++ trunk/src/cclib/method/density.py 2006-05-10 22:20:20 UTC (rev 108) @@ -40,22 +40,22 @@ def calculate(self,fupdate=0.05,cupdate=0.002): """Calculate the density matrix given the results of a parser""" - if not self.parser.parsed: - self.parser.parse() + #if not self.parser.parsed: + # self.parser.parse() #do we have the needed info in the parser? - if not hasattr(self.parser,"mocoeffs") - and not hasattr(self.parser,"aooverlaps") - and not hasattr(self.parser,"nbasis") + if not hasattr(self.parser,"mocoeffs") \ + and not hasattr(self.parser,"aooverlaps") \ + and not hasattr(self.parser,"nbasis") \ and not hasattr(self.parser,"homos"): self.logger.error("Missing mocoeffs or aooverlaps") return False #let the caller of function know we didn't finish self.logger.info("Creating attribute density: array[3]") size=self.parser.nbasis - beta=(len(self.parser.mocoeffs)==2) + unrestricted=(len(self.parser.mocoeffs)==2) - if beta: + if unrestricted: self.density=Numeric.zeros([2,size,size],"f") else: self.density=Numeric.zeros([1,size,size],"f") @@ -66,9 +66,12 @@ col=Numeric.reshape(self.parser.mocoeffs[spin][i],(size,1)) colt=Numeric.reshape(col,(1,size)) - tempdensity=Numeric.matrixmultipy(col,colt) - density[spin]=Numeric.add(density[spin],tempdensity) + tempdensity=Numeric.matrixmultiply(col,colt) + self.density[spin]=Numeric.add(self.density[spin],tempdensity) + if not unrestricted: #multiply by two to account for second electron + self.density[0]=Numeric.add(self.density[0],self.density[0]) + if __name__=="__main__": import doctest,g03parser doctest.testmod(g03parser,verbose=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 21:58:20
|
Revision: 107 Author: atenderholt Date: 2006-05-10 14:58:18 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=107&view=rev Log Message: ----------- Trying again Added Paths: ----------- trunk/src/cclib/method/ trunk/src/cclib/method/__init__.py trunk/src/cclib/method/calculationmethod.py trunk/src/cclib/method/density.py Removed Paths: ------------- trunk/src/cclib/method/calculationmethod.py trunk/src/cclib/method/density.py trunk/src/cclib/methods/ Copied: trunk/src/cclib/method (from rev 105, trunk/src/cclib/methods) Copied: trunk/src/cclib/method/__init__.py (from rev 106, trunk/src/cclib/methods/__init__.py) =================================================================== --- trunk/src/cclib/method/__init__.py (rev 0) +++ trunk/src/cclib/method/__init__.py 2006-05-10 21:58:18 UTC (rev 107) @@ -0,0 +1 @@ +from density import Density Deleted: trunk/src/cclib/method/calculationmethod.py =================================================================== --- trunk/src/cclib/methods/calculationmethod.py 2006-05-10 19:29:45 UTC (rev 105) +++ trunk/src/cclib/method/calculationmethod.py 2006-05-10 21:58:18 UTC (rev 107) @@ -1,52 +0,0 @@ -""" -cclib is a parser for computational chemistry log files. - -See http://cclib.sf.net for more information. - -Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt - - This program is free software; you can redistribute and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -Contributions (monetary as well as code :-) are encouraged. -""" -import logging, sys -import Numeric - -class Method(object): - """Abstract class for logfile objects. - - Subclasses: - Density - - Attributes: - """ - def __init__(self,parser,progress=None, - loglevel=logging.INFO,logname="Log"): - """Initialise the Logfile object. - - Typically called by subclasses in their own __init__ methods. - """ - self.parser = parser - self.progress = progress - self.loglevel = loglevel - self.logname = logname - - # Set up the logger - self.logger = logging.getLogger('%s %s' % (self.logname,self.parser)) - self.logger.setLevel(self.loglevel) - handler = logging.StreamHandler(sys.stdout) - handler.setFormatter(logging.Formatter("[%(name)s %(levelname)s] %(message)s")) - self.logger.addHandler(handler) - - -if __name__=="__main__": - import doctest,calculationmethod - doctest.testmod(calculationmethod,verbose=False) Copied: trunk/src/cclib/method/calculationmethod.py (from rev 106, trunk/src/cclib/methods/calculationmethod.py) =================================================================== --- trunk/src/cclib/method/calculationmethod.py (rev 0) +++ trunk/src/cclib/method/calculationmethod.py 2006-05-10 21:58:18 UTC (rev 107) @@ -0,0 +1,52 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import logging, sys +import Numeric + +class Method(object): + """Abstract class for logfile objects. + + Subclasses: + Density + + Attributes: + """ + def __init__(self,parser,progress=None, + loglevel=logging.INFO,logname="Log"): + """Initialise the Logfile object. + + Typically called by subclasses in their own __init__ methods. + """ + self.parser = parser + self.progress = progress + self.loglevel = loglevel + self.logname = logname + + # Set up the logger + self.logger = logging.getLogger('%s %s' % (self.logname,self.parser)) + self.logger.setLevel(self.loglevel) + handler = logging.StreamHandler(sys.stdout) + handler.setFormatter(logging.Formatter("[%(name)s %(levelname)s] %(message)s")) + self.logger.addHandler(handler) + + +if __name__=="__main__": + import doctest,calculationmethod + doctest.testmod(calculationmethod,verbose=False) Deleted: trunk/src/cclib/method/density.py =================================================================== --- trunk/src/cclib/methods/density.py 2006-05-10 19:29:45 UTC (rev 105) +++ trunk/src/cclib/method/density.py 2006-05-10 21:58:18 UTC (rev 107) @@ -1,72 +0,0 @@ -""" -cclib is a parser for computational chemistry log files. - -See http://cclib.sf.net for more information. - -Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt - - This program is free software; you can redistribute and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -Contributions (monetary as well as code :-) are encouraged. -""" -import re,time -import Numeric -import random # For sometimes running the progress updater -from calculationmethod import Method - -class Density(Method): - """Calculate the density matrix""" - def __init__(self,*args): - - # Call the __init__ method of the superclass - super(Density, self).__init__(logname="Density",*args) - - def __str__(self): - """Return a string representation of the object.""" - return "Density matrix of" % (self.parser) - - def __repr__(self): - """Return a representation of the object.""" - return 'Density matrix("%s")' % (self.parser) - - def calculate(self,fupdate=0.05,cupdate=0.002): - """Calculate the density matrix given the results of a parser""" - - if not self.parser.parsed: - self.parser.parse() - - #do we have the needed info in the parser? - if not hasattr(self.parser,"mocoeffs") - and not hasattr(self.parser,"aooverlaps") - and not hasattr(self.parser,"nbasis") - and not hasattr(self.parser,"homos"): - self.logger.error("Missing mocoeffs or aooverlaps") - return False #let the caller of function know we didn't finish - - self.logger.info("Creating attribute density: array[3]") - size=self.parser.nbasis - beta=(len(self.parser.mocoeffs)==2) - - if beta: - self.density=Numeric.zeros([2,size,size],"f") - else: - self.density=Numeric.zeros([1,size,size],"f") - - for i in range(self.parser.homos[0]+1): - col=Numeric.reshape(self.parser.mocoeffs[0][i],(size,1)) - colt=Numeric.reshape(col,(1,size)) - - tempdensity=Numeric.matrixmultipy(col,colt) - density[0]=Numeric.add(density[0],tempdensity) - -if __name__=="__main__": - import doctest,g03parser - doctest.testmod(g03parser,verbose=False) Copied: trunk/src/cclib/method/density.py (from rev 106, trunk/src/cclib/methods/density.py) =================================================================== --- trunk/src/cclib/method/density.py (rev 0) +++ trunk/src/cclib/method/density.py 2006-05-10 21:58:18 UTC (rev 107) @@ -0,0 +1,74 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import re,time +import Numeric +import random # For sometimes running the progress updater +from calculationmethod import Method + +class Density(Method): + """Calculate the density matrix""" + def __init__(self,*args): + + # Call the __init__ method of the superclass + super(Density, self).__init__(logname="Density",*args) + + def __str__(self): + """Return a string representation of the object.""" + return "Density matrix of" % (self.parser) + + def __repr__(self): + """Return a representation of the object.""" + return 'Density matrix("%s")' % (self.parser) + + def calculate(self,fupdate=0.05,cupdate=0.002): + """Calculate the density matrix given the results of a parser""" + + if not self.parser.parsed: + self.parser.parse() + + #do we have the needed info in the parser? + if not hasattr(self.parser,"mocoeffs") + and not hasattr(self.parser,"aooverlaps") + and not hasattr(self.parser,"nbasis") + and not hasattr(self.parser,"homos"): + self.logger.error("Missing mocoeffs or aooverlaps") + return False #let the caller of function know we didn't finish + + self.logger.info("Creating attribute density: array[3]") + size=self.parser.nbasis + beta=(len(self.parser.mocoeffs)==2) + + if beta: + self.density=Numeric.zeros([2,size,size],"f") + else: + self.density=Numeric.zeros([1,size,size],"f") + + for spin in range(len(self.parser.mocoeffs)): + + for i in range(self.parser.homos[spin]+1): + col=Numeric.reshape(self.parser.mocoeffs[spin][i],(size,1)) + colt=Numeric.reshape(col,(1,size)) + + tempdensity=Numeric.matrixmultipy(col,colt) + density[spin]=Numeric.add(density[spin],tempdensity) + +if __name__=="__main__": + import doctest,g03parser + doctest.testmod(g03parser,verbose=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 21:56:53
|
Revision: 106 Author: atenderholt Date: 2006-05-10 14:56:50 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=106&view=rev Log Message: ----------- Added __init__.pys and some work on density, still need to rename methods to method, but don't want to --force svn. Modified Paths: -------------- trunk/setup.py trunk/src/cclib/__init__.py trunk/src/cclib/methods/density.py Added Paths: ----------- trunk/src/cclib/methods/__init__.py Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2006-05-10 19:29:45 UTC (rev 105) +++ trunk/setup.py 2006-05-10 21:56:50 UTC (rev 106) @@ -5,4 +5,4 @@ author_email="bao...@us...", url="http://cclib.sourceforge.net", package_dir = {'cclib':'src/cclib'}, - packages=['cclib','cclib.parser','cclib.progress']) + packages=['cclib','cclib.parser','cclib.progress','cclib.method']) Modified: trunk/src/cclib/__init__.py =================================================================== --- trunk/src/cclib/__init__.py 2006-05-10 19:29:45 UTC (rev 105) +++ trunk/src/cclib/__init__.py 2006-05-10 21:56:50 UTC (rev 106) @@ -1,2 +1,3 @@ import parser import progress +import method Added: trunk/src/cclib/methods/__init__.py =================================================================== --- trunk/src/cclib/methods/__init__.py (rev 0) +++ trunk/src/cclib/methods/__init__.py 2006-05-10 21:56:50 UTC (rev 106) @@ -0,0 +1 @@ +from density import Density Modified: trunk/src/cclib/methods/density.py =================================================================== --- trunk/src/cclib/methods/density.py 2006-05-10 19:29:45 UTC (rev 105) +++ trunk/src/cclib/methods/density.py 2006-05-10 21:56:50 UTC (rev 106) @@ -60,13 +60,15 @@ else: self.density=Numeric.zeros([1,size,size],"f") - for i in range(self.parser.homos[0]+1): - col=Numeric.reshape(self.parser.mocoeffs[0][i],(size,1)) - colt=Numeric.reshape(col,(1,size)) + for spin in range(len(self.parser.mocoeffs)): - tempdensity=Numeric.matrixmultipy(col,colt) - density[0]=Numeric.add(density[0],tempdensity) + for i in range(self.parser.homos[spin]+1): + col=Numeric.reshape(self.parser.mocoeffs[spin][i],(size,1)) + colt=Numeric.reshape(col,(1,size)) + tempdensity=Numeric.matrixmultipy(col,colt) + density[spin]=Numeric.add(density[spin],tempdensity) + if __name__=="__main__": import doctest,g03parser doctest.testmod(g03parser,verbose=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 19:29:56
|
Revision: 105 Author: atenderholt Date: 2006-05-10 12:29:45 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=105&view=rev Log Message: ----------- Working on adding calculation methods to cclib. Yeah, yeah, it probably doesn't run yet but it shouldn't break anything. Added Paths: ----------- trunk/src/cclib/methods/ trunk/src/cclib/methods/calculationmethod.py trunk/src/cclib/methods/density.py Added: trunk/src/cclib/methods/calculationmethod.py =================================================================== --- trunk/src/cclib/methods/calculationmethod.py (rev 0) +++ trunk/src/cclib/methods/calculationmethod.py 2006-05-10 19:29:45 UTC (rev 105) @@ -0,0 +1,52 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import logging, sys +import Numeric + +class Method(object): + """Abstract class for logfile objects. + + Subclasses: + Density + + Attributes: + """ + def __init__(self,parser,progress=None, + loglevel=logging.INFO,logname="Log"): + """Initialise the Logfile object. + + Typically called by subclasses in their own __init__ methods. + """ + self.parser = parser + self.progress = progress + self.loglevel = loglevel + self.logname = logname + + # Set up the logger + self.logger = logging.getLogger('%s %s' % (self.logname,self.parser)) + self.logger.setLevel(self.loglevel) + handler = logging.StreamHandler(sys.stdout) + handler.setFormatter(logging.Formatter("[%(name)s %(levelname)s] %(message)s")) + self.logger.addHandler(handler) + + +if __name__=="__main__": + import doctest,calculationmethod + doctest.testmod(calculationmethod,verbose=False) Property changes on: trunk/src/cclib/methods/calculationmethod.py ___________________________________________________________________ Name: svn:executable + * Added: trunk/src/cclib/methods/density.py =================================================================== --- trunk/src/cclib/methods/density.py (rev 0) +++ trunk/src/cclib/methods/density.py 2006-05-10 19:29:45 UTC (rev 105) @@ -0,0 +1,72 @@ +""" +cclib is a parser for computational chemistry log files. + +See http://cclib.sf.net for more information. + +Copyright (C) 2006 Noel O'Boyle and Adam Tenderholt + + This program is free software; you can redistribute and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY, without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +Contributions (monetary as well as code :-) are encouraged. +""" +import re,time +import Numeric +import random # For sometimes running the progress updater +from calculationmethod import Method + +class Density(Method): + """Calculate the density matrix""" + def __init__(self,*args): + + # Call the __init__ method of the superclass + super(Density, self).__init__(logname="Density",*args) + + def __str__(self): + """Return a string representation of the object.""" + return "Density matrix of" % (self.parser) + + def __repr__(self): + """Return a representation of the object.""" + return 'Density matrix("%s")' % (self.parser) + + def calculate(self,fupdate=0.05,cupdate=0.002): + """Calculate the density matrix given the results of a parser""" + + if not self.parser.parsed: + self.parser.parse() + + #do we have the needed info in the parser? + if not hasattr(self.parser,"mocoeffs") + and not hasattr(self.parser,"aooverlaps") + and not hasattr(self.parser,"nbasis") + and not hasattr(self.parser,"homos"): + self.logger.error("Missing mocoeffs or aooverlaps") + return False #let the caller of function know we didn't finish + + self.logger.info("Creating attribute density: array[3]") + size=self.parser.nbasis + beta=(len(self.parser.mocoeffs)==2) + + if beta: + self.density=Numeric.zeros([2,size,size],"f") + else: + self.density=Numeric.zeros([1,size,size],"f") + + for i in range(self.parser.homos[0]+1): + col=Numeric.reshape(self.parser.mocoeffs[0][i],(size,1)) + colt=Numeric.reshape(col,(1,size)) + + tempdensity=Numeric.matrixmultipy(col,colt) + density[0]=Numeric.add(density[0],tempdensity) + +if __name__=="__main__": + import doctest,g03parser + doctest.testmod(g03parser,verbose=False) Property changes on: trunk/src/cclib/methods/density.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-10 12:42:15
|
Revision: 104 Author: baoilleach Date: 2006-05-10 05:42:07 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=104&view=rev Log Message: ----------- Adding some tests for the unrestricted single point calculations. Note that ADF appears to have the wrong type for homos (should be a Numeric array, but is a list). Modified Paths: -------------- trunk/test/testall.py Added Paths: ----------- trunk/test/testSPun.py Copied: trunk/test/testSPun.py (from rev 103, trunk/test/testSP.py) =================================================================== --- trunk/test/testSPun.py (rev 0) +++ trunk/test/testSPun.py 2006-05-10 12:42:07 UTC (rev 104) @@ -0,0 +1,53 @@ +import os, unittest +from cclib.parser import GAMESS,G03,ADF,Jaguar +from Numeric import array +from testall import getfile + +class GenericSPunTest(unittest.TestCase): + """Restricted single point calculations with MO coeffs and overlap info.""" + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + + def testdimmocoeffs(self): + """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" + self.assertEquals(self.data.mocoeffs.shape,(2,self.data.nindep,self.data.nbasis)) + + def testhomos(self): + """What are the homos?""" + self.assertEquals(type(self.data.homos),type(array([]))) + self.assertEquals(self.data.homos,array([34,33],"i")) + +class GaussianSPunTest(GenericSPunTest): + def setUp(self): + self.data = getfile(G03,"basicGaussian03","dvb_un_sp.out") + +class GamessUSSPunTest(GenericSPunTest): + def setUp(self): + self.data = getfile(GAMESS,"basicGAMESS-US","dvb_un_sp.out") + +class PCGamessSPunTest(GenericSPunTest): + def setUp(self): + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_un_sp.out") + +class ADFSPunTest(GenericSPunTest): + def setUp(self): + self.data = getfile(ADF,"basicADF2004.01","dvb_un_sp.adfout") + +names = [ "Gaussian", "PCGamess", "GAMESS", "ADF" ] +tests = [ GaussianSPunTest, PCGamessSPunTest, + GamessUSSPunTest, ADFSPunTest ] + +if __name__=="__main__": + total = errors = failures = 0 + + for name,test in zip(names,tests): + print "\n**** Testing %s SPun ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + + print "\n\n********* SUMMARY OF SPun **************" + print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-05-10 09:23:55 UTC (rev 103) +++ trunk/test/testall.py 2006-05-10 12:42:07 UTC (rev 104) @@ -41,7 +41,7 @@ if __name__=="__main__": total = errors = failures = 0 - for module in [ "testGeoOpt", "testSP" ]: + for module in [ "testGeoOpt", "testSP", "testSPun" ]: names = importName(module, "names") # i.e. from testGeoOpt import names tests = importName(module, "tests") # i.e. from testGeoOpt import tests for name,test in zip(names,tests): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-10 09:24:17
|
Revision: 103 Author: baoilleach Date: 2006-05-10 02:23:55 -0700 (Wed, 10 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=103&view=rev Log Message: ----------- Separated out different tests into different tests files. Running testall.py will still run all of the tests, but it's also possible to just run tests for single-point calcs (testSP.py) or geoopt calcs (GeoOpt.py). Needs to be tidied up a bit more as there is some duplicated code in __main__. Modified Paths: -------------- trunk/test/testall.py Added Paths: ----------- trunk/test/testGeoOpt.py trunk/test/testSP.py Copied: trunk/test/testGeoOpt.py (from rev 101, trunk/test/testall.py) =================================================================== --- trunk/test/testGeoOpt.py (rev 0) +++ trunk/test/testGeoOpt.py 2006-05-10 09:23:55 UTC (rev 103) @@ -0,0 +1,85 @@ +import os, unittest +from cclib.parser import GAMESS,G03,ADF,Jaguar +from Numeric import array +from testall import getfile + +class GenericGeoOptTest(unittest.TestCase): + def testhomos(self): + """Is the index of the homo equal to 34?""" + self.assertEquals(self.data.homos,array([34])) + + def testnatom(self): + """Is the number of atoms equal to 20?""" + self.assertEquals(self.data.natom,20) + + def testnbasis(self): + """Is the number of basis set functions equal to 60?""" + self.assertEquals(self.data.nbasis,60) + + def testscfenergy(self): + """Is the SCF energy within 3eV(?) of -382.3?""" + self.assert_(self.data.scfenergies[-1]+382.3<3) + + def testnormalisesym(self): + """Did this subclasses overwrite normalisesym?""" + self.assertNotEquals(self.data.normalisesym("A"),"ERROR: This should be overwritten by this subclass") + + def testlengthmoenergies(self): + """Is the number of evalues equal to 60?""" + self.assertEquals(60,len(self.data.moenergies[0])) + + def testsymlabels(self): + """Are all the symmetry labels either Ag/u or Bg/u?""" + sumwronglabels = sum([x not in ['Ag','Bu','Au','Bg'] for x in self.data.mosyms[0]]) + self.assertEquals(sumwronglabels,0) + + def testscfvaluetype(self): + """Do the scf values have the right type?""" + self.assert_(type(self.data.scfvalues[0])==type(array([])) and type(self.data.scfvalues)==type([])) + + def testscfvaluedim(self): + """Do the scf values have the right dimensions?""" + self.assert_(len(self.data.scfvalues)==len(self.data.geovalues) and len(self.data.scfvalues[0])==len(self.data.scftargets)) + +class GaussianGeoOptTest(GenericGeoOptTest): + def setUp(self): + self.data = getfile(G03,"basicGaussian03","dvb_gopt.out") + +class GamessUSGeoOptTest(GenericGeoOptTest): + def setUp(self): + self.data = getfile(GAMESS,"basicGAMESS-US","dvb_gopt_a.out") + +class PCGamessGeoOptTest(GenericGeoOptTest): + def setUp(self): + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_gopt_a.out") + +class ADFGeoOptTest(GenericGeoOptTest): + def setUp(self): + self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") + + def testscfvaluedim(self): + """Do the scf values have the right dimensions? + ADF calculations one more SCF cycle after the geometry is converged""" + self.assert_(len(self.data.scfvalues)==len(self.data.geovalues)+1 and len(self.data.scfvalues[0])==len(self.data.scftargets)) + +class JaguarGeoOptTest(GenericGeoOptTest): + def setUp(self): + self.data = getfile(Jaguar,"basicJaguar","eg01","dvb_gopt.out") + +names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] +tests = [ GaussianGeoOptTest, PCGamessGeoOptTest, + GamessUSGeoOptTest, ADFGeoOptTest, + JaguarGeoOptTest ] + +if __name__=="__main__": + total = errors = failures = 0 + for name,test in zip(names,tests): + print "\n**** Testing %s Geo Opt ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + + print "\n\n********* SUMMARY OF Geo Opt **************" + print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) Copied: trunk/test/testSP.py (from rev 101, trunk/test/testall.py) =================================================================== --- trunk/test/testSP.py (rev 0) +++ trunk/test/testSP.py 2006-05-10 09:23:55 UTC (rev 103) @@ -0,0 +1,48 @@ +import os, unittest +from cclib.parser import GAMESS,G03,ADF,Jaguar +from Numeric import array +from testall import getfile + +class GenericSPTest(unittest.TestCase): + """Restricted single point calculations with MO coeffs and overlap info.""" + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + + def testdimmocoeffs(self): + """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" + self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nindep,self.data.nbasis)) + +class GaussianSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(G03,"basicGaussian03","dvb_sp.out") + +class GamessUSSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicGAMESS-US","dvb_sp.out") + +class PCGamessSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_sp.out") + +class ADFSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(ADF,"basicADF2004.01","dvb_sp_b.adfout") + +names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] +tests = [ GaussianSPTest, PCGamessSPTest, + GamessUSSPTest, ADFSPTest ] + +if __name__=="__main__": + total = errors = failures = 0 + + for name,test in zip(names,tests): + print "\n**** Testing %s SP ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + + print "\n\n********* SUMMARY OF SP **************" + print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-05-10 01:51:02 UTC (rev 102) +++ trunk/test/testall.py 2006-05-10 09:23:55 UTC (rev 103) @@ -1,96 +1,7 @@ -import os, unittest -from cclib.parser import GAMESS,G03,ADF,Jaguar -from Numeric import array +import unittest +import os +from cclib.parser import G03,GAMESS,ADF,Jaguar -class GenericSPTest(unittest.TestCase): - """Restricted single point calculations with MO coeffs and overlap info.""" - def testdimaooverlaps(self): - """Are the dims of the overlap matrix consistent with nbasis?""" - self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) - - def testdimmocoeffs(self): - """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" - self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nindep,self.data.nbasis)) - -class GaussianSPTest(GenericSPTest): - def setUp(self): - self.data = getfile(G03,"basicGaussian03","dvb_sp.out") - -class GamessUSSPTest(GenericSPTest): - def setUp(self): - self.data = getfile(GAMESS,"basicGAMESS-US","dvb_sp.out") - -class PCGamessSPTest(GenericSPTest): - def setUp(self): - self.data = getfile(GAMESS,"basicPCGAMESS","dvb_sp.out") - -class ADFSPTest(GenericSPTest): - def setUp(self): - self.data = getfile(ADF,"basicADF2004.01","dvb_sp_b.adfout") - -class GenericGeoOptTest(unittest.TestCase): - def testhomos(self): - """Is the index of the homo equal to 34?""" - self.assertEquals(self.data.homos,array([34])) - - def testnatom(self): - """Is the number of atoms equal to 20?""" - self.assertEquals(self.data.natom,20) - - def testnbasis(self): - """Is the number of basis set functions equal to 60?""" - self.assertEquals(self.data.nbasis,60) - - def testscfenergy(self): - """Is the SCF energy within 3eV(?) of -382.3?""" - self.assert_(self.data.scfenergies[-1]+382.3<3) - - def testnormalisesym(self): - """Did this subclasses overwrite normalisesym?""" - self.assertNotEquals(self.data.normalisesym("A"),"ERROR: This should be overwritten by this subclass") - - def testlengthmoenergies(self): - """Is the number of evalues equal to 60?""" - self.assertEquals(60,len(self.data.moenergies[0])) - - def testsymlabels(self): - """Are all the symmetry labels either Ag/u or Bg/u?""" - sumwronglabels = sum([x not in ['Ag','Bu','Au','Bg'] for x in self.data.mosyms[0]]) - self.assertEquals(sumwronglabels,0) - - def testscfvaluetype(self): - """Do the scf values have the right type?""" - self.assert_(type(self.data.scfvalues[0])==type(array([])) and type(self.data.scfvalues)==type([])) - - def testscfvaluedim(self): - """Do the scf values have the right dimensions?""" - self.assert_(len(self.data.scfvalues)==len(self.data.geovalues) and len(self.data.scfvalues[0])==len(self.data.scftargets)) - -class GaussianGeoOptTest(GenericGeoOptTest): - def setUp(self): - self.data = getfile(G03,"basicGaussian03","dvb_gopt.out") - -class GamessUSGeoOptTest(GenericGeoOptTest): - def setUp(self): - self.data = getfile(GAMESS,"basicGAMESS-US","dvb_gopt_a.out") - -class PCGamessGeoOptTest(GenericGeoOptTest): - def setUp(self): - self.data = getfile(GAMESS,"basicPCGAMESS","dvb_gopt_a.out") - -class ADFGeoOptTest(GenericGeoOptTest): - def setUp(self): - self.data = getfile(ADF,"basicADF2004.01","dvb_gopt.adfout") - - def testscfvaluedim(self): - """Do the scf values have the right dimensions? - ADF calculations one more SCF cycle after the geometry is converged""" - self.assert_(len(self.data.scfvalues)==len(self.data.geovalues)+1 and len(self.data.scfvalues[0])==len(self.data.scftargets)) - -class JaguarGeoOptTest(GenericGeoOptTest): - def setUp(self): - self.data = getfile(Jaguar,"basicJaguar","eg01","dvb_gopt.out") - def getfile(parser,*location): """Returns a parsed logfile.""" if parser.__name__ in ['GAMESS','ADF','Jaguar']: @@ -116,32 +27,31 @@ print "LUMO", " ".join(["%+2.4f" % x.moenergies[0,x.homos[0]+1] for x in logfiles]) print "H-L ", " ".join(["%2.4f" % (x.moenergies[0,x.homos[0]+1]-x.moenergies[0,x.homos[0]],) for x in logfiles]) +def importName(modulename, name): + """Import from a module whose name is determined at run-time. + + Taken from Python Cookbook 2nd ed O'Reilly Recipe 16.3 + """ + try: + module = __import__(modulename, globals(), locals(), [name]) + except ImportError: + return None + return getattr(module, name) - + if __name__=="__main__": - names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] - tests = [ GaussianGeoOptTest, PCGamessGeoOptTest, - GamessUSGeoOptTest, ADFGeoOptTest, - JaguarGeoOptTest ] total = errors = failures = 0 - for name,test in zip(names,tests): - print "\n**** Testing %s Geo Opt ****" % name - myunittest = unittest.makeSuite(test) - a = unittest.TextTestRunner(verbosity=2).run(myunittest) - total += a.testsRun - errors += len(a.errors) - failures += len(a.failures) + for module in [ "testGeoOpt", "testSP" ]: + names = importName(module, "names") # i.e. from testGeoOpt import names + tests = importName(module, "tests") # i.e. from testGeoOpt import tests + for name,test in zip(names,tests): + print "\n**** Testing %s (%s) ****" % (name, module) + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) - tests = [ GaussianSPTest, PCGamessSPTest, - GamessUSSPTest, ADFSPTest ] - for name,test in zip(names,tests): - print "\n**** Testing %s SP ****" % name - myunittest = unittest.makeSuite(test) - a = unittest.TextTestRunner(verbosity=2).run(myunittest) - total += a.testsRun - errors += len(a.errors) - failures += len(a.failures) - print "\n\n********* SUMMARY OF EVERYTHING **************" print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-10 01:51:05
|
Revision: 102 Author: atenderholt Date: 2006-05-09 18:51:02 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=102&view=rev Log Message: ----------- QtProgress class :o) Modified Paths: -------------- trunk/src/cclib/progress/__init__.py Added Paths: ----------- trunk/src/cclib/progress/qtprogress.py Modified: trunk/src/cclib/progress/__init__.py =================================================================== --- trunk/src/cclib/progress/__init__.py 2006-05-09 16:10:39 UTC (rev 101) +++ trunk/src/cclib/progress/__init__.py 2006-05-10 01:51:02 UTC (rev 102) @@ -1 +1,2 @@ from textprogress import TextProgress +from qtprogress import QtProgress Added: trunk/src/cclib/progress/qtprogress.py =================================================================== --- trunk/src/cclib/progress/qtprogress.py (rev 0) +++ trunk/src/cclib/progress/qtprogress.py 2006-05-10 01:51:02 UTC (rev 102) @@ -0,0 +1,35 @@ +import sys +import thread +from qt import QProgressDialog,QString + +class QtProgress(QProgressDialog): + + def __init__(self,parent): + + QProgressDialog.__init__(self,parent,"progress",True) + + self.nstep=0 + self.text=None + self.oldprogress=0 + self.progress=0 + self.calls=0 + + self.setCaption("Progress...") + + def initialize(self,nstep,text=None): + + self.nstep=nstep + self.text=text + self.setTotalSteps(nstep) + if text: + self.setLabelText(text) + self.setProgress(1) + #sys.stdout.write("\n") + + def update(self,step,text=None): + + self.setLabelText(text) + self.setProgress(step) + + return + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-09 16:10:52
|
Revision: 101 Author: baoilleach Date: 2006-05-09 09:10:39 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=101&view=rev Log Message: ----------- Adding some tests for the dimensions of aooverlaps and mocoeffs in restricted single point energy calculations -- what's the story with ADF though? Modified Paths: -------------- trunk/test/testall.py Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-05-09 01:11:45 UTC (rev 100) +++ trunk/test/testall.py 2006-05-09 16:10:39 UTC (rev 101) @@ -2,6 +2,32 @@ from cclib.parser import GAMESS,G03,ADF,Jaguar from Numeric import array +class GenericSPTest(unittest.TestCase): + """Restricted single point calculations with MO coeffs and overlap info.""" + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + + def testdimmocoeffs(self): + """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" + self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nindep,self.data.nbasis)) + +class GaussianSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(G03,"basicGaussian03","dvb_sp.out") + +class GamessUSSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicGAMESS-US","dvb_sp.out") + +class PCGamessSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_sp.out") + +class ADFSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(ADF,"basicADF2004.01","dvb_sp_b.adfout") + class GenericGeoOptTest(unittest.TestCase): def testhomos(self): """Is the index of the homo equal to 34?""" @@ -106,6 +132,16 @@ errors += len(a.errors) failures += len(a.failures) + tests = [ GaussianSPTest, PCGamessSPTest, + GamessUSSPTest, ADFSPTest ] + for name,test in zip(names,tests): + print "\n**** Testing %s SP ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + print "\n\n********* SUMMARY OF EVERYTHING **************" print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ate...@us...> - 2006-05-09 01:11:48
|
Revision: 100 Author: atenderholt Date: 2006-05-08 18:11:45 -0700 (Mon, 08 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=100&view=rev Log Message: ----------- Fixed an off-by-one error in the gaussian parser's aooverlap section. It was parsing the AO numbers, but should be fixed now. Modified Paths: -------------- trunk/src/cclib/parser/g03parser.py Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-08 21:06:30 UTC (rev 99) +++ trunk/src/cclib/parser/g03parser.py 2006-05-09 01:11:45 UTC (rev 100) @@ -474,7 +474,7 @@ line = inputfile.next() parts = line.split() for j in range(len(parts)-1): # Some lines are longer than others - k = float(parts[j].replace("D","E")) + k = float(parts[j+1].replace("D","E")) self.aooverlaps[base+j,i+base] = k self.aooverlaps[i+base,base+j] = k base += 5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-03 09:14:19
|
Revision: 98 Author: baoilleach Date: 2006-05-03 02:14:12 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=98&view=rev Log Message: ----------- Tided up the main section, in preparation for adding tests for single point unrestricted. Modified Paths: -------------- trunk/test/testall.py Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-05-03 08:44:14 UTC (rev 97) +++ trunk/test/testall.py 2006-05-03 09:14:12 UTC (rev 98) @@ -93,20 +93,21 @@ if __name__=="__main__": - gaussiantests = unittest.makeSuite(GaussianGeoOptTest) - pcgamesstests = unittest.makeSuite(PCGamessGeoOptTest) - gamessustests = unittest.makeSuite(GamessUSGeoOptTest) - adftests = unittest.makeSuite(ADFGeoOptTest) - jaguartests = unittest.makeSuite(JaguarGeoOptTest) - print "\n*** Testing Gaussian dvb_gopt.out ***" - unittest.TextTestRunner(verbosity=2).run(gaussiantests) - print "\n\n*** Testing PCGAMESS dvb_gopt_a.out ***" - unittest.TextTestRunner(verbosity=2).run(pcgamesstests) - print "\n\n*** Testing GAMESS-US dvb_gopt_a.out ***" - unittest.TextTestRunner(verbosity=2).run(gamessustests) - print "\n\n*** Testing ADF dvb_gopt.adfout ***" - unittest.TextTestRunner(verbosity=2).run(adftests) - print "\n\n*** Testing Jaguar dvb_gopt.out ***" - unittest.TextTestRunner(verbosity=2).run(jaguartests) + names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] + tests = [ GaussianGeoOptTest, PCGamessGeoOptTest, + GamessUSGeoOptTest, ADFGeoOptTest, + JaguarGeoOptTest ] + total = errors = failures = 0 + for name,test in zip(names,tests): + print "\n**** Testing %s Geo Opt ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + + print "\n\n********* SUMMARY OF EVERYTHING **************" + print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) + print "\n\n*** Visual tests ***" visualtests() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bao...@us...> - 2006-05-03 08:44:23
|
Revision: 97 Author: baoilleach Date: 2006-05-03 01:44:14 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=97&view=rev Log Message: ----------- Normalising the symmetries from Gaussian Modified Paths: -------------- trunk/src/cclib/parser/g03parser.py Modified: trunk/src/cclib/parser/g03parser.py =================================================================== --- trunk/src/cclib/parser/g03parser.py 2006-05-01 21:03:55 UTC (rev 96) +++ trunk/src/cclib/parser/g03parser.py 2006-05-03 08:44:14 UTC (rev 97) @@ -37,7 +37,21 @@ def __repr__(self): """Return a representation of the object.""" return 'G03("%s")' % (self.filename) + + def normalisesym(self,label): + """Use standard symmetry labels instead of Gaussian labels. + To normalise: + (1) replace any G or U by their lowercase equivalent + + >>> sym = G03("dummyfile").normalisesym + >>> labels = ['A1','AG','A1G'] + >>> map(sym,labels) + ['A1', 'Ag', 'A1g'] + """ + ans = label.replace("U","u").replace("G","g") + return ans + def parse(self,fupdate=0.05,cupdate=0.002): """Extract information from the logfile.""" inputfile = open(self.filename,"r") @@ -219,7 +233,7 @@ self.logger.info("Creating attribute homos[]") parts = line[17:].split() for x in parts: - self.mosyms[0].append(x.strip('()')) + self.mosyms[0].append(self.normalisesym(x.strip('()'))) i+= 1 line = inputfile.next() if unres: @@ -233,7 +247,7 @@ self.homos[1] = i-1 # 'HOMO' indexes the HOMO in the arrays parts = line[17:].split() for x in parts: - self.mosyms[1].append(x.strip('()')) + self.mosyms[1].append(self.normalisesym(x.strip('()'))) i+= 1 line = inputfile.next() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |