Пример #1
0
 def test_K(self):
     """
     Test the creation of a temperature quantity with units of K.
     """
     q = quantity.Temperature(1.0, "K")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "K")
Пример #2
0
 def test_degR(self):
     """
     Test the creation of a temperature quantity with units of degrees R.
     """
     q = quantity.Temperature(1.0, "degR")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 5.0 / 9.0, delta=1e-6)
     self.assertEqual(q.units, "degR")
Пример #3
0
 def __init__(self, shapeIndex=None, epsilon=None, sigma=None, dipoleMoment=None, polarizability=None,
              rotrelaxcollnum=None, comment=''):
     self.shapeIndex = shapeIndex
     try:
         self.epsilon = Energy(epsilon)
     except quantity.QuantityError:
         self.epsilon = quantity.Temperature(epsilon)
         self.epsilon.value_si *= constants.R
         self.epsilon.units = 'kJ/mol'
     self.sigma = Length(sigma)
     self.dipoleMoment = DipoleMoment(dipoleMoment)
     self.polarizability = Volume(polarizability)
     self.rotrelaxcollnum = rotrelaxcollnum
     self.comment = comment
Пример #4
0
 def Tlist(self, value):
     self._Tlist = quantity.Temperature(value)
Пример #5
0
 def Tmax(self, value):
     self._Tmax = quantity.Temperature(value)
Пример #6
0
 def Tmin(self, value):
     self._Tmin = quantity.Temperature(value)
Пример #7
0
 def test_degR(self):
     """
     Test the creation of a temperature quantity with units of degrees R.
     """
     with self.assertRaises(NotImplementedError):
         q = quantity.Temperature(1.0, "degR")