Rename the convenience methods

This commit is contained in:
Steven Silvester
2014-10-08 22:58:31 -05:00
parent 708ab0593b
commit a623fd3e44
2 changed files with 13 additions and 14 deletions
+8 -9
View File
@@ -100,8 +100,8 @@ def roundtrip(img, plugin, suffix):
return new
def ubyte_check(plugin, fmt='png'):
"""Check roundtrip behavior for images that can only be saved as uint8
def color_check(plugin, fmt='png'):
"""Check roundtrip behavior for color images.
All major input types should be handled as ubytes and read
back correctly.
@@ -132,11 +132,10 @@ def ubyte_check(plugin, fmt='png'):
testing.assert_allclose(r5, img)
def full_range_check(plugin, fmt='png'):
def mono_check(plugin, fmt='png'):
"""Check the roundtrip behavior for images that support most types.
All major input types should be handled, except bool is treated
as ubyte and float can treated as uint16 or float.
All major input types should be handled.
"""
img = img_as_ubyte(data.moon())
@@ -169,7 +168,7 @@ def full_range_check(plugin, fmt='png'):
if __name__ == '__main__':
ubyte_check('pil')
full_range_check('pil')
ubyte_check('pil', 'bmp')
full_range_check('pil', 'tiff')
color_check('pil')
mono_check('pil')
mono_check('pil', 'bmp')
mono_check('pil', 'tiff')
+5 -5
View File
@@ -8,7 +8,7 @@ from tempfile import NamedTemporaryFile
from skimage import data_dir
from skimage.io import (imread, imsave, use_plugin, reset_plugins,
Image as ioImage)
from skimage._shared.testing import ubyte_check, full_range_check
from skimage._shared.testing import mono_check, color_check
from six import BytesIO
@@ -157,13 +157,13 @@ def test_imexport_imimport():
def test_all_color():
ubyte_check('pil')
ubyte_check('pil', 'bmp')
color_check('pil')
color_check('pil', 'bmp')
def test_all_mono():
full_range_check('pil')
full_range_check('pil', 'tiff')
mono_check('pil')
mono_check('pil', 'tiff')
class TestSaveTIF: