Ejemplo n.º 1
0
 def test_kg_m2(self):
     """
     Test the creation of a moment of inertia quantity with units of kg*m^2.
     """
     q = quantity.Inertia(1.0, "kg*m^2")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "kg*m^2")
Ejemplo n.º 2
0
 def test_amu_angstrom2(self):
     """
     Test the creation of a moment of inertia quantity with units of amu*angstrom^2.
     """
     q = quantity.Inertia(1.0,"amu*angstrom^2")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si*constants.Na*1e23, 1.0, delta=1e-6)
     self.assertEqual(q.units, "amu*angstrom^2")