Beispiel #1
0
 def test_from_symbol_name(self):
     """
     Test :func:`~exa.cms.isotope.Element.from_symbol` and
     :func:`~exa.cms.isotope.Element.from_name`.
     """
     h0 = Element.from_symbol("h")
     h1 = Element.from_name("hydrogen")
     h2 = Element.from_name("HYDROGEN")
     self.assertTrue(np.isclose(h0.mass, h1.mass))
     self.assertTrue(np.isclose(h0.mass, h2.mass))
Beispiel #2
0
 def test_repr(self):
     """Test :class:`~exa.cms.isotope.Element` repr."""
     self.assertIsInstance(repr(Element.from_symbol('H')), string_types)
Beispiel #3
0
 def test_from_isotopes(self):
     """Test :func:`~exa.cms.isotope.Element.from_isotopes`."""
     element = Element.from_isotopes(self.isotopes)
     self.assertIsInstance(element, Element)
     self.assertTrue(np.isclose(element.mass, 1.0079105192))