Exemplo n.º 1
0
def symbols_to_radii():
    '''Mapper from symbol pairs to sum of covalent radii.'''
    df = Isotope.to_frame().drop_duplicates('symbol')
    symbol = df['symbol'].values
    radius = df['radius'].values
    symbols = sum_product_pair(symbol, symbol)
    s = pd.Series(sum_product_pair_f8(radius, radius))
    s.index = symbols
    return s
Exemplo n.º 2
0
 def test_sum_product_pair(self):
     """
     Test :func:`~exa.math.misc.summation.sum_product_pair`. This function
     should work regardless of types.
     """
     r = sum_product_pair(self.s0, self.s0)
     self.assertIsInstance(r, list)
     self.assertEqual(len(r), 250000)
     r = sum_product_pair(self.s0, self.s1)
     self.assertEqual(len(r), 50000)
     self.assertTrue(all(isinstance(rr, str) for rr in r))
     r = sum_product_pair(self.n0, self.n0)
     self.assertIsInstance(r, list)
     self.assertEqual(len(r), 250000)
     r = sum_product_pair(self.n0, self.n1)
     self.assertEqual(len(r), 50000)
     self.assertTrue(all(isinstance(rr, (np.int32, np.int64)) for rr in r))
     r = sum_product_pair(self.f0, self.f0)
     self.assertEqual(len(r), 250000)
     self.assertTrue(all(isinstance(rr, (np.float32, np.float64)) for rr in r))