示例#1
0
 def test_not_zero_of_negative_value_closer_than_limit_returns_limit(self):
     self.assertEqual(-np.finfo(np.float64).resolution,
                      utils.not_zero(-1e-20))
示例#2
0
 def test_not_zero_of_negative_value_preserves_sign(self):
     self.assertLess(utils.not_zero(-1e-20), 0)
示例#3
0
 def test_not_zero_of_zero_returns_np_float_resolution(self):
     self.assertEqual(np.finfo(np.float64).resolution, utils.not_zero(0))
示例#4
0
 def test_not_zero_of_positive_value_preserves_sign(self):
     self.assertGreater(utils.not_zero(1e-20), 0)
示例#5
0
 def test_not_zero_of_zero_returns_nonzero_value(self):
     self.assertGreater(utils.not_zero(0), 0)