From: <bao...@us...> - 2006-04-14 14:23:31
|
Revision: 66 Author: baoilleach Date: 2006-04-14 07:23:25 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=66&view=rev Log Message: ----------- Added function and doctests for normalising symmetry...but I forgot to call it...oh well, next time. Modified Paths: -------------- trunk/src/cclib/parser/gamessparser.py Modified: trunk/src/cclib/parser/gamessparser.py =================================================================== --- trunk/src/cclib/parser/gamessparser.py 2006-04-14 01:07:57 UTC (rev 65) +++ trunk/src/cclib/parser/gamessparser.py 2006-04-14 14:23:25 UTC (rev 66) @@ -38,6 +38,26 @@ """Return a representation of the object.""" return 'GAMESS("%s")' % (self.filename) + def normalisesym(self,label): + """Normalise the symmetries used by GAMESS. + + To normalise, two rules need to be applied: + (1) Occurences of U/G in the 2/3 position of the label + must be lower-cased + (2) Two single quotation marks must be replaced by a double + + >>> t = GAMESS("dummyfile").normalisesym + >>> labels = ['A','A1','A1G',"A'","A''","AG"] + >>> answers = map(t,labels) + >>> print answers + ['A', 'A1', 'A1g', "A'", 'A"', 'Ag'] + """ + if label[1:] == "''": + end = '"' + else: + end = label[1:].replace("U","u").replace("G","g") + return label[0] + end + def parse(self): """Extract information from the logfile.""" inputfile = open(self.filename,"r") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |