Example #1
0
 def test_compute_element(self):
     """
     Test :func:`~exa.cms.isotope.Isotope.element` and
     :func:`~exa.cms.isotope.Meta.compute_element`.
     """
     h = Isotope.element("H")
     hh = Isotope.element("hydrogen")
     o = Isotope.element("O")
     u = Isotope.element("uranium")
     self.assertTrue(np.isclose(h.mass, 1.0079105192))
     self.assertEqual(hh.name, "hydrogen")
     self.assertEqual(o.name, "oxygen")
     self.assertEqual(u.name, "uranium")
Example #2
0
 def setUp(self):
     """Test is performed on hydrogen."""
     iso = Isotope.to_frame()
     self.isotopes = iso[iso['name'] == "hydrogen"]