def main(log=True): data1, logfile1 = getfile(Gaussian, "CDA", "BH3CO-sp.log") data2, logfile2 = getfile(Gaussian, "CDA", "BH3.log") data3, logfile3 = getfile(Gaussian, "CDA", "CO.log") fa = CDA(data1) if not log: fa.logger.setLevel(logging.ERROR) fa.calculate([data2, data3]) return fa
def test_mbo_sp(self): """Testing Mayer bond orders for restricted single point.""" data, logfile = getfile(Gaussian, "basicGaussian09", "dvb_sp.out") mbo = MBO(data) mbo.logger.setLevel(logging.ERROR) mbo.calculate() e_mbo = numpy.loadtxt("dvb_sp.mbo") self.assertTrue(numpy.all(mbo.fragresults[0] >= e_mbo - 0.25)) self.assertTrue(numpy.all(mbo.fragresults[0] <= e_mbo + 0.25))
def test_mbo_un_sp(self): """Testing Mayer bond orders for unrestricted single point.""" data, logfile = getfile(Gaussian, "basicGaussian09", "dvb_un_sp.log") mbo = MBO(data) mbo.logger.setLevel(logging.ERROR) mbo.calculate() e_mbo = numpy.loadtxt("dvb_un_sp.mbo") bond_orders = mbo.fragresults[0] + mbo.fragresults[1] self.assertTrue(numpy.all(bond_orders >= e_mbo - 0.30)) self.assertTrue(numpy.all(bond_orders <= e_mbo + 0.30))
def test_nre(self): """Testing nuclear repulsion energy for one logfile where it is printed.""" data, logfile = getfile(QChem, "basicQChem4.2", "water_mp4sdq.out") nuclear = Nuclear(data) nuclear.logger.setLevel(logging.ERROR) with open(logfile.filename) as f: output = f.read() line = re.search('Nuclear Repulsion Energy = .* hartrees', output).group() nre = float(line.split()[4]) nre = utils.convertor(nre, 'Angstrom', 'bohr') self.assertAlmostEqual(nuclear.repulsion_energy(), nre, places=7)
def setUp(self): self.data, self.logfile = getfile(Gaussian, "basicGaussian03", "dvb_sp.out") self.analysis = CSPA(self.data) self.analysis.logger.setLevel(0) self.analysis.calculate()