From: <bao...@us...> - 2006-04-07 10:39:18
|
Revision: 56 Author: baoilleach Date: 2006-04-07 03:38:57 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=56&view=rev Log Message: ----------- Added prototype function normalisesym() to Logfile() for standardising the symmetry labels of molecular orbitals (and other symmetry labels too?). This should be overwritten in the subclasses. Added a unittest to testall.py that checks to make sure that the prototype has been overwritten. Modified Paths: -------------- trunk/src/cclib/parser/logfileparser.py trunk/test/testall.py Modified: trunk/src/cclib/parser/logfileparser.py =================================================================== --- trunk/src/cclib/parser/logfileparser.py 2006-04-04 16:06:01 UTC (rev 55) +++ trunk/src/cclib/parser/logfileparser.py 2006-04-07 10:38:57 UTC (rev 56) @@ -103,6 +103,15 @@ handler.setFormatter(logging.Formatter("[%(name)s %(levelname)s] %(message)s")) self.logger.addHandler(handler) + def normalisesym(self,symlabel): + """Standardise the symmetry labels between parsers. + + This method should be overwritten by individual parsers, and should + contain appropriate doctests. If is not overwritten, this is detected + as an error by unit tests. + """ + return "ERROR: This should be overwritten by this subclass" + def float(self,number): """Convert a string to a float avoiding the problem with Ds. Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-04-04 16:06:01 UTC (rev 55) +++ trunk/test/testall.py 2006-04-07 10:38:57 UTC (rev 56) @@ -19,6 +19,10 @@ """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") + class GaussianGeoOptTest(GenericGeoOptTest): def setUp(self): self.data = getfile(G03,"basicGaussian03","dvb_gopt.out") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |