def test_chop_2(self): self.assertEqual(hfmath.chop(0.123, 1e-2), 0.123) self.assertEqual(hfmath.chop(0.009999, 1e-2), 0.)
def test_chop_1(self): res = hfmath.chop(np.array([0.123, 0.012, 0.00999]), 1e-2) self.assertAllclose(res, np.array([0.123, 0.012, 0]))