From b5da90e4c7126037b47e452460d04939af967a10 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 16 Oct 2014 04:49:45 -0500 Subject: [PATCH] Just disable doctests in tifffile_local --- skimage/external/tifffile/tifffile_local.py | 72 ++++++++++----------- tools/travis_test.sh | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/skimage/external/tifffile/tifffile_local.py b/skimage/external/tifffile/tifffile_local.py index b2d3303a..17d430b0 100644 --- a/skimage/external/tifffile/tifffile_local.py +++ b/skimage/external/tifffile/tifffile_local.py @@ -116,13 +116,13 @@ References Examples -------- ->>> data = numpy.random.rand(5, 301, 219) ->>> imsave('temp.tif', data) +>> data = numpy.random.rand(5, 301, 219) +>> imsave('temp.tif', data) ->>> image = imread('temp.tif') ->>> numpy.testing.assert_array_equal(image, data) +>> image = imread('temp.tif') +>> numpy.testing.assert_array_equal(image, data) ->>> with TiffFile('temp.tif') as tif: +>> with TiffFile('temp.tif') as tif: ... images = tif.asarray() ... for page in tif: ... for tag in page.tags.values(): @@ -180,9 +180,9 @@ def imsave(filename, data, **kwargs): Examples -------- - >>> data = numpy.random.rand(2, 5, 3, 301, 219) - >>> description = u'{"shape": %s}' % str(list(data.shape)) - >>> imsave('temp.tif', data, compress=6, + >> data = numpy.random.rand(2, 5, 3, 301, 219) + >> description = u'{"shape": %s}' % str(list(data.shape)) + >> imsave('temp.tif', data, compress=6, ... extratags=[(270, 's', 0, description, True)]) """ @@ -209,8 +209,8 @@ class TiffWriter(object): Examples -------- - >>> data = numpy.random.rand(2, 5, 3, 301, 219) - >>> with TiffWriter('temp.tif', bigtiff=True) as tif: + >> data = numpy.random.rand(2, 5, 3, 301, 219) + >> with TiffWriter('temp.tif', bigtiff=True) as tif: ... for i in range(data.shape[0]): ... tif.save(data[i], compress=6) @@ -663,11 +663,11 @@ def imread(files, **kwargs): Examples -------- - >>> im = imread('test.tif', key=0) - >>> im.shape + >> im = imread('test.tif', key=0) + >> im.shape (256, 256, 4) - >>> ims = imread(['test.tif', 'test.tif']) - >>> ims.shape + >> ims = imread(['test.tif', 'test.tif']) + >> ims.shape (2, 256, 256, 4) """ @@ -733,7 +733,7 @@ class TiffFile(object): Examples -------- - >>> with TiffFile('test.tif') as tif: + >> with TiffFile('test.tif') as tif: ... data = tif.asarray() ... data.shape (256, 256, 4) @@ -2215,11 +2215,11 @@ class TiffSequence(object): Examples -------- - >>> tifs = TiffSequence("test.oif.files/*.tif") - >>> tifs.shape, tifs.axes + >> tifs = TiffSequence("test.oif.files/*.tif") + >> tifs.shape, tifs.axes ((2, 100), 'CT') - >>> data = tifs.asarray() - >>> data.shape + >> data = tifs.asarray() + >> data.shape (2, 100, 256, 256) """ @@ -3316,12 +3316,12 @@ def unpackrgb(data, dtype='>> data = struct.pack('BBBB', 0x21, 0x08, 0xff, 0xff) - >>> print(unpackrgb(data, '> data = struct.pack('BBBB', 0x21, 0x08, 0xff, 0xff) + >> print(unpackrgb(data, '>> print(unpackrgb(data, '> print(unpackrgb(data, '>> print(unpackrgb(data, '> print(unpackrgb(data, '>> squeeze_axes((5, 1, 2, 1, 1), 'TZYXC') + >> squeeze_axes((5, 1, 2, 1, 1), 'TZYXC') ((5, 2, 1), 'TYX') """ @@ -3397,7 +3397,7 @@ def transpose_axes(data, axes, asaxes='CTZYX'): A view is returned if possible. - >>> transpose_axes(numpy.zeros((2, 3, 4, 5)), 'TYXC', asaxes='CTZYX').shape + >> transpose_axes(numpy.zeros((2, 3, 4, 5)), 'TYXC', asaxes='CTZYX').shape (5, 2, 1, 3, 4) """ @@ -3448,7 +3448,7 @@ def stripnull(string): Clean NULL terminated C strings. - >>> stripnull(b'string\\x00') + >> stripnull(b'string\\x00') b'string' """ @@ -3461,9 +3461,9 @@ def stripascii(string): Clean NULL separated and terminated TIFF strings. - >>> stripascii(b'string\\x00string\\n\\x01\\x00') + >> stripascii(b'string\\x00string\\n\\x01\\x00') b'string\\x00string\\n' - >>> stripascii(b'\\x00') + >> stripascii(b'\\x00') b'' """ @@ -3490,9 +3490,9 @@ def format_size(size): def sequence(value): """Return tuple containing value if value is not a sequence. - >>> sequence(1) + >> sequence(1) (1,) - >>> sequence([1]) + >> sequence([1]) [1] """ @@ -3508,9 +3508,9 @@ def product(iterable): Equivalent of functools.reduce(operator.mul, iterable, 1). - >>> product([2**8, 2**30]) + >> product([2**8, 2**30]) 274877906944 - >>> product([]) + >> product([]) 1 """ @@ -3525,7 +3525,7 @@ def natural_sorted(iterable): E.g. for sorting file names. - >>> natural_sorted(['f1', 'f2', 'f10']) + >> natural_sorted(['f1', 'f2', 'f10']) ['f1', 'f2', 'f10'] """ @@ -3540,7 +3540,7 @@ def excel_datetime(timestamp, epoch=datetime.datetime.fromordinal(693594)): Convert LSM time stamps. - >>> excel_datetime(40237.029999999795) + >> excel_datetime(40237.029999999795) datetime.datetime(2010, 2, 28, 0, 43, 11, 999982) """ @@ -3552,7 +3552,7 @@ def julian_datetime(julianday, milisecond=0): Convert Julian dates according to MetaMorph. - >>> julian_datetime(2451576, 54362783) + >> julian_datetime(2451576, 54362783) datetime.datetime(2000, 2, 2, 15, 6, 2, 783) """ @@ -3586,7 +3586,7 @@ def test_tifffile(directory='testimages', verbose=True): Print error message on failure. - >>> test_tifffile(verbose=False) + >> test_tifffile(verbose=False) """ successful = 0 diff --git a/tools/travis_test.sh b/tools/travis_test.sh index 2b8588de..dddd6d07 100755 --- a/tools/travis_test.sh +++ b/tools/travis_test.sh @@ -40,7 +40,7 @@ echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc tools/header.py "Run tests with all dependencies" # run tests again with optional dependencies to get more coverage -TEST_ARGS='--exe -v --with-doctest --exclude="skimage/external/*"' +TEST_ARGS='--exe -v --with-doctest' if [[ $TRAVIS_PYTHON_VERSION == 3.3 ]]; then TEST_ARGS="$TEST_ARGS --with-cov --cover-package skimage" fi