Exemplo n.º 1
0
    def test_to_fortran(self):
        f = [ExpFormat(10, 5), ExpFormat(12, 10), ExpFormat(12, 10, min=3),
             ExpFormat(10, 5, repeat=3)]
        res = ["(E10.5)", "(E12.10)", "(E12.10E3)", "(3E10.5)"]

        for i, j in zip(f, res):
            assert_equal(i.fortran_format, j)
Exemplo n.º 2
0
 def test_from_number(self):
     f = np.array([1.0, -1.2])
     r_f = [ExpFormat(24, 16, repeat=3), ExpFormat(25, 16, repeat=3)]
     for i, j in zip(f, r_f):
         assert_equal(ExpFormat.from_number(i).__dict__, j.__dict__)
Exemplo n.º 3
0
 def test_repeat_exp_exp(self):
     self._test_equal("(2E8.3E3)", ExpFormat(8, 3, 3, repeat=2))
Exemplo n.º 4
0
 def test_repeat_exp(self):
     self._test_equal("(2E4.3)", ExpFormat(4, 3, repeat=2))
Exemplo n.º 5
0
 def test_exp_exp(self):
     self._test_equal("(E8.3E3)", ExpFormat(8, 3, 3))
Exemplo n.º 6
0
 def test_simple_exp(self):
     self._test_equal("(E4.3)", ExpFormat(4, 3))