def testsinglereal(self): t = Table() t.append(1.0) t.append(2.0) t.append(3.0) self.assertArrayAlmostEqual(t.real[1, :], farray([1.0, 2.0, 3.0])) t.append(realpart=[4.0, 5.0, 6.0]) self.assertArrayAlmostEqual(t.real[1, :], farray([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])) self.assertArrayAlmostEqual(t.real_part(column=1, n0=t.n), farray([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]))
def testintreal(self): t = Table() t.append(1, 1.0) t.append(2, 2.0) t.append(3, 3.0) t.append(intpart=[4, 5, 6], realpart=[4.0, 5.0, 6.0]) self.assertArrayAlmostEqual(t.int[1, :], farray([1, 2, 3, 4, 5, 6])) self.assertArrayAlmostEqual(t.int_part(column=1, n0=t.n), farray([1, 2, 3, 4, 5, 6])) self.assertArrayAlmostEqual(t.real[1, :], farray([1, 2, 3, 4, 5, 6])) self.assertArrayAlmostEqual(t.real_part(column=1, n0=t.n), farray([1, 2, 3, 4, 5, 6]))