mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 21:47:10 +08:00
Complete test_regular_grid coverage
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import numpy as np
|
||||
from nose.tools import raises
|
||||
from numpy.testing import assert_equal
|
||||
from skimage.util import regular_grid
|
||||
|
||||
|
||||
def test_regular_grid_full():
|
||||
ar = np.zeros((2, 2))
|
||||
g = regular_grid(ar, 25)
|
||||
assert_equal(g, [slice(None, None, None), slice(None, None, None)])
|
||||
ar[g] = 1
|
||||
assert_equal(ar.size, ar.sum())
|
||||
|
||||
|
||||
def test_regular_grid_2d_8():
|
||||
ar = np.zeros((20, 40))
|
||||
g = regular_grid(ar.shape, 8)
|
||||
|
||||
Reference in New Issue
Block a user