Exemple #1
0
 def test_hr(self):
     """
     Test the creation of a time quantity with units of hr.
     """
     q = quantity.Time(1.0, "hr")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 3600.0, delta=1e-6)
     self.assertEqual(q.units, "hr")
Exemple #2
0
 def test_fs(self):
     """
     Test the creation of a time quantity with units of fs.
     """
     q = quantity.Time(1.0, "fs")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0e-15, delta=1e-21)
     self.assertEqual(q.units, "fs")
Exemple #3
0
 def test_min(self):
     """
     Test the creation of a time quantity with units of min.
     """
     q = quantity.Time(1.0, "min")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 60.0, delta=1e-6)
     self.assertEqual(q.units, "min")
Exemple #4
0
 def test_ms(self):
     """
     Test the creation of a time quantity with units of ms.
     """
     q = quantity.Time(1.0, "ms")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0e-3, delta=1e-9)
     self.assertEqual(q.units, "ms")