def testBadInput(self): """Asserts raise of ValueError for missing string input.""" with self.assertRaises(ValueError) as e: param.GetMass('AA') self.assertEqual(str(e.exception), 'No atomic mass found for element: AA')
def __init__(self, type_, coords, charge, ro=None, eps=None): self.SetType(type_) self.SetCoords(coords) self.SetCharge(charge) if ro == None or eps == None: ro, eps = param.GetVdwParam(self.type_) self.SetRo(ro) self.SetEps(eps) self.SetElement(param.GetElement(type_)) self.SetMass(param.GetMass(self.element)) self.SetCovRad(param.GetCovRad(self.element)) self.SetVels(numpy.zeros(const.NUMDIM)) self.SetAccs(numpy.zeros(const.NUMDIM)) self.SetPVels(numpy.zeros(const.NUMDIM)) self.SetPAccs(numpy.zeros(const.NUMDIM))
def testHeaviestAtom(self): """Asserts correct mass for heaviest present atom.""" self.assertEqual(param.GetMass('Kr'), 83.7980)
def testHydrogen(self): """Asserts correct mass for hydrogen atom.""" self.assertEqual(param.GetMass('H'), 1.00794)
def testDummyInput(self): """Asserts zero mass for dummy atom input.""" self.assertEqual(param.GetMass('X'), 0.0)