예제 #1
0
 def test_CheckNoInvalidNumbers_01(self):
     _, fd = OverwriteFunctions.from_dict(xaxis=[1, 2, 3],
                                          functions={
                                              "A": [3, 4, 5],
                                              "B": [6, 7, 8],
                                              "C": [9, 10, 11]
                                          }).alter_curves(None)
     CheckNoInvalidNumbers().alter_curves(fd)
예제 #2
0
    def test_CheckNoInvalidNumbers_07(self):
        _, fd = OverwriteFunctions.from_dict(xaxis=[1, 2, 3, 4, 5],
                                             functions={
                                                 "A": [3, 4, 5, 6, 7],
                                                 "B": [6, 7, 8, 9, 10],
                                                 "C": [9, 10, 11, 12, np.nan]
                                             }).alter_curves(None)

        with self.assertRaises(ValueError) as context:
            CheckNoInvalidNumbers().alter_curves(fd)

        self.assertTrue(
            'a cell in curves is either NaN, +infinite or -infinite!' in
            context.exception.args)