def test_mismatched_ndim(): a = np.zeros((8, 8)) a[:2] = 2 a = np.array([a]) with pytest.raises(ValueError): median_filter(a > 0, np.ones((3, 3)))
def test_median_filter(): A = np.zeros((128, 128), bool) A[3::3, 3::3] = 1 Am = median_filter(A) assert not Am.any() assert Am.shape == A.shape
def test_uint8(): # This used to raise an exception in 0.7.1 f = np.arange(64 * 4).reshape((16, -1)) median_filter(f.astype(np.uint8), np.ones((5, 5)))
def test_median_filter(): A = np.zeros((128,128), bool) A[3::3,3::3] = 1 Am = median_filter(A) assert not Am.any() assert Am.shape == A.shape
def test_mismatched_ndim(): a = np.zeros((8,8)) a[:2] = 2 a = np.array([a]) median_filter(a > 0, np.ones((3,3)))
def test_uint8(): # This used to raise an exception in 0.7.1 f = np.arange(64*4).reshape((16,-1)) median_filter(f.astype(np.uint8), np.ones((5,5)))
def test_mismatched_ndim(): a = np.zeros((8, 8)) a[:2] = 2 a = np.array([a]) median_filter(a > 0, np.ones((3, 3)))