Example #1
0
 def test_real_array2(self):
     d = Dictionary()
     d.add_array('real', 0.0, (3, 3))
     d_real = FortranArray(d.get_array('real'))
     d_real[1, 1] = 3.
     d_real[2, 2] = 1.
     d_real[:, 3] = (4., 1., 5.)
     self.assertArrayAlmostEqual(d_real, d['real'])
Example #2
0
 def test_int_array2(self):
     d = Dictionary()
     d.add_array('int', 0, (3, 3))
     d_int = FortranArray(d.get_array('int'))
     d_int[1, 1] = 3
     d_int[2, 2] = 1
     d_int[:, 3] = (4, 1, 5)
     self.assert_(all(d_int == d['int']))