From: <bao...@us...> - 2006-05-22 08:54:50
|
Revision: 140 Author: baoilleach Date: 2006-05-22 01:54:39 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=140&view=rev Log Message: ----------- Removed references to Jaguar Modified Paths: -------------- branches/cclib-0.5-prerelease/src/cclib/parser/__init__.py branches/cclib-0.5-prerelease/src/cclib/parser/logfileparser.py branches/cclib-0.5-prerelease/src/cclib/parser/utils.py branches/cclib-0.5-prerelease/test/testGeoOpt.py branches/cclib-0.5-prerelease/test/testSP.py branches/cclib-0.5-prerelease/test/testSPun.py branches/cclib-0.5-prerelease/test/testall.py Removed Paths: ------------- branches/cclib-0.5-prerelease/src/cclib/parser/jaguarparser.py branches/cclib-0.5-prerelease/test/parseJaguar.py Modified: branches/cclib-0.5-prerelease/src/cclib/parser/__init__.py =================================================================== --- branches/cclib-0.5-prerelease/src/cclib/parser/__init__.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/src/cclib/parser/__init__.py 2006-05-22 08:54:39 UTC (rev 140) @@ -8,7 +8,6 @@ from gaussianparser import Gaussian from gamessparser import GAMESS from adfparser import ADF -from jaguarparser import Jaguar # This allow users to type: # from cclib.parser import guesstype Deleted: branches/cclib-0.5-prerelease/src/cclib/parser/jaguarparser.py =================================================================== --- branches/cclib-0.5-prerelease/src/cclib/parser/jaguarparser.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/src/cclib/parser/jaguarparser.py 2006-05-22 08:54:39 UTC (rev 140) @@ -1,174 +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 -import utils -import logfileparser - -class Jaguar(logfileparser.Logfile): - """A Jaguar output file""" - - def __init__(self,*args): - - # Call the __init__ method of the superclass - super(Jaguar, self).__init__(logname="Jaguar",*args) - - def __str__(self): - """Return a string representation of the object.""" - return "Jaguar output file %s" % (self.filename) - - def __repr__(self): - """Return a representation of the object.""" - return 'Jaguar("%s")' % (self.filename) - - def parse(self,fupdate=0.05,cupdate=0.002): - """Extract information from the logfile.""" - inputfile = open(self.filename,"r") - - if self.progress: - - inputfile.seek(0,2) #go to end of file - nstep=inputfile.tell() - inputfile.seek(0) - self.progress.initialize(nstep) - oldstep=0 - - for line in inputfile: - - if self.progress and random.random()<cupdate: - - step = inputfile.tell() - if step!=oldstep: - self.progress.update(step,"Unsupported Information") - oldstep = step - - if line[0:4]=="etot": -# Get SCF convergence information - if not hasattr(self,"scfvalues"): - self.scfvalues = [] - self.logger.info("Creating attribute: scfvalues") - values = [] - while line[0:4]=="etot": - if line[39:47].strip(): - denergy = float(line[39:47]) - else: - denergy = 0 # Should really be greater than target value - # or should we just ignore the values in this line - ddensity = float(line[48:56]) - maxdiiserr = float(line[57:65]) - values.append([denergy,ddensity,maxdiiserr]) - line = inputfile.next() - self.scfvalues.append(values) - - if line[1:5]=="SCFE": -# Get the energy of the molecule - if not hasattr(self,"scfenergies"): - self.logger.info("Creating attribute scfenergies") - self.scfenergies = [] - temp = line.strip().split() - self.scfenergies.append(float(temp[temp.index("hartrees")-1])) - - if line[2:28]=="geometry optimization step": -# Get Geometry Opt convergence information - if not hasattr(self,"geovalues"): - self.geovalues = [] - self.geotargets = Numeric.zeros(4,"float") - self.logger.info("Creating attributes: geovalues,geotargets") - blank = inputfile.next() - blank = inputfile.next() - line = inputfile.next() - i = 0 - values = [] - while line!=blank: - if line[41]=="(": - # A new geo convergence value - values.append(float(line[26:37])) - self.geotargets[i] = float(line[43:54]) - i+=1 - line = inputfile.next() - self.geovalues.append(values) - - if line[2:33]=="Orbital energies/symmetry label": -# Get MO Energies and symmetrys - if not hasattr(self,"moenergies"): - self.logger.info("Creating attributes: moenergies, mosyms") - self.mosyms = [[]] - self.moenergies = [[]] - line = inputfile.next() - while line.strip(): - temp = line.strip().split() - for i in range(0,len(temp),2): - self.moenergies[0].append(utils.convertor(float(temp[i]),"hartree","eV")) - self.mosyms[0].append(temp[i+1]) - line = inputfile.next() - self.moenergies = Numeric.array(self.moenergies,"f") - - if line[1:28]=="number of occupied orbitals": - if not hasattr(self,"homos"): - self.logger.info("Creating attribute: homos") - self.homos = Numeric.array([float(line.strip().split()[-1])-1],"i") - - if line[2:27]=="number of basis functions": - if not hasattr(self,"nbasis"): - self.logger.info("Creating attribute: nbasis") - self.nbasis = float(line.strip().split()[-1]) - - if line[2:23]=="start of program freq": -# IR stuff - self.logger.info("Creating attribute: vibfreqs") - self.vibfreqs = [] - blank = inputfile.next() - line = inputfile.next(); line = inputfile.next() - blank = inputfile.next() - - freqs = inputfile.next() - while freqs!=blank: - temp = freqs.strip().split() - self.vibfreqs.extend(map(float,temp[1:])) - temp = inputfile.next().strip().split() - if temp[0]=="symmetries": # May go straight from frequencies to reduced mass - if not hasattr(self,"vibsyms"): - self.logger.info("Creating attributes: vibsyms, vibirs") - self.vibsyms = [] - self.vibirs = [] - self.vibsyms.extend(map(self.normalisesym,temp[1:])) - temp = inputfile.next().strip().split() - self.vibirs.extend(map(float,temp[1:])) - reducedmass = inputfile.next() - line = inputfile.next() - while line!=blank: # Read the cartesian displacements - line = inputfile.next() - freqs = inputfile.next() - self.vibfreqs = Numeric.array(self.vibfreqs) - if hasattr(self,"vibirs"): - self.vibirs = Numeric.array(self.vibirs) - - inputfile.close() - -## if hasattr(self,"scfvalues"): -## 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,jaguarparser - doctest.testmod(jaguarparser,verbose=False) Modified: branches/cclib-0.5-prerelease/src/cclib/parser/logfileparser.py =================================================================== --- branches/cclib-0.5-prerelease/src/cclib/parser/logfileparser.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/src/cclib/parser/logfileparser.py 2006-05-22 08:54:39 UTC (rev 140) @@ -25,7 +25,7 @@ """Abstract class for logfile objects. Subclasses: - ADF, GAMESS, Gaussian, Jaguar + ADF, GAMESS, Gaussian Attributes: aonames -- "Ru_3p" (list) Modified: branches/cclib-0.5-prerelease/src/cclib/parser/utils.py =================================================================== --- branches/cclib-0.5-prerelease/src/cclib/parser/utils.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/src/cclib/parser/utils.py 2006-05-22 08:54:39 UTC (rev 140) @@ -20,14 +20,13 @@ import adfparser import gamessparser import gaussianparser -import jaguarparser def guesstype(filename): """Guess the identity of a particular log file and return an instance of that. Notes: uses the first 20 lines of a log file to guess its identity - Returns: one of ADF, GAMESS, Gaussian, Jaguar, or None (if it cannot figure it out). + Returns: one of ADF, GAMESS, Gaussian, or None (if it cannot figure it out). """ filetype = None inputfile = open(filename,"r") @@ -39,8 +38,6 @@ filetype = gamessparser.GAMESS elif line.find("Gaussian")>=0: filetype = gaussianparser.Gaussian - elif line.find("Jaguar")>=0: - filetype = jaguarparser.Jaguar inputfile.close() # Need to close before creating an instance if filetype: filetype = apply(filetype,[filename]) # Create an instance of the chosen class Deleted: branches/cclib-0.5-prerelease/test/parseJaguar.py =================================================================== --- branches/cclib-0.5-prerelease/test/parseJaguar.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/test/parseJaguar.py 2006-05-22 08:54:39 UTC (rev 140) @@ -1,15 +0,0 @@ -import os -from cclib.parser import Jaguar - -os.chdir(os.path.join("..","data","Jaguar","basicJaguar")) - -files = [ ["eg01","dvb_gopt.out"], - ["eg02","dvb_sp.out"], - ["eg03","dvb_ir.out"], - ["eg06","dvb_un_sp.out"] ] - -for f in files: - t = Jaguar(os.path.join(f[0],f[1])) - t.parse() - if f[0]!="eg03": - print t.scfvalues Modified: branches/cclib-0.5-prerelease/test/testGeoOpt.py =================================================================== --- branches/cclib-0.5-prerelease/test/testGeoOpt.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/test/testGeoOpt.py 2006-05-22 08:54:39 UTC (rev 140) @@ -4,7 +4,7 @@ from Numeric import array from testall import getfile -from cclib.parser import ADF, GAMESS, Gaussian, Jaguar +from cclib.parser import ADF, GAMESS, Gaussian class GenericGeoOptTest(unittest.TestCase): def testhomos(self): @@ -81,14 +81,9 @@ 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" ] +names = [ "Gaussian", "PCGamess", "GAMESS", "ADF" ] tests = [ GaussianGeoOptTest, PCGamessGeoOptTest, - GamessUSGeoOptTest, ADFGeoOptTest, - JaguarGeoOptTest ] + GamessUSGeoOptTest, ADFGeoOptTest ] if __name__=="__main__": total = errors = failures = 0 Modified: branches/cclib-0.5-prerelease/test/testSP.py =================================================================== --- branches/cclib-0.5-prerelease/test/testSP.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/test/testSP.py 2006-05-22 08:54:39 UTC (rev 140) @@ -1,7 +1,7 @@ import os, unittest from Numeric import array from testall import getfile -from cclib.parser import ADF, GAMESS, Gaussian, Jaguar +from cclib.parser import ADF, GAMESS, Gaussian class GenericSPTest(unittest.TestCase): """Restricted single point calculations with MO coeffs and overlap info.""" @@ -34,7 +34,7 @@ #ADF uses fooverlaps self.assertEquals(self.data.fooverlaps.shape,(self.data.nbasis,self.data.nbasis)) -names = [ "Gaussian", "PCGamess", "GAMESS", "ADF", "Jaguar" ] +names = [ "Gaussian", "PCGamess", "GAMESS", "ADF" ] tests = [ GaussianSPTest, PCGamessSPTest, GamessUSSPTest, ADFSPTest ] Modified: branches/cclib-0.5-prerelease/test/testSPun.py =================================================================== --- branches/cclib-0.5-prerelease/test/testSPun.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/test/testSPun.py 2006-05-22 08:54:39 UTC (rev 140) @@ -1,7 +1,7 @@ import os, unittest from Numeric import array from testall import getfile -from cclib.parser import ADF, GAMESS, Gaussian, Jaguar +from cclib.parser import ADF, GAMESS, Gaussian class GenericSPunTest(unittest.TestCase): """Restricted single point calculations with MO coeffs and overlap info.""" Modified: branches/cclib-0.5-prerelease/test/testall.py =================================================================== --- branches/cclib-0.5-prerelease/test/testall.py 2006-05-22 08:48:08 UTC (rev 139) +++ branches/cclib-0.5-prerelease/test/testall.py 2006-05-22 08:54:39 UTC (rev 140) @@ -1,10 +1,10 @@ import unittest import os -from cclib.parser import ADF, GAMESS, Gaussian, Jaguar +from cclib.parser import ADF, GAMESS, Gaussian def getfile(parser,*location): """Returns a parsed logfile.""" - if parser.__name__ in ['GAMESS','ADF','Jaguar']: + if parser.__name__ in ['GAMESS','ADF']: fullpath = ("..","data",parser.__name__) + location elif parser.__name__=="Gaussian": fullpath = ("..","data","Gaussian") + location @@ -18,11 +18,10 @@ logfiles = [ getfile(Gaussian,"basicGaussian03","dvb_gopt.out"), getfile(GAMESS,"basicPCGAMESS","dvb_gopt_a.out"), getfile(GAMESS,"basicGAMESS-US","dvb_gopt_a.out"), - getfile(ADF,"basicADF2004.01","dvb_gopt.adfout"), - getfile(Jaguar,"basicJaguar","eg01","dvb_gopt.out")] + getfile(ADF,"basicADF2004.01","dvb_gopt.adfout")] print "\n\nMO energies of optimised dvb" - print " ","".join(["%8s" % x for x in ['Gaussian','PCGAMESS','GAMESS-US','ADF','Jaguar']]) + print " ","".join(["%8s" % x for x in ['Gaussian','PCGAMESS','GAMESS-US','ADF']]) print "HOMO", " ".join(["%+2.4f" % x.moenergies[0,x.homos[0]] for x in logfiles]) 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]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |