예제 #1
0
 def test_clip_n2(self):
     a_min = -2
     a_max = 4
     x = [-3.3, -1, 6, 3.9]
     a = nthderiv.clip(a_min, a_max, x, n=2)
     b = [0, 0, 0, 0]
     assert_allclose(a, b)
예제 #2
0
 def test_clip_n2(self):
     a_min = -2
     a_max = 4
     x = [-3.3, -1, 6, 3.9]
     a = nthderiv.clip(a_min, a_max, x, n=2)
     b = [0, 0, 0, 0]
     assert_allclose(a, b)
예제 #3
0
 def test_clip_n0(self):
     a_min = -2
     a_max = 4
     x = [-3.3, -1, 6, 3.9]
     a = nthderiv.clip(a_min, a_max, x, n=0)
     b = np.clip(x, a_min, a_max)
     assert_allclose(a, b)
예제 #4
0
 def test_clip_n0(self):
     a_min = -2
     a_max = 4
     x = [-3.3, -1, 6, 3.9]
     a = nthderiv.clip(a_min, a_max, x, n=0)
     b = np.clip(x, a_min, a_max)
     assert_allclose(a, b)